45

I am trying to install virtualbox and make it work but it doesn't seem like I can. In the image you can see the output.

Command line output

If I run VBoxManage --version I get:

WARNING: The character device /dev/vboxdrv does not exist.
Please install the virtualbox-dkms package and the appropriate
headers, most likely linux-headers-generic.

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

But virtualbox-dkms is already installed and at the latest version. So I tried to reinstall it and i got this:

cli output 2

Any help will be appreciated.

EDIT:

The output after reconfigure (@M.Tarun suggestion):

cli output 3

EDIT 2:

Also installed the sources as @Hmayag instructed, purged virtualbox and installed it again but I got the same problem.

  • 1
    Kalispera Antoni. The installer is trying to build the kernel module but fails to locate the kernel source files. The clue is Module build for the currently running kernel was skipped since the kernel sources for this kernel does not seem to be installed. Check that you have those installed. Make sure they match the running kernel version. I think apt-get source linux-image-$(uname -r) should do it. – hmayag May 13 '14 at 20:25
  • Kalispera:). Unfortunately nothing happened. Please see my second edit. – Antonis Gr May 13 '14 at 20:37
  • Also installed dpkg-dev and ran the command again but no luck. – Antonis Gr May 13 '14 at 20:48
  • Try with sudo appended in front. – hmayag May 13 '14 at 20:49
  • With no luck I meant that VirtualBox still doesn't work. Sources were succesfully installed. Now I purged VirtualBox and I am about to install it again. If something good happens I ll let you know! – Antonis Gr May 13 '14 at 20:52
  • Again the same. * No suitable module for running kernel found – Antonis Gr May 13 '14 at 20:56
  • 2
    You probably have a mismatch between the running kernel and the installed header. Can you add the output of uname -a and dpkg -l | grep linux-headers? – Rmano May 13 '14 at 21:57
  • 1
    Upgrade to latest kernel. You seem to be running 3.11. – bain May 14 '14 at 00:11
  • Tried it this command in Terminal sudo /etc/init.d/vboxdrv setup – Abdul Kadir May 21 '14 at 12:08
  • @Rmano I am facing the same problem. Here is the output https://dpaste.de/s0mi – Vaibhav Jain Oct 08 '15 at 07:04
  • Found solution on http://askubuntu.com/questions/582109/14-10-virtualbox-no-suitable-module-for-running-kernel-found-cannot-find-ker – Vaibhav Jain Oct 08 '15 at 07:54
  • Yep, same problem as http://askubuntu.com/questions/449905/wrong-kernel-after-upgrade-old-kernel-still-installed --- still happens a lot. – Rmano Oct 08 '15 at 07:58

11 Answers11

70

Basically after you install those two packages you also need to do the reconfiguration:

sudo dpkg-reconfigure virtualbox-dkms
sudo dpkg-reconfigure virtualbox
sudo modprobe vboxdrv

And to fix eth0:

sudo modprobe vboxnetflt
Eric Carvalho
  • 54,385
M.Tarun
  • 5,001
  • 6
  • 33
  • 64
17

I solved this problem by following commands:

sudo apt-get install linux-headers-generic
sudo dpkg-reconfigure virtualbox-dkms
amc
  • 7,142
  • Thanks this helped me on ubuntu 14.04 after a dist upgrade somehow linux headers changed – sandino Aug 24 '15 at 15:31
  • 5
    This helped me. I was able to fix with: sudo apt-get install linux-headers-`uname -r` and then sudo dpkg-reconfigure virtualbox-dkms. Thanks! – stitakis Jan 12 '17 at 20:48
  • @stitakis your comment should be an answer so I could upvote i properly – rioted Aug 21 '17 at 14:40
3

The reason for the problem is that you have booted the 3.11 kernel while the dpkg-reconfigure expects a 3.13 kernel. That's why you get the message 'no suitable module for the running kernel'.

Be sure to update your bootloader.

In my case the bootloader is updated from another OS (Debian) and booting to that and running sudo update-grub solved the problem.

Zanna
  • 70,465
Pit
  • 31
2

I wasn't able to fix the problem with any other solution suggested, so I made a fresh 14.04 installation and everything is fine now.

2

I used the vendor’s official guide for Debian-based Linux distributions:

printf 'deb http://download.virtualbox.org/virtualbox/debian %s contrib\n' "$(lsb_release -cs)" | sudo tee /etc/apt/sources.list.d/virtualbox.list

wget -qO- https://www.virtualbox.org/download/oracle_vbox{,_2016}.asc | sudo apt-key add -

sudo apt-get purge virtualbox
sudo apt-get update
sudo apt-get install virtualbox-5.0 dkms
David Foerster
  • 36,264
  • 56
  • 94
  • 147
1

In my case, the issue was having virtualbox-4.1 installed alongside virtualbox-4.2. Once I uninstalled 4.1, I could run sudo /etc/init.d/vboxdrv setup and sudo modprobe vboxdrv just fine, as well as start VMs.

Anthony Naddeo
  • 241
  • 1
  • 4
1

You have to check the version of gcc your are using. I was facing the same problem of virtualbox kernel compilation. I fixed the issue using this post https://www.virtualbox.org/ticket/12467

You probably are using a outdated version of gcc that is different of the gcc used by the Linux kernel.

Check the default version your are using :

gcc -v

Mine is gcc version 4.4.7 (Ubuntu/Linaro 4.4.7-8ubuntu1)

And the gcc version your kernel was compiled with

dmesg | more
[    0.000000] Linux version 3.13.0-83-generic (buildd@lgw01-55) (gcc version 4.8.2 (Ubuntu 4.8.2-19ubuntu1) ) #127-Ubuntu SMP Fri Mar 11 00:25:37 UTC 2016 (Ubuntu 3.13.0-83.127-generic 3.13.11-ckt35)

or with

dpkg -l gcc

If the gcc versions are different like on my system, switch your default gcc compiler

sudo update-alternatives --config gcc

then virtualbox-dkms installation should works fine

sudo apt-get --reinstall install virtualbox-dkms
JohnWolf
  • 11
  • 2
0

I had the same error on ubuntu 19.04 disco. I could solve it by disabling secure boot (via BIOS).

Melebius
  • 11,431
  • 9
  • 52
  • 78
Cie6ohpa
  • 166
0

The clue is here: Please install the virtualbox-dkms package and the appropriate headers, most likely linux-headers-generic.

Since you have the first, it must still want the second.

sudo apt-get install linux-headers-generic

Then make sure everything is up to date.

sudo apt-get update

sudo apt-get upgrade

Elder Geek
  • 36,023
  • 25
  • 98
  • 183
  • 2
    Sorry just forgot to write that I have them too. linux-headers-generic is already the newest version. is the output when i try to install them. – Antonis Gr May 13 '14 at 20:11
  • 2
    Thank you, I added that information to your question to insure that you get accurate answers – Elder Geek May 13 '14 at 20:15
0

I had the same issue. I found that the source of the problem is most probably that I'm using a custom kernel.

Downloading the latest .deb package from virtualbox.org, and installing it by dpkg -i has solved the problem in my case.

-1

Try

sudo /etc/init.d/vboxdrv setup
Abdul Kadir
  • 333
  • 1
  • 9