Recompiling Virtualbox Kernel Module

July 7th, 2008

If after installing a new kernel you may get an error message when you try to start Virtualbox saying something like ‘The vboxdrv kernel module was either not loaded…’. If you then read the logs the solution is actually written there.

Re-setup the kernel module by executing ‘/etc/init.d/vboxdrv setup’ as root.

Sure enough this command fixes the problem and rebuilds the kernel module for the currently running kernel.

# /etc/init.d/vboxdrv setup
Stopping VirtualBox kernel module          [  OK  ]
Recompiling VirtualBox kernel module       [  OK  ]
Starting VirtualBox kernel module          [  OK  ]
Google BookmarksEvernoteGoogle GmailHotmailWordPressLinkedInFacebookDeliciousShare

22 responses

  1. Luigi comments:

    This is what I get…

    # /etc/init.d/vboxdrv setup
    Stopping VirtualBox kernel module [ OK ]
    Recompiling VirtualBox kernel module [ FAILED ]
    Starting VirtualBox kernel module [ FAILED ]

    Am running Fedora 9 64 on a AMD AM2

  2. linuxFreak comments:

    Hi All, I got the same error . I ‘m running FC9 . I got eh following error msg , Can some one please let me know what is the prob…..I use the following link for installing vbox ,

    http://spoilt.blogsite.org/wordpress/index.php/2008/05/06/how-to-install-virtualbox-on-fedora-8

    Error: sudo /etc/init.d/vboxdrv setup
    Stopping VirtualBox kernel module [ OK ]
    Recompiling VirtualBox kernel module [FAILED]
    (Look at /var/log/vbox-install.log to find out what went wrong)

    Thanks in App.

  3. F0T0N comments:

    In FC9, I uninstall the VirtualBox and then I install it again. I don’t lose any file.

  4. greenish tinted Linux user comments:

    sudo /etc/init.d/vboxdrv setup

    worked form me. AMD Athlon 5000+ 64 Ubuntu Kernel 2.6.27-9-generic

    When I tried previously it said vboxdrv setup could not be found. But it worked today.

    Thanks.

  5. Andyb comments:

    “sudo /etc/init.d/vboxdrv setup ”

    This doesn’t work in Fedora 10. If fails to recompile the VirtualBox kernal module.

  6. Brian comments:

    I have Fedora 10 64 and this work for me. Thanks.

  7. roclan comments:

    On Ubuntu Hardy – after installing 2.6.24-23-generic, my error message said:

    VERR_VM_DRIVER_NOT_INSTALLED (rc=-1908)

    The VirtualBox Linux kernel driver (vboxdrv) is either not loaded or there is a permission problem with /dev/vboxdrv. Re-setup the kernel module by executing

    ‘/etc/init.d/vboxdrv setup’

    as root. Users of Ubuntu or Fedora should install the DKMS package at first. This package keeps track of Linux kernel changes and recompiles the vboxdrv kernel module if necessary.

    So I installed the DKMS package and then ran

    sudo /etc/init.d/vboxdrv setup

    worked fine!

  8. varis comments:

    Thanks
    sudo /etc/init.d/vboxdrv setup
    worked fine!!!!! werry fine!!!

  9. Milton comments:

    Good tip !!! Really help me :-) Thanks.

    I use Fedora 10 x64,

    I think the other users who had problems does not have the kernel-headers

    As root:

    # yum -y install kernel-headers

  10. Ian comments:

    I upgraded from Ubuntu 8.04 to 8.10 and Virtualbox wouldn’t start. I’ve tried reinstalling it several times but no joy until I renamed the .VirtualBox folder in my home folder and reinstalled. I kept getting the message that it couldn’t convert the XML from version 1.7 (that’s not verbatim…) and suggesting I run /etc/init.d/vboxdrv setup. Problem is when I do that it says setup is not a valid option! The only valid options are start, stop, restart and status. If I try any of the others I get a message saying “No suitable module for running kernel found.” After I reinstalled after renaming .Virtual box it starts but I get the 1908 error also mentioned in this thread. I have DKMS installed, and it was from the start. I would really like to get back my version of Virtualbox I had running under 8.04 as I had installed and used some Windoze programs, and there is some data in there. Any chance of that happening?…

    Thanks,
    Ian

  11. Roachy comments:

    Many thanks – that saved me some effort :)

  12. Barclay comments:

    i keep getting this no matter what!
    “barclay@barclay-laptop:~$ /etc/init.d/vboxdrv setup
    * Stopping VirtualBox kernel module
    *(<–this star is red) Cannot unload module vboxnetadp
    barclay@barclay-laptop:~$ "

    things in () dont appear in kernel just extra info

  13. davidDAE comments:

    The solution that works for me is this:

    #yum install kernel-PAE-devel
    #/etc/init.d/vboxdrv setup

    Fedora 12.

    I hope this can help you.

  14. Rodolfo comments:

    Thanks a lot davidDAE, installing kernel-PAE-devel worked for me.

  15. Alex comments:

    Thanks, kernel-PAE-devel worked always on Fedora 13.

    Stopping VirtualBox kernel module [ OK ]
    Recompiling VirtualBox kernel module [ OK ]
    Starting VirtualBox kernel module [ OK ]

  16. Alex comments:

    Thanks, kernel-PAE-devel worked always on Fedora 13.

  17. Krieger comments:

    Valeu… Kernel-PAE-devel funfou!!

  18. Murray comments:

    ran

    export KERN_DIR=/usr/src/kernels/2.6.18-194.11.3.el5-i686/

    and all is ok

    Stopping VirtualBox kernel module [ OK ]
    Recompiling VirtualBox kernel module [ OK ]
    Starting VirtualBox kernel module [ OK ]

  19. CharlesTown comments:

    Murray great mark!!

    My problem was the path for the KER_DIR i pointed on

    KERN_DIR=/usr/src/kernels/2.6.18-194.1—PAE

    and it seemed to be fine but…. i crash with other error iin the installation :

    Starting VirtualBox kernel module [FAILED]
    (modprobe vboxdrv failed. Please use ‘dmesg’ to find out why)

    [root@char modules]# yum -y install kernel-devel gcc-c++

    and finally it works!! i found more help here :

    http://forums.virtualbox.org/viewtopic.php?f=7&t=31441

    works on fedora 13

  20. Cristian Stroparo comments:

    Just an update, as nowadays it is vboxadd and not vboxdrv ;) (in the same dir. i.e. /etc/init.d)

  21. Mat Lilly comments:

    I had a time getting VirtualBox to run on both Fedora 14 & 15. Missing the kernel. init.d/vboxdrv setup always failed. Running on an el-cheapo Dell Netbook (32 bit, 10v). I tried everything everywhere, and could not get it to work. I don’t know if someone else has already cited this, but it fixed absolutely everything instantly. I wish I would have thought of it before all of the frustration.

    Simply….

    sudo yum install kernel-devel-$(uname -r)

  22. salman comments:

    I have installed Oracle Enterprise Linux 6.1 and VirtualBox 4.1.4 on it.
    I have done everything but the following error wasn’t resolved.

    # /etc/init.d/vboxdrv setup
    Recompiling VirtualBox kernel module [ FAILED ]
    Starting VirtualBox kernel module [ FAILED ]

    Please help me in that.

Leave a comment

Switch to our mobile site