56

I tried to set up an virtual machine on Ubuntu 12.10.I installed Oracle Vm VirtualBox Manager. Then, i followed the steps and i choose .iso file from settings>storage.Then clicked live cd/dvd option.Then OK,when i clicked to start button i get such an error :

 Kernel driver not installed (rc=-1908)

 The VirtualBox Linux kernel driver (vboxdrv) is either not loaded or there is a                   
 permissionproblem 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.

I reinstalled program and rebooted pc, but not worked.Also, updated kernel driver but not worked.What can be done to solve it ?

Óscar Andreu
  • 1,630
  • 13
  • 32
  • A solution for this problem that worked for me is here http://askubuntu.com/questions/205154/virtualbox-etc-init-d-vboxdrv-setup-issue – higuaro Jun 20 '13 at 18:44
  • [This answer](https://stackoverflow.com/questions/39030662/cant-install-virtualbox-in-arch/59536730#59536730) I posted solved the issue for me – Adriana Hernández Dec 30 '19 at 21:23

18 Answers18

57

Thought I'd give my 2 cents for those who use MACs

sudo /Library/Application\ Support/VirtualBox/LaunchDaemons/VirtualBoxStartup.sh restart
Alex
  • 843
  • 8
  • 15
  • Ran into this when trying to run GenyMotion. Works perfectly! – Aaron Foltz Apr 09 '14 at 01:40
  • 1
    Works for macOS Mojave. – ᴠɪɴᴄᴇɴᴛ Sep 16 '19 at 10:05
  • 4
    This unfortunately didn't work for my macOS Catalina (10.15.2.). I get this error /Library/Application Support/VirtualBox/VBoxDrv.kext failed to load - (libkern/kext) system policy prevents loading; check the system/kernel logs for errors or try kextutil(8). – Christoph H. Jan 25 '20 at 16:14
  • 6
    @ChristophH. I had to go into System Preferences > Security & Privacy and then allow VirtualBox to load. Also make sure VirtualBox is closed when you run the above script. More info here: https://medium.com/@Aenon/mac-virtualbox-kernel-driver-error-df39e7e10cd8 – Jannik Jan 26 '20 at 16:05
  • 2
    @ChristophH. I did the same as Jannik mentioned. I ran the command then went to Security & Privacy, allowed Oracle, then ran the command again. It should work the second time. – 2upmedia Apr 01 '20 at 02:51
  • This worked perfectly fine on macOS Big Sur. Thanks for the solution @Alex. – akshitmahajan Feb 23 '21 at 14:08
  • It works on Big Sur. Thanks. – kakadais Mar 06 '21 at 04:58
  • 3
    VirtualBox has to be closed and it will work on MacOS Big Sur – ICeZer0 Apr 08 '21 at 15:26
  • Perfect! That works for Big Sur. Thanks – Jonathan Aug 30 '21 at 04:16
  • Works for macOS Monterey 12.1&12.2 – linjiejun Feb 08 '22 at 02:08
  • Error Domain=KMErrorDomain Code=71 "Kernel request failed: (libkern/kext) not found (-603947002)" UserInfo={NSLocalizedDescription=Kernel request failed: (libkern/kext) not found (-603947002)} – Maveňツ Aug 23 '22 at 06:26
28
sudo apt-get remove virtualbox-dkms
sudo apt-get install virtualbox-dkms

source: http://ubuntuforums.org/showthread.php?t=1885936&page=6

ps. I have this issue everytime I get a Linux kernel update in Ubuntu. The instructions that it gives do not work for me but these two commands work everytime. It would be nice if everytime I got a kernel update these two commands would automatically run afterwards...

Elijah Lynn
  • 12,272
  • 10
  • 61
  • 91
  • ERROR: Cannot create report: [Errno 17] File exists: '/var/crash/virtualbox-dkms.0.crash' Error! Bad return status for module build on kernel: 5.8.0-36-generic (x86_64) Consult /var/lib/dkms/virtualbox/6.1.10/build/make.log for more information. dpkg: error processing package virtualbox-dkms (--configure): installed virtualbox-dkms package post-installation script subprocess returned error exit status 10 Errors were encountered while processing: virtualbox-dkms E: Sub-process /usr/bin/dpkg returned an error code (1) – Vasil Valchev Jan 08 '21 at 10:00
  • 1
    In my case (Ubuntu 20.04) I have to do the same, for each kernel update: `sudo apt-get remove virtualbox-dkms` `sudo apt-get install virtualbox-dkms` `sudo modprobe vboxdrv` the restart the VirtualBox application ` – Marius Sep 29 '21 at 21:09
11

I have a solution that works for MacOS users:

  1. You have to restart your system and press Command (⌘) + R during the loading. It will start the Recovery mode.

  2. Now that you're on the Recovery Mode, click on Utilities (top bar) and Terminal.

  3. You have your terminal opened? Enter, it will add Oracle in the authorisation list to access the kernel.

    spctl kext-consent add VB5E2TV963

  4. Restart again.

You're welcome.

idkn
  • 422
  • 2
  • 7
  • 13
  • 3
    This helped me. Also after 4. restart again. 5. start virtualbox, then start your vm and open system prefs --> security --> and you will Allow button. Now you can see it and press – Anatoli Klamer Apr 20 '20 at 03:25
  • After I restarted, I didn't even have to do the Allow button step. My virtualBox VM started up like it use to. – kenecaswell Feb 22 '21 at 19:55
  • 2
    For Mac Users. Nothing in these threads worked for me. So, I found my own solution, Homebrew. I deleted VirtualBox from Applications in Finder. Then, I installed VirtualBox via Homebrew with the command brew install --cask virtualbox. Follow this link for more information - https://formulae.brew.sh/cask/virtualbox – Bilal Saidumarov May 30 '21 at 07:39
9

(I'm on a Mac with this solution) I tried the first few answers on this board (so you might need those as well first), but then finally I Allowed Oracle to "load software" under System Preferences -> Security & Privacy -> in the bottom right, click "Allow..." Then a dialog box with checkbox options might come up, search for Oracle and check the box next to it. Click OK out of everything. (I also updated the preference above the "Allow..." button to Allow apps downloaded from: to "App store and identified developers") After all of this I rebooted and I no longer see this -1908 error when running a VM. Again, I'm on a Mac, running Big Sur 11.2.1.

Dharman
  • 30,962
  • 25
  • 85
  • 135
skittlebiz
  • 359
  • 4
  • 8
6

Personally, on my Mac installing the latest version of VirtualBox solved the problem

Vic Seedoubleyew
  • 9,888
  • 6
  • 55
  • 76
  • I am on macOS Monterey and this solution works for me, it asks for permission at the end, should give it permission within 30 mins. – Savandy Nov 30 '21 at 08:50
5

Goto BIOS setup and Make secure boot Disable It worked for me.

Sachin Patil
  • 78
  • 1
  • 5
3

Had recently the same problem on Ubuntu 18.04. Apparently, virtual box 6.+ has some issues with gcc-7. These steps did the job for me:

Removing virtualbox

sudo apt-get purge virtualbox-*

installing gcc-8

sudo apt-get install gcc-8 g++-8

setting default gcc to gcc-8

sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-8 800 --slave /usr/bin/g++ g++ /usr/bin/g++-8

and reinstalling virtualbox with the debian installer did it for me!

Thomas
  • 705
  • 6
  • 21
2

did you try the command /etc/init.d/vboxdrv setup What was the output ?

  • 4
    bash : /etc/init.d/vboxdrv setup : No such file or directory –  Dec 02 '12 at 14:39
  • did you run it as superuser ? sudo ? – Kasper Jan Mooijman Dec 02 '12 at 14:45
  • Here some interesting sites of people having a similar problem https://forums.virtualbox.org/viewtopic.php?f=10&t=43455 http://forums.fedoraforum.org/archive/index.php/t-281616.html – Kasper Jan Mooijman Dec 02 '12 at 14:58
  • @kycklysf did u solve the problem?? i've got the same problem but i can't find a solution. if u solved the problem, could you please tell me how or show me from where u got u're solution. thanks! – Pheonix7 Mar 20 '13 at 09:38
  • actually,yes i did but i dont know how it went to a way it works, there are lots of recommendations on the internet, it isnt true but i applied whatever i saw, then boom, it works, i hope you find the way how actually it works. –  Mar 20 '13 at 13:05
1

First you have to install dkms packages (but optional)

sudo apt-get install dkms

Then run this

sudo /etc/init.d/vboxdrv setup

But in my case I had to run only second one.

1

Follow the following steps for Linux:

  1. cd /etc/yum.repos.d/
  2. vim epel.repo
  3. Make every "enabled=1"
  4. yum install dkms
Ivan Aracki
  • 4,861
  • 11
  • 59
  • 73
1

there were only linux-lts kernel in my system so far. i just install linux-lts-headers using pacman and then i rebooted pc.it worked for me.

1

This one in recovery mode answered by @idkn worked for me.

spctl kext-consent add VB5E2TV963
vipin goyal
  • 671
  • 11
  • 17
1

The below code seems to fix the error. It might recur when you update your distrbution, so make sure to rerun it.

sudo modprobe vboxdrv

1

The latest macOS Testbuild (revision >= r140753) has preliminary support for MacOS Big Sur included.

For all builds please check: https://www.virtualbox.org/wiki/Testbuilds

See https://www.virtualbox.org/ticket/19795 for more info.

phedoreanu
  • 2,588
  • 3
  • 25
  • 29
  • I am on macOS and this solution works for me https://www.howtogeek.com/658047/how-to-fix-virtualboxs-%E2%80%9Ckernel-driver-not-installed-rc-1908-error/ – Kasem777 Apr 01 '21 at 12:58
0

did you try the command:

sudo kextload /Library/Extensions/VBoxDrv.kext/
Gere
  • 2,114
  • 24
  • 24
0

I had the same problem and I fix it with this:

rm -r /etc/init.d/vboxdrv
rm -r /var/lib/update-rc.d/vboxdrv 
apt-get install virtualbox virtualbox-dkms virtualbox-guest-utils virtualbox-guest-additions virtualbox-qt

via : https://superuser.com/questions/652850/error-while-installing-virtualbox

Community
  • 1
  • 1
Lerb90
  • 124
  • 5
-1

I had the same problem and I fixed it by running this command: sudo /etc/init.d/vboxdrv setup

Ivan Aracki
  • 4,861
  • 11
  • 59
  • 73
Fariba
  • 693
  • 1
  • 12
  • 27
-1

Firstly open a terminal and write this command:

  • sudo apt-get remove virtualbox-dkms

and after finish this operation, write this command:

  • sudo apt-get install virtualbox-dkms

This solved the problem. Do not worry, your files will not be lost.

Ivan Aracki
  • 4,861
  • 11
  • 59
  • 73