28

So, I tried creating an OS with VirtualBox, and I got this error:

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. If it is available in your distribution, you should install the DKMS package first. This package keeps track of Linux kernel changes and recompiles the vboxdrv kernel module if necessary.

So I did the obvious, running the Vboxdrv setup. I ran this command:

sudo service vboxdrv setup

I got an error while doing so.:

stopping kernel drivers...done.

Uninstalling old virtualbox dkms kernel modules/etc/init.d/voboxdrv: 302: /etc/init.d/vboxdrv: /usr/share/virtualbox/src/vboxhost/do_dkms: not found
...done.
(Failed, trying without DKMS)
recompiling VirtualBox kernel modules...failed!
(look at /var/log/vbox-install.log to find out what went wrong.)

So, I took a look at /var/log/vbox-install.log to see if I can find anything. I got this error:

/etc/init.d/vboxdrv: 334: /etc/init.d/vboxdrv: /usr/share/virtualbox/src/vboxhost/build_in_tmp: not found

Any help? Thanks.

4 Answers4

28

Finally got this working. Looks like DKMS is not working as it should(?). After reinstalling virtualbox-dkms, my VMs are back up.

sudo apt-get --reinstall install virtualbox-dkms
  • 1
    I say that DKMS is not working as reinstalling virtualbox-dkms returned multiple results like the following: `vboxnetflt.ko: Running module version sanity check.
    • Original module
      • No original module exists within this kernel
    • Installation
      • Installing to /lib/modules/3.13.0-35-generic/updates/dkms/`

    ...

    `vboxpci.ko: Running module version sanity check.

    • Original module
      • No original module exists within this kernel
    • Installation
      • Installing to /lib/modules/3.13.0-35-generic/updates/dkms/`
    – Crusty Barnacle Aug 31 '14 at 21:39
  • This works for me – Ker Ruben Ramos Mar 29 '15 at 18:40
  • 1
    @CrustyBarnacle I am just going through the same issues :o ... it seems that for the virtualbox install I had no 'src' folder so when I ran the setup command it uninstalled my old VB kernel but failed to recompile a new one (same as yours) - this is why "no original module exists" error is coming up - BTW my issues started just after I did the latest ubuntu update of the day.... hmm... related? – code_fodder Dec 17 '15 at 08:12
  • @christopher, love you man. – Haisum Usman Mar 19 '19 at 05:43
6

I would suggest the following:

First, ensure that you have the headers and other required elements to build programs. Open a terminal window ctrl+alt+t

sudo apt-get install build-essential libssl-dev linux-headers-`uname -r`

Secondly, install the dkms module so that you do not face this problem after kernel updates

sudo apt-get install dkms

Finally, try the command as suggested by the first error message

sudo -i
/etc/init.d/vboxdrv setup
exit
Charles Green
  • 21,339
  • Hello, thanks for your reply. I get the same error message I lastly said. Any suggestions? – user287210 Aug 03 '14 at 20:25
  • @user287210 No, at this point I would uninstall / purge the virtualbox program and reinstall it - do you know which version you have? – Charles Green Aug 03 '14 at 22:58
  • I either installed it with sudo apt-get install virtualbox vityualbox-dkms dkms, or I installed the installer from the oracle website. I heard installin it from the website does people good, so I'm going to purge whatever I have and reinstall from website and I'll tell you what happens. – user287210 Aug 04 '14 at 10:17
  • xfce ubuntu 14.04, I purged the packages and installed VirtualBox from https://www.virtualbox.org/wiki/Linux_Downloads , the AMD64 for 14.04. I installed it with a debi package installer. The virtualbox version I installed was 4.3.14. I opened up VirtualBox and I got the same error that suggested I use the vboxdrv setup. I did the setup and I got the same error I did last time i did it. – user287210 Aug 04 '14 at 10:29
  • I poked through a bunch of similar problems - You seem to be on the right track - is the output in the logfile /var/log/vbox-install.log different than before? Is your OS version fully updated? – Charles Green Aug 04 '14 at 15:39
  • I was able to upgrade/update a couple things, so now it is updated. Still wouldn't work when I tried after that. So I checked if the log was different, and it was. I got this error: ""Makefile:183: *** Error: unable to find the sources of your current Linux kernel. Specify KERN_DIR= and run Make again. Stop."" It seems like the kernel driver isn't installed, or it's in a different directory. – user287210 Aug 04 '14 at 17:03
  • Can you add to your question the outputs of uname -a and apt-cache policy linux-headers-$(uname -r) – Charles Green Aug 04 '14 at 21:24
  • uname -a: "Linux localhost 3.8.11 #1 SMP Thu Jul 4 14:29:14 PDT 2014 x86_64 x86_64 x86_64 GNU/Linux" apt-cache policy linux-headers-$(uname -r): "Unable to locate package linux-headers-3.8.11" and "Couldn't find any package by regex 'linux-headers-3.8.11" – user287210 Aug 04 '14 at 22:09
  • K - so you're running 12.04.4 LTS - it appears that you still need to get the linux headers installed. What does the command sudo apt-get install linux-headers-$(uname -r) do? – Charles Green Aug 04 '14 at 23:39
  • "Unable to locate package linux-headers-3.8.11" is the first error, and the second error is "Couldn't find any package by regex 'linux-headers-3.8.11" – user287210 Aug 06 '14 at 10:42
  • Hm. I thought you were running 12.04.4, fairly updated. The 3.8 kernel is pretty old - you may need to locate the headers somewhere in the archives unless you want to update the kernel. – Charles Green Aug 06 '14 at 14:27
  • I checked the update manager, and there isn't any update for the kernel, and I couldn't find anything interesting in the archives. – user287210 Aug 06 '14 at 18:26
  • try sudo apt-get update && sudo apt-get dist-upgrade – Charles Green Aug 06 '14 at 22:18
  • Done I got some things to install, I did sudo service vboxdrv setup, doesn't work, I look at the log and I get the error I got earlier, Makefile:183: *** Error: unable to find the sources of your current Linux kernel. Specify KERN_DIR=<directory> and run Make again. Stop. Any suggestions? – user287210 Aug 08 '14 at 10:54
  • Followed this to the letter in LXLE 14.04 and it worked a treat – BJ292 Mar 08 '15 at 21:12
  • @CharlesGreen Thank you so much, out of many solution in internet, this one worked finally. – rajuGT Nov 03 '15 at 20:56
2

Use "All distributions - run Installer" (bottommost entry of this list) instead of a deb or rpm package! This fixed the error for me (Ubuntu 14.10 + VirtualBox 4.3.26).

A.B.
  • 90,397
1

After trying @Crusty_Barnacle and @Charles_Green solutions without success, I made sure my distro (Ubuntu 14.04) was fully up-to-date then did:

aptitude purge virtualbox virtualbox-dkms virtualbox-qt
aptitude install virtualbox

And everything worked fine again.

Hope this may help others.