Unable to Install VirtualBox Due to Missing Kernel Module

I am trying to install VirtualBox on my Ubuntu.

I first tried to sudo apt-get install virtualbox-ose in a terminal, but after the configuration step, it fails with an error:

No suitable module for running kernel found
When proceeding with starting virtualbox, I get this error:
WARNING: The character device /dev/vboxdrv does not exist.
Please install the virtualbox-ose-dkms package and the appropriate
headers, most likely linux-headers-generic.

You will not be able to start VMs until this problem is fixed.

So I tried the package from http://www.virtualbox.org/, but starting VirtualBox fails with:

WARNING: The vboxdrv kernel module is not loaded. Either there is no module
available for the current kernel (2.6.38-8-generic-pae) 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.

So I ran sudo /etc/init.d/vboxdrv setup, but it fails too:

* 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 2.6.38-8-generic-pae cannot be found at
/lib/modules/2.6.38-8-generic-pae/build or /lib/modules/2.6.38-8-generic-pae/source.

* Failed, trying without DKMS
* Recompiling VirtualBox kernel modules                                                                             
* Look at /var/log/vbox-install.log to find out what went wrong

The contents of /var/log/vbox-install.log.

As I am stuck, I also tried to install kernel-devel with yum, still fruitless:

[email protected]# yum install kernel-devel
Setting up Install Process
No package kernel-devel available.
Nothing to do

Now I’ve no idea how to correct this. Any ideas?

Here is Solutions:

We have many solutions to this problem, But we recommend you to use the first solution because it is tested & true solution that will 100% work for you.

Solution 1

Doing everything as root by using su and the yum package manager is something that fits for Redhat-based distros, but not Ubuntu. In Ubuntu, you run command as root by prefixing commands with sudo. The package manager used by Ubuntu is apt.

To install VirtualBox, run:

sudo apt-get install virtualbox-ose

This will take care of dependencies like the kernel headers which is included in the package linux-headers-generic. If you’ve a PAE kernel, you need to install the headers first (in your case linux-headers-2.6.38-8-generic-pae), which can be done with:

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

uname -r gives the loaded kernel version and saved you from manually entering the kernel version.

Solution 2

I was having the same issue. I had the linux-headers-<version>-generic-pae installed but was ironically missing the linux-headers-generic-pae. If you install those that should help maybe.

Good luck!

Solution 3

Install build-essentials.

apt-get install build-essentials 

and install linux-kernel-headers

apt-get install linux-kernel-headers 

or

apt-get install linux-kernel-*

Install dkms

apt-get install dkms

Note: Use and implement solution 1 because this method fully tested our system.
Thank you 🙂

All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply