VirtualBox vboxdrv problem on Ubuntu

Posted: November 9, 2012 in 12.04, 12.10, 13.04, Ubuntu, VirtualBox, Virtualization
Tags: , , ,

Problem Statement:


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.


Failed to open a session for the virtual machine “Windows XP”.

The virtual machine ‘Windows XP’ has terminated unexpectedly during startup with exit code 1.

(Running a virtual machine on VirtualBox the two dialogues would say that)

The cause — as the VirtualBox page states it:

Ubuntu/Debian users might want to install the dkms package to ensure that the VirtualBox host kernel modules (vboxdrv, vboxnetflt and vboxnetadp) are properly updated if the linux kernel version changes during the next apt-get upgrade.

The Fix:

The dkms package can be installed through the Synaptic Package manager or through the following command:

sudo apt-get install dkms

Running `virtualbox` in the terminal says almost the same thing…

$ virtualbox
WARNING: The vboxdrv kernel module is not loaded. Either there is no module
available for the current kernel (3.5.0-18-generic) or it failed to
load. Please recompile the kernel module and install it by

sudo /etc/init.d/vboxdrv setup

You will not be able to start VMs until this problem is fixed.
# You have heard the man!
$ sudo /etc/init.d/vboxdrv setup
* Stopping VirtualBox kernel modules [ OK ]
* Uninstalling old VirtualBox DKMS kernel modules [ OK ]
* Trying to register the VirtualBox kernel modules using DKMS
Error! Your kernel headers for kernel 3.5.0-18-generic cannot be found.
Please install the linux-headers-3.5.0-18-generic package,
or use the --kernelsourcedir option to tell DKMS where it's located

* Failed, trying without DKMS
* Recompiling VirtualBox kernel modules
* Look at /var/log/vbox-install.log to find out what went wrong
# Downloading the Linux Headers now
# sudo apt-get install linux-headers-3.5.0-18-generic
$ sudo apt-get install linux-headers-`uname -r`
# Running it again
$ sudo /etc/init.d/vboxdrv setup
* Stopping VirtualBox kernel modules                          [ OK ]
* Uninstalling old VirtualBox DKMS kernel modules             [ OK ]
* Trying to register the VirtualBox kernel modules using DKMS [ OK ]
* Starting VirtualBox kernel modules                          [ OK ]

All good!

About these ads
  1. Stewart Johnston says:

    Thank you so much! When entered correctly, unfortunately needing to use sudo, it works. In five minutes you have solved the problem that 100 other google results couldn’t. Live long and prosper.

  2. lasitha says:

    not working bro… plz help

    sudo: /etc/init.d/vboxdrv: command not found

    • Are you not using Ubuntu?

      Try a couple of things for me.
      Instead of sudo, go to su directly. And then try to follow the steps mentioned (without sudo)

      If that doesn’t work, try to uninstall virtualbox and install it back. Try to build the module now.

      Otherwise check as root if this /etc/rc.d/vboxdrv exists. Use it instead.

      I downloaded the .deb directly from virtualbox website, instead of from the software channel.

  3. lasitha says:

    i’ll try..i’m using ubuntu…12.10… now feeling very bad about 12.10…very hard to handle..12.04LTS was working fine & smoothly..even hard to handle touchpad..tried changing settings .but didnt..anyway i’ll try …thank you

  4. ryan says:

    Same problem here with 12.10. Have DKMS installed and header files but there is no vboxdrv file in init.d.

    sudo find / | grep vboxdrv

    There is a virtualbox file in init.d but no setup command for it.

    • Oh if that’s the case then what does the dialogue box tell you? Does it still say vboxdrv in “init.d“?

      I scanned the forums and found out that relying on software release channel is not a good idea. So, go ahead and download that latest version of Virtualbox from the website. I did that too. Currently, I am running RC2 for 4.2!

      Also, I think “sudo find / -name vboxdrv” would be a more efficient way to find files. What say?

  5. John Doe says:

    Hi @All

    [b]sudo apt-get purge virtualbox-dkms
    sudo apt-get update
    sudo apt-get install virtualbox-dkms

    Works fine for me (without rebooting)

  6. vincent says:

    Thank you so much! Helped me after a couple of hours of headache!

  7. Epic says:

    Thanks it worked :D

  8. Islam Nazir says:

    i doesn’t work with me

  9. Islam Nazir says:

    finally i installed virtual box in ubuntu 12.10

    1-uname -r
    take the result and put it in the blow commend instead of uname -r

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

  10. fbenson says:

    Finally, is working now…

  11. Dann says:

    sudo apt-get install linux-headers-$(uname -r)
    sudo apt-get remove virtualbox-dkms
    sudo apt-get install virtualbox-dkms

  12. Tom says:

    Thanks a lot, but why not using sudo apt-get install linux-headers-generic

    Greets Tom

  13. Manish says:

    same problem with Virtual Box in RHEL 6.. any solutions

  14. Amrra says:

    hola yo les voy a contar mi experiencia

    Primero yo note que terminado de instalar ubuntu 12.10 quita o des-habilita las
    kernel headers.

    Así que las instale desde el centro de sofwere de ubunto ( los chistos es que al reiniciar me deshabilitaba todos los dispositovos de red entonces antes que reiniciara corria los siguientes comandos desde una terminal.

    Abre una terminal

    apt-get update
    apt-get install gnome-system-tools

    Busca Usuarios y grupos —- Ajustes avanzados —- Privilegios del usuario
    Marca la casilla donde dice:
    Usar la solución de virtualizacion de VirtualBox
    hay tambien puedes habilitar los dispositovos de red audio y video q se deshabilitan cuando instalas las headers kernel


  15. Devendra Sawant says:

    Thanks alot Nikunj

  16. Greg says:

    Many, many thanks!
    Worked like a charm on Ubuntu 14.04, following your commands to the letter.
    Was having a miserable time until then.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s