I might be bailing from Windows, but I still need it for work. Luckily I’ve been using Virtualbox for my work machine (for a variety of reasons I won’t get into here). However, I installed Vbox 5.02 on my Ubuntu MATE laptop, imported my virtual machine, and upon first run was greeted with:
Kernel driver not installed (rc=-1908)
The VirtualBox Linux kernel driver (vboxdrv) is either not loaded or there is a permission problem with /dev/vboxdrv. Please reinstall the kernel module by executing
as root. Users of Ubuntu, Fedora or Mandriva should install the DKMS package first. This package keeps track of Linux kernel changes and recompiles the vboxdrv kernel module if necessary.
I tried what the error said, but no dice. It could not recompile the vboxdrv kernel module. After a bit of searching around I found the following solution:
sudo apt-get install dkms build-essential linux-headers-generic; sudo /etc/init.d/vboxdrv setup
Expanding drive space in VirtualBox has gotten easier! Just clone the VDI (this step isn’t required, but if something goes wrong you’ll be happy you did it), then zap the clone with this:
VBoxManage modifyhd <absolute path to file> --resize <size in MB>
Fire up the clone. If you’re running a modern Windows OS you can use Disk Manager to expand the partition to fill the volume. Otherwise check out gparted.
Since I’m running remote sessions within a VirtualBoxed OS on my workstation I find I have to do this with some regularity, so I may as well document it here.
cmd /c echo off | clip
When I created my vmdk for my work virt in VirtualBox I made the mistaken assumption that by “dynamic” they meant the drive size would expand as necessary. What they really meant was that the drive would expand as necessary within the limits of the initial drive size setting – which I stupidly set to 20 gig.
Expanding your vmdk for VirtualBox is really a misnomer. You have to create a new one of the size you want and then clone your old one over to it. It’s a little time consuming, but not hard. Disclosure: My host is running Windows 7 64 and my VM is running Windows 7 32. Why bother? It’s a security thing.
- Shut down your VM (obivously)
- Within the VirtualBox Manager, open the Settings for your existing VM, then choose Storage.
- Add a hard disk to the controller. Make it the same type as your current disk, and make it the size you need.
- Once it’s created open a command prompt and head to the directory containing vboxmanage.exe – typically in C:\Program Files\Oracle\VirtualBox\
- Run the following, altering the paths to match your current and new vmdk files:
vboxmanage clonehd "C:\Users\USER\VirtualBox VMs\Work\Work-disk1.vmdk" "C:\Users\USER\VirtualBox VMs\Work\Work-disk2.vmdk" --existing
- Twiddle thumbs.
- Once that’s complete, reopen the VirtualBox Manager and head back to Settings > Storage. Add an existing hard disk to your controller, choosing your new drive. Disconnect your original drive.
- Fire up your VM, from within it navigate to disk management, and expand away.