VirtualBox '/etc/init.d/vboxdrv setup' issue

I have installed VirtualBox through the software centre, but when I try to start a VM, I get the following 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.

I already updated my dkms and installed linux-headers, but this /etc/init.d/vboxdrv doesn't exist.

I have been googling but I can't find an answer.


Solution 1:

I also encountered this issue several times once I upgrade my linux kernel.

What I did:

sudo apt-get install linux-headers-`uname -r`

Reconfigure dkms and load module:

sudo dpkg-reconfigure virtualbox-dkms  
sudo modprobe vboxdrv

Then VirtualBox works. No computer reboot needed.

Solution 2:

Here's EXACTLY how to do it on 12.10:

Make sure there are no traces of dkms, (virtualbox/ virtualbox-4.2), linux generic headers (..17):

***Replace virtualbox-4.2 with the version you have already installed. If you haven't installed it yet then proceed to step 2.

  1. sudo apt-get purge virtualbox-4.2 dkms linux-headers-$(uname -r)
  2. sudo apt-get install linux-headers-$(uname -r)
  3. sudo apt-get install virtualbox-4.2

You MUST install the linux headers BEFORE virtualbox otherwise the VBox installation will error when trying to set up the vboxdrv section because the linux headers aren't installed.

Solution 3:

Reinstall "virtualbox-dkms"

sudo apt-get install --reinstall virtualbox-dkms

It worked for me.

Solution 4:

Should peruse /var/log/vbox-install.log file to determine the issue. If the problem persists, you may want to download and install the latest v4.2.2 version directly from https://www.virtualbox.org/wiki/Downloads (for kernel 3.6.* and below). Good luck.