Saturday, September 22, 2012

VirtualBox Error After Kernel Upgrade

The Error

You're probably here because you're seeing a pop-up error message when trying to start a virtual machine, similar to:
Kernel driver not installed (rc=-1908)

The VirtualBox Linux kernel driver (vboxdrv) is probably not loaded.

If you installed or VirtualBox package recently you need to restart the computer for the driver to load.

Alternatively, you may attempt to load the driver by issuing the following command with system administrator (root) privileges:

'/etc/sysconfig/modules/VirtualBox.modules'


The Diagnosis

Although there are a few clues in this message as to what VirtualBox's issue is, there aren't any likely solutions included.  That being said, if you DID install VirtualBox recently and haven't restarted... try that first (and/or try the included command 'sudo /etc/sysconfig/modules/VirtualBox.modules' to attempt to load the kernel module).

The issue here is that VirtualBox requires a loaded kernel module that matches the version of the kernel you're running.  The error likely occurred after a kernel upgrade -- that's been the cause for me EVERY time.  So... the fix?  Install the VirtualBox kernel module that matches your kernel version, of course.


The Solution

In case you want a few details on it...

You can find out the version of the kernel you're running with
uname -r
This is what mine looks like
[user@i7-fedora ~]$ uname -r
3.5.4-1.fc17.x86_64
The result tells you: the kernel version (3.5.4-1), the distribution version (fc17 -- "Fedora Core 17"), and the processor architecture your distro is based around (x86_64).

Fortunately, Fedora's kernel module packages are named using this same nomenclature.  Our needed VirtualBox kernel module, for example, (for this kernel version) is called kmod-VirtualBox-3.5.4-1.fc17.x86_64.  To acquire said module, run this bad boy:
sudo yum install kmod-VirtualBox-3.5.4-1.fc17.x86_64
It's a little long-winded with all the numbers, dashes, and dots...  Fortunately, there is an easier solution.  There is a Fedora metapackage called kmod-VirtualBox.x86_64 whose description is "Metapackage which tracks in VirtualBox kernel module for newest kernel".  Awesome.  You don't have to worry about all of the details.  Just run
sudo yum install kmod-VirtualBox.x86_64
and you should be good to go!  The beautiful thing about the metapackage is that it will show up along with the rest of your system/software upgrades every time there is a kernel upgrade; so, you shouldn't have to worry about it from here on out.

Once the module is installed, you can either reboot or run
sudo /etc/sysconfig/modules/VirtualBox.modules
to get the module loaded.  Then, all that's left is to just enjoy the amazing open source virtualization software as its creators intended.


You've gotten better at Linux! (2)

No comments:

Post a Comment