120

I tried to use my Virtual Box and this is the error I received - (I just updated to the new Ubuntu also) and I am VERY new at this Linux OS.

Kernel driver not installed (rc=-1908)

The VirtualBox Linux kernel driver (vboxdrv) is either not loaded or there is a permission problem with /dev/vboxdrv. Please reinstall the kernel module by executing

'/etc/init.d/vboxdrv setup'

as root. Users of Ubuntu, Fedora or Mandriva should install the DKMS package first. This package keeps track of Linux kernel changes and recompiles the vboxdrv kernel module if necessary.

Virtualbox Kernel driver not installed

Nicolas Raoul
  • 11,603
Cyndi
  • 1,201

24 Answers24

95

Re-install virtualbox-dkms package first

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

After that You can enable it manually

sudo modprobe vboxdrv
sudo modprobe vboxnetflt
iegik
  • 1,843
  • 17
    sudo modprobe vboxnetflt results in FATAL: Module vboxnetflt not found. same for vboxdrv – weberc2 Jan 10 '13 at 23:38
  • 4
    Also, when installing virtualbox-dkms, I get non-error output like this: Module build for the currently running kernel was skipped since the kernel source for this kernel does not seem to be installed. – weberc2 Jan 10 '13 at 23:39
  • 1
    Thanks just doing this solved it for me: sudo apt-get remove virtualbox-dkms / sudo apt-get install virtualbox-dkms – David Sep 18 '13 at 20:15
  • 1
    On 13.10, with virtualbox-qt package installed this was the best solution for me, but with sudo apt-get install dkms virtualbox-dkms. Those packages installed the modules automatically, no other command was necessary. – Nathan Kidd Mar 08 '14 at 15:55
  • 3
    On 14.04 this also worked for me. It's important to make sure you install the headers for your kernel (see @Husni's answer) before reinstalling virtualbox-dkms, or the modules will not be built. – adelphus Mar 19 '15 at 16:17
  • Try 'sudo apt-get autoremove' (no quotest) if you have problems with this solution. – Mike Jr Jun 28 '15 at 20:20
  • This removes virtualbox-5.0 if installed, installing an outdated version of VirtualBox instead. – Nicolas Raoul Nov 17 '15 at 05:07
  • For 16.10 installing virutalbox (virtualbox-qt) did not install virtualbox-dkms (or dkms), leading to this problem. Would have expected this to be fixed by now, especially for a live iso 3 years later – Xen2050 Apr 19 '17 at 23:20
  • 1
    Upgrading from Zesty to Artful I needed to follow https://askubuntu.com/a/969596/49860 and sudo apt install linux-headers-lowlatency to fix these modules: they were built for the generic kernel but not the lowlatency variant. – Jesse Glick Oct 31 '17 at 19:43
  • modprobe: FATAL: Module vboxdrv not found in directory /lib/modules/4.4.0-109-generic – Aaron Franke Jan 22 '18 at 02:13
  • 1
    worked for elementary OS 6.1 Jólnir Built on Ubuntu 20.04.3 LTS Linux 5.11.0-44-generic – Leo Fisher Jan 12 '22 at 05:45
  • with sudo modprobe vboxdrv I got error "'vboxdrv': Operation not permitted" and fixed with the help of https://crazytechgo.com/modprobe-error-could-not-insert-vboxdrv-operation-not-permitted/ – e11438 Apr 22 '22 at 10:02
  • I wonder, that this is still working :) – iegik Nov 29 '23 at 07:11
48

Most probably all you have to do is run

sudo apt-get install dkms

(or install dkms from the software center)

and then run

sudo /etc/init.d/vboxdrv setup

and write your password.

if you have any error with this commands use this one

sudo modprobe vboxdrv
Chriskin
  • 3,242
  • 52
    vboxdrv doesn't exist. – weberc2 Jan 10 '13 at 23:01
  • 1
    @weberc2 VirtualBox OSE from Ubuntu repo doesn't have it, the virtualbox.org version does have it. $ dpkg -S /etc/init.d/vboxdrv virtualbox-4.2: /etc/init.d/vboxdrv – gertvdijk Jan 10 '13 at 23:19
  • 1
    @gertvdijk gotcha. I'm going to try some of the other answers in this question first, but failing that I'll use the one from virtualbox.org. Why are so many of the apps in the Ubuntu repo are crippled when the generic versions are not? /rant – weberc2 Jan 10 '13 at 23:44
  • 2
    Too bad I have to run after every reboot :-/ Is there a more permanent solution? Or is this actually supposed to be permanent, and I have another problem? – Nicolas Raoul Aug 07 '15 at 02:41
  • 8
    sudo: /etc/init.d/vboxdrv: command not found – Aaron Franke Apr 15 '18 at 22:16
  • modprobe: ERROR: could not insert 'vboxdrv': Required key not available – Archisman Panigrahi Oct 20 '18 at 08:47
  • Worked after installing the .deb file from Virtualbox Dowload page. (Mint 17.2 that is Ubuntu Tasty) – Fabiano Tarlao May 08 '19 at 18:14
16

here is solution which works for me on 12.10:

  1. Install the latest version of virtualbox according your architecture and distribution version from https://www.virtualbox.org/wiki/Linux_Downloads

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

  3. run sudo /etc/init.d/vboxdrv setup

Last two steps quoted from one of the comments to the bug on the same theme - https://bugs.launchpad.net/ubuntu/+source/virtualbox/+bug/1016165

14

In Ubuntu 14.04, 64 bit, what worked for me is

sudo dpkg-reconfigure virtualbox-dkms
12

On 12.10, these solutions all failed for me. However the following worked:

  1. Run command:

    sudo gedit /etc/apt/sources.list.d/vbox.list
    

    and paste in this line, then save:

    deb http://download.virtualbox.org/virtualbox/debian quantal contrib
    

    (replace quantal with your release's codename)

  2. Run:

    sudo apt-get update && sudo apt-get -y upgrade
    

    to update your machine to the latest

  3. Run:

    sudo apt-get remove virtualbox
    

    Then install Oracle's version:

    sudo apt-get install virtualbox-4.3
    

    (replacing 4.3 with the version you are targeting)

Should work now. Don't forget to download the extension pack from http://www.virtualbox.org as well.

Seth
  • 58,122
windfix
  • 131
6

Another reason why this can happen is that you have an older GCC version (like I had GCC 4.8 installed on Ubuntu 16.04) set as default (by, for example, using update-alternatives) when you try to update or reinstall VirtualBox.

Just go back to default GCC version that came with your distro for VirtualBox installation, and it'll work fine.

You can then switch back to an older GCC version after VirtualBox is installed.

Alexander Revo
  • 160
  • 1
  • 5
5

I have the same issue and solved by these two steps:

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

then

/etc/init.d/vboxdrv setup
Husni
  • 561
5

I have deb http://download.virtualbox.org/virtualbox/debian precise contrib in my /etc/apt/sources.list, to be able to use Virtualbox 5.x.

Faced with the same error, I tried all of the methods here and none work but this (bandwith-wasting) one:

  1. sudo apt-get purge virtualbox virtualbox-4* virtualbox-5*
  2. Reboot
  3. sudo apt-get install virtualbox-5.0
  4. Install the latest extension pack from https://www.virtualbox.org/wiki/Downloads
Nicolas Raoul
  • 11,603
4
sudo apt-get install linux-headers-generic build-essential dkms
sudo apt-get remove --purge virtualbox-dkms
sudo apt-get install virtualbox-dkms

Just use three command for ubuntu users.

jsingh
  • 887
3

Took me a long time to solve this issue. Had this problem with vBox across 2 distros (Ubuntu and Arch).

I had dkms and all the modules already installed and compiled into my kernel, yet I still got a module related error message when I tried to run a vBox virtual machine.

If your vBox GUI starts without a hitch but get an error telling to install the VBoxDrv kernel module when you try to run a virtual machine, your problems are not related to installing the modules into your kernel but ACTIVATING THEM in modprobe which the module installation script fails to do.

To load a module manually (such as vboxdrv in your case), open a terminal prompt and put in :

sudo modprobe vboxdrv

If you Virtual Machine runs after that without giving you an error message, then you can activate the vboxdrv module permanently by going to /etc/modules-load.d/ and making a .conf file (such as vbox.conf). In the .conf file the names of the vbox kernel modules you want to add, such as: vboxdrv.

Save and reboot

You can also ad these optional modules: vboxnetadp, vboxnetflt and vboxpci

From Vbox's wiki:

vboxnetadp and vboxnetflt are both needed when you intend to use the "Host-only networking" feature. More precisely, vboxnetadp is needed to create the host interface in the VirtualBox global preferences, and vboxnetflt is needed to launch a virtual machine using that network interface.

vboxpci is needed when your virtual machine needs to pass through a PCI device on your host.

Note: If the VirtualBox kernel modules were loaded in the kernel while you updated the modules, you need to reload them manually to use the new updated version. To do it, run vboxreload as root.

thebunnyrules
  • 1,083
  • 1
  • 13
  • 20
2

I found this works for me (quoted from virtualbox.org forum):

sudo apt-get install dkms build-essential linux-headers-generic

If you want further granularity you can install the headers as such:

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

After this step reinstall the virtualbox related packages.

Some people in the forum said that only the second version worked for them.

Eric Carvalho
  • 54,385
lucacerone
  • 1,690
2

Did you install Virtualbox by downloading it from some web site?

If so, I'd recommend you to install it using the Ubuntu Software Center instead (type Virtualbox and click on install and you're set).

If you have some terminal skills, type this into the console:

sudo apt-get install virtualbox-ose

If you still want to do weird stuff to you computer/OS, then install the dependencies by hand: virtualbox-ose-dkms, libgl1-mesa-glx

weberc2
  • 1,402
Noe Nieto
  • 339
  • Thanks, I have no terminal skills but am going to try and learn some :) and I did not install it, but am heading to try the software center. I was getting an error when I tried to update the new Virtualbox so maybe that will help also. I have the Oracle Virtualbox will go into it and see what it has... – Cyndi May 08 '11 at 20:35
1

I had the same error on the VirtualBox start after the kernel upgrade. virtualbox-dkms could not be resinstalled because I used the latest (non-default) Ubuntu kernel and virtualbox-dkms has not been patched yet for that kernel:

$ sudo apt-get install --reinstall virtualbox-dkms
...
ERROR (dkms apport): kernel package linux-headers-4.12.14-041214-generic is not supported
Error! Bad return status for module build on kernel: 4.12.14-041214-generic (x86_64)
Consult /var/lib/dkms/virtualbox/5.0.40/build/make.log for more information.
Job for virtualbox.service failed because the control process exited with error code. See "systemctl status virtualbox.service" and "journalctl -xe" for details.
invoke-rc.d: initscript virtualbox, action "restart" failed.
● virtualbox.service - LSB: VirtualBox Linux kernel module
   Loaded: loaded (/etc/init.d/virtualbox; bad; vendor preset: enabled)
   Active: failed (Result: exit-code) since Mon 2017-10-23 02:31:15 CEST; 4ms ago
     Docs: man:systemd-sysv-generator(8)
  Process: 10851 ExecStart=/etc/init.d/virtualbox start (code=exited, status=1/FAILURE)
...

So, I ended up with installation of the latest VirtualBox from Oracle, which works fine!

luart
  • 960
  • Thank you so much, I tried almost every other suggestion in others and this thread, and only this seemed to hep. So it might be perhaps due to some automatic core increase. – FantomX1 Jan 08 '21 at 14:12
  • Symptoms ' Kernel Driver Not Installed , failed to start lsb , modprobe: FATAL: Module vboxdrv not found , VERR_VM_DRIVER_NOT_INSTALLED ' – FantomX1 Jan 08 '21 at 15:33
0

I think Chriskin provided the answer, but you also want to make sure you have the proper Linux headers installed, as husni pointed out:

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

then

sudo apt-get install dkms
sudo /etc/init.d/vboxdrv setup
Eric Carvalho
  • 54,385
jason
  • 174
  • 7
  • 2
    This doesn't work. The /etc/init.d/vboxdrv file still doesn't exist. It was a nice try though. – weberc2 Jan 10 '13 at 23:47
0

I had exactly the same problem. My solution was to totally reinstall VirtualBox, with the following commands:

1) Delete (backup) the hidden VirutalBox directory in your home directory

mv ~/.VirtualBox ~/.VirtualBox-backup

2) Reinstall VirtualBox

sudo apt-get purge virtualbox
sudo apt-get install virtualbox

3) Run VirtualBox and set it (Virtual Images) up again.

psiphi75
  • 946
  • 1
  • 13
  • 25
0

This worked for me:

wget -O /tmp/virtualbox.patch 'http://bugs.debian.org/cgi-bin/bugreport.cgi?msg=99;filename=vbox-wheezy.patch;att=1;bug=696011'
cd /usr/src/virtualbox-4.1.12/
patch -p4 < /tmp/virtualbox.patch
dkms autoinstall
Thomas Ward
  • 74,764
0

I had this problem in Kubuntu Vivid. I was struggling for a long time with the error "Your kernel headers for kernel 3.13.0-36-generic cannot be found.", and apt-get was unable to find it in the repositories.

The solution was to add a repository from trusty

deb http://security.ubuntu.com/ubuntu trusty-security main 

to /etc/apt/sources.list, and install with

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

and then run

sudo /etc/init.d/vboxdrv setup
Jon
  • 101
0

I am using Ubuntu 14.04, I was having similar problem.My problem is solved by using below command for virtualbox installation:

sudo sh -c "echo 'deb http://download.virtualbox.org/virtualbox/debian '$(lsb_release -cs)' contrib non-free' > /etc/apt/sources.list.d/virtualbox.list" && wget -q http://download.virtualbox.org/virtualbox/debian/oracle_vbox.asc -O- | sudo apt-key add - && sudo apt-get update && sudo apt-get install virtualbox-5.0

Actually it will remove your current version of Virtualbox and will install virtualbox-5.0 from the oracle maintained repository.

The above command is available at https://help.ubuntu.com/community/VirtualBox/Installation

0

i had this problem with Kubuntu 14.04.3 + virtualbox 4.3.10 from standard ubuntu trusty repository and none of previous solutions worked. the only solution was to add virtualbox.org repository and upgrade to latest virtualbox (4.3.32). you can do that with this command:

sudo sh -c "echo 'deb http://download.virtualbox.org/virtualbox/debian '$(lsb_release -cs)' contrib non-free' > /etc/apt/sources.list.d/virtualbox.list" && wget -q http://download.virtualbox.org/virtualbox/debian/oracle_vbox.asc -O- | sudo apt-key add - && sudo apt-get update && sudo apt-get install virtualbox-4.3
A.B.
  • 90,397
moky
  • 1
0

Not sure where else to drop this but for purposes of completeness: I had the same problem after an upgrade to 15.10. I tried everything mentioned in this post and others to no avail. My problem was that I kept missing hints that the root problem was with the kernel itself. It wasn't properly updated during the upgrade from 15.04 to 15.10. Mine was solved by Ubuntu kernel not updating with 15.10 which I then followed up with both of the "sudo dpkg-reconfigure" mentioned in answers here.

Dennis
  • 2,473
0

If I remember correctly I installed virtual-box using the .deb downloaded from the virtual box site, on 15.10. I fixed this problem by simply installing this package:

$ sudo apt-get install virtualbox-dkms
0

None of the answers mention simple solution which works for me.

sudo /usr/lib/virtualbox/vboxdrv.sh setup

I have Ubuntu 15.10 and Oracle VM 5.0.20. I've found the solution in vbox ticket.

jangorecki
  • 185
  • 5
  • 25
0

I am on Linux Mint Rafaela 17.2, but with kernel update to v4.4 (xenial, 4.4.0-57). Since it is based on Ubuntu 14.04 (Trusty), I added this PPA: https://www.ubuntuupdates.org/ppa/virtualbox.org_contrib?dist=trusty

purged old v5.0 and installed latest VirtualBox:

sudo apt-get update
sudo apt-get install virtualbox-5.1

Voila!

sequielo
  • 281
  • 2
  • 4
0

Having upgraded my kernel recently I was unable to boot any images.

I ran

sudo apt-get purge virtualbox

Then I added the 5.1v of virtualbox. I am using Mint, so I ran lsb_release -c to see which version I was using, which was sarah for me, so I added

deb http://download.virtualbox.org/virtualbox/debian sarah contrib

But for Ubuntu users, edit /etc/apt/sources.list file and add one of the following lines according to your distribution to your system:

  • For Ubuntu 17.04 ("Zesty")

    deb http://download.virtualbox.org/virtualbox/debian zesty contrib
    
  • For Ubuntu 16.04 ("Xenial")

    deb http://download.virtualbox.org/virtualbox/debian xenial contrib
    
  • For Ubuntu 14.04 ("Trusty")

    deb http://download.virtualbox.org/virtualbox/debian trusty contrib
    

Now get the cert for these

wget -q https://www.virtualbox.org/download/oracle_vbox_2016.asc -O- | sudo apt-key add -
wget -q https://www.virtualbox.org/download/oracle_vbox.asc -O- | sudo apt-key add -

Then update and install

sudo apt-get update
sudo apt-get install virtualbox-5.1

Now you can freely open VB... or at least I could.

wjandrea
  • 14,236
  • 4
  • 48
  • 98