Ubuntu – How to fix a vboxdrv setup failure in VirtualBox


So, I tried creating an OS with VirtualBox, and I got this error:

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

'/etc/init.d/vboxdrv setup'

as root. If it is available in your distribution, you should install the DKMS package first. This package keeps track of Linux kernel changes and recompiles the vboxdrv kernel module if necessary.

So I did the obvious, running the Vboxdrv setup. I ran this command:

sudo service vboxdrv setup

I got an error while doing so.:

stopping kernel drivers...done.

Uninstalling old virtualbox dkms kernel modules/etc/init.d/voboxdrv: 302: /etc/init.d/vboxdrv: /usr/share/virtualbox/src/vboxhost/do_dkms: not found
(Failed, trying without DKMS)
recompiling VirtualBox kernel modules...failed!
(look at /var/log/vbox-install.log to find out what went wrong.)

So, I took a look at /var/log/vbox-install.log to see if I can find anything. I got this error:

/etc/init.d/vboxdrv: 334: /etc/init.d/vboxdrv: /usr/share/virtualbox/src/vboxhost/build_in_tmp: not found

Any help? Thanks.

Best Answer

Finally got this working. Looks like DKMS is not working as it should(?). After reinstalling virtualbox-dkms, my VMs are back up.

sudo apt-get --reinstall install virtualbox-dkms