Ubuntu – How to install the virtualbox-dkms package


I am getting the following error when attempting to install the VirtualBox kernel modules :

Deleting module version: 4.1.18
completely from the DKMS tree.
Loading new virtualbox-4.1.18 DKMS files...
Building only for 3.5.0-17-generic
Module build for the currently running kernel was skipped since the
kernel source for this kernel does not seem to be installed.

I have tried installing the linux-source package, but I am not sure how Ubuntu handles kernel sources and headers.

Any ideas on how to do this from an Ubuntu standpoint?

Best Answer

My Virtual Box told me that the kernel drivers were not installed. I ran

sudo apt-get remove virtualbox-dkms   

to remove the drivers and then re-installed them

sudo apt-get install virtualbox-dkms 

which rebuilt the drivers and I was able to run virtualbox with no problems