VirtualBox doesn't load after 12.04 upgrade

Solution 1:

I had a similar problem. Here is what worked for me:

This may be required if you get a kernel sources not found type of error:

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

Then reconfigure the relevant packages to kick them in to rebuilding.

sudo dpkg-reconfigure virtualbox-dkms 
sudo dpkg-reconfigure virtualbox

Solution 2:

I ended up uninstalling and reinstalling virtualbox using apt-get. It saw that there were kernel parts missing and installed them.

sudo apt-get remove virtualbox
sudo apt-get install virtualbox

Solution 3:

This worked for me too:

sudo apt-get remove virtualbox
sudo apt-get install virtualbox

However, I had to add:

sudo modprobe vboxdrv

Solution 4:

This answer is based on @curtis's answer, apparenly the answer's version specific

You are using the wrong version for building the dkms. Try this:

sudo dkms install virtualbox/4.1.12

It appears to have worked for me. This is after you install the virtualbox-dkms package of course.

the version can be changed (in bold given in the quotation).

So try:

ls -d /usr/src/virtualbox*

which will give you something like

/usr/src/virtualbox-version

now take version and use it in the command above like

sudo dkms install virtualbox/version

If that is not giving you

Module virtualbox/version already installed on kernel kernelVersion-generic/architecture

run this following commands after that(taken from other answers on the post)

  • rebuilding just the kernel modules

    sudo dpkg-reconfigure virtualbox-dkms

  • reinstalling

    sudo apt-get remove virtualbox && sudo apt-get install virtualbox

and if required, load the module sudo modprobe vboxdrv

if DKMS is showing error that some kernel is missing, then just install the kernel and then rebuild/reinstall virtualbox.

EDIT: apparently this is also exist on 12.10