Unable to Install VirtualBox Due to Missing Kernel Module

55,931

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
Share:
55,931

Related videos on Youtube

SoftTimur
Author by

SoftTimur

Updated on September 18, 2022

Comments

  • SoftTimur
    SoftTimur over 1 year

    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:

    root@ubuntu# 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?

    • Admin
      Admin almost 13 years
      yum? are you using ubuntu? who says you need kernel-devel?
    • Admin
      Admin almost 13 years
      Pffft, install Virtualbox from the repositories.
    • Admin
      Admin almost 13 years
      I am still stuck on Yum :(
    • Admin
      Admin almost 13 years
      Could you post the contents of /var/log/kern.log on paste.ubuntu.com and post the link here?
    • Admin
      Admin almost 13 years
      @Lekensteyn do you need /var/log/kern.log after executing which commands?
    • Admin
      Admin almost 13 years
      No, old entries are visible too.
    • Admin
      Admin almost 13 years
      @Lekensteyn here it is /var/log/kern.log
    • Admin
      Admin over 12 years
      I had a similar problem. I already had virtual box 4.1.4 installed but when I updated my ubuntu kernel to 2.6.35-30-generic-pae, it stopped working. I'm kind of surprised that when I updated the kernel the headers weren't updated as well. I solved the problem by running sudo apt-get install linux-headers-2.6.35-30-generic-pae and then sudo /etc/init.d/vboxdrv setup
  • SoftTimur
    SoftTimur almost 13 years
    Thanks for your reply, actually I tried this approach in the first place, but got some problem, could you please take a look?askubuntu.com/questions/49052/…
  • Lekensteyn
    Lekensteyn almost 13 years
    virtualbox-4.0 is not in the default repositories. Do you've a 3rd-party PPA installed? Remove that PPA or package and install virtualbox-ose.
  • Thomas Ward
    Thomas Ward almost 13 years
    @SoftTimur you should NOT post duplicate questions, if they're related to the same problem, they could get flagged as such.
  • SoftTimur
    SoftTimur almost 13 years
    Guys, thanks for your reply, I have edited the 2 questions which are linked... hope there will be a solution...
  • Lekensteyn
    Lekensteyn almost 13 years
    @SoftTimur: do not forget to purge virtualbox before (sudo apt-get purge virtualbox-4.0 virtualbox-ose)
  • SoftTimur
    SoftTimur almost 13 years
    Indeed, I could install virtualbox-ose well after installing linux-headers-2.6.38-8-generic-pae, thank you very much, @Lekensteyn
  • Amanda
    Amanda almost 13 years
    This did work for me, though I had to also run sudo modprobe vboxdrv to actually boot.
  • Lekensteyn
    Lekensteyn almost 13 years
    I think the installation order is important, without the headers, the kernel module build fails. After installing, the module is available, but not immediately loaded. So after a reboot (or with modprobe), it should be loaded. That's what I guess.
  • SH_Rohit
    SH_Rohit about 12 years
    sorry for the wrong indentation .. apt-get install build-essential linux-kernel-* dkms
  • Lekensteyn
    Lekensteyn about 12 years
    There is no such package as build-essentials, it's build-essential. linux-kernel-* packages do not exist, it's named linux-headers-...-generic where ... is the kernel version.