6

Virtual box fails to boot any VMs, suspect its due to a kernel update

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 virtualbox-dkms package and load the kernel module by executing

modprobe vboxdrv

as root.

where: suplibOsInit what: 3 VERR_VM_DRIVER_NOT_INSTALLED (-1908) - The support driver is not installed. On linux, open returned ENOENT.

when you try reinstalling the dkms

sudo apt-get install --reinstall virtualbox-dkms
Building for 5.0.0-23-generic
Building initial module for 5.0.0-23-generic
ERROR: Cannot create report: [Errno 17] File exists: '/var/crash/virtualbox-dkms.0.crash'
Error! Bad return status for module build on kernel: 5.0.0-23-generic (x86_64)
Consult /var/lib/dkms/virtualbox/5.2.18/build/make.log for more information.

Make log is as follows:

DKMS make.log for virtualbox-5.2.18 for kernel 5.0.0-23-generic (x86_64)
Sun Aug  4 08:04:13 IST 2019
make: Entering directory '/usr/src/linux-headers-5.0.0-23-generic'
  CC [M]  /var/lib/dkms/virtualbox/5.2.18/build/vboxdrv/linux/SUPDrv-linux.o
  CC [M]  /var/lib/dkms/virtualbox/5.2.18/build/vboxdrv/SUPDrv.o
  CC [M]  /var/lib/dkms/virtualbox/5.2.18/build/vboxdrv/SUPDrvGip.o
  CC [M]  /var/lib/dkms/virtualbox/5.2.18/build/vboxdrv/SUPDrvSem.o
  CC [M]  /var/lib/dkms/virtualbox/5.2.18/build/vboxdrv/SUPDrvTracer.o
  CC [M]  /var/lib/dkms/virtualbox/5.2.18/build/vboxdrv/SUPLibAll.o
  CC [M]  /var/lib/dkms/virtualbox/5.2.18/build/vboxdrv/r0drv/alloc-r0drv.o
  CC [M]  /var/lib/dkms/virtualbox/5.2.18/build/vboxdrv/r0drv/initterm-r0drv.o
  CC [M]  /var/lib/dkms/virtualbox/5.2.18/build/vboxdrv/r0drv/memobj-r0drv.o
  CC [M]  /var/lib/dkms/virtualbox/5.2.18/build/vboxdrv/r0drv/mpnotification-r0drv.o
  CC [M]  /var/lib/dkms/virtualbox/5.2.18/build/vboxdrv/r0drv/powernotification-r0drv.o
  CC [M]  /var/lib/dkms/virtualbox/5.2.18/build/vboxdrv/r0drv/linux/assert-r0drv-linux.o
  CC [M]  /var/lib/dkms/virtualbox/5.2.18/build/vboxdrv/r0drv/linux/alloc-r0drv-linux.o
  CC [M]  /var/lib/dkms/virtualbox/5.2.18/build/vboxdrv/r0drv/linux/initterm-r0drv-linux.o
  CC [M]  /var/lib/dkms/virtualbox/5.2.18/build/vboxdrv/r0drv/linux/memobj-r0drv-linux.o
  CC [M]  /var/lib/dkms/virtualbox/5.2.18/build/vboxdrv/r0drv/linux/memuserkernel-r0drv-linux.o
/var/lib/dkms/virtualbox/5.2.18/build/vboxdrv/r0drv/linux/memuserkernel-r0drv-linux.c: In function ‘VBoxHost_RTR0MemUserIsValidAddr’:
/var/lib/dkms/virtualbox/5.2.18/build/vboxdrv/r0drv/linux/memuserkernel-r0drv-linux.c:69:55: error: macro "access_ok" passed 3 arguments, but takes just 2
     bool fRc = access_ok(VERIFY_READ, (void *)R3Ptr, 1);
                                                       ^
/var/lib/dkms/virtualbox/5.2.18/build/vboxdrv/r0drv/linux/memuserkernel-r0drv-linux.c:69:16: error: ‘access_ok’ undeclared (first use in this function)
     bool fRc = access_ok(VERIFY_READ, (void *)R3Ptr, 1);
                ^~~~~~~~~
/var/lib/dkms/virtualbox/5.2.18/build/vboxdrv/r0drv/linux/memuserkernel-r0drv-linux.c:69:16: note: each undeclared identifier is reported only once for each function it appears in
scripts/Makefile.build:284: recipe for target '/var/lib/dkms/virtualbox/5.2.18/build/vboxdrv/r0drv/linux/memuserkernel-r0drv-linux.o' failed
make[2]: *** [/var/lib/dkms/virtualbox/5.2.18/build/vboxdrv/r0drv/linux/memuserkernel-r0drv-linux.o] Error 1
make[2]: *** Waiting for unfinished jobs....
scripts/Makefile.build:515: recipe for target '/var/lib/dkms/virtualbox/5.2.18/build/vboxdrv' failed
make[1]: *** [/var/lib/dkms/virtualbox/5.2.18/build/vboxdrv] Error 2
Makefile:1606: recipe for target '_module_/var/lib/dkms/virtualbox/5.2.18/build' failed
make: *** [_module_/var/lib/dkms/virtualbox/5.2.18/build] Error 2
make: Leaving directory '/usr/src/linux-headers-5.0.0-23-generic'

If i try

sudo modprobe vboxdrv
modprobe: FATAL: Module vboxdrv not found in directory /lib/modules/5.0.0-23-generic

Any idea how to fix this ?

galoget
  • 2,963
Pranesh
  • 63
  • have you tried purging and reinstalling vbox? make sure your VMs are backed up somewhere and run sudo apt purge virtualbox* && sudo apt autoremove && sudo apt autoclean && sudo apt install virtualbox – Joshua Besneatte Aug 04 '19 at 03:08
  • You haven't told us what release you are using. We can see your kernel, but that's used by two releases (18.04 LTS with HWE enabled & 19.04) – guiverc Aug 04 '19 at 03:11
  • You need to upgrade to the v6 series of VirtualBox; it builds fine on the 5.0 series kernels. – ajgringo619 Aug 04 '19 at 03:24
  • I see that the Bionic repositories have VBox 5.2.18, which is the same version you are running. If you installed VBox from the Bionic repositories and you are fully up-to-date but the build still fails, that's a bug that should be reported. – fkraiem Aug 04 '19 at 06:58
  • I'm seeing the same problem on Ubuntu 18.04.02 LTS with 5.1.18_Ubuntu r123745 – parsley72 Aug 04 '19 at 20:19
  • @ajgringo619 I tried updating to v6 and now I'm blocked by https://www.virtualbox.org/ticket/18771 – parsley72 Aug 04 '19 at 22:12
  • Sorry, I should have noticed the signs of a Secure Boot problem earlier. Disable Secure Boot in your BIOS and try again. – ajgringo619 Aug 04 '19 at 22:22
  • @Joshua Besneatte , it worked fine now: sudo apt purge virtualbox* && sudo apt autoremove && sudo apt autoclean && sudo apt install virtualbox I did see some new packages being downloaded The following additional packages will be installed: dkms libgsoap-2.8.60 libqt5opengl5 libvncserver1 virtualbox-dkms virtualbox-qt I couldnt figure put what the problem was, so its a clean install that fixed this. – Pranesh Aug 05 '19 at 11:32
  • I was on this build Distributor ID: Ubuntu Description: Ubuntu 18.04.2 LTS Release: 18.04 Codename: bionic – Pranesh Aug 05 '19 at 11:43
  • OK, I will add that as an answer :) – Joshua Besneatte Aug 05 '19 at 19:19
  • @ajgringo619 Disabling Secure Boot has stopped this message appearing but I still can't run. I've purged and reinstalled Virtualbox 6 but getting "RTR3InitEx failed with RC=-1912 (rc=-1912)" – parsley72 Aug 15 '19 at 23:33
  • I had to do https://askubuntu.com/a/979223/59832 – parsley72 Aug 15 '19 at 23:40

2 Answers2

2

You need to purge and reinstall VirtualBox.

  1. Back up your virtual machines somewhere safe.

  2. Purge Virtualbox:

    $ sudo apt purge virtualbox*
    
  3. Get rid of old deps and configs:

    $ sudo apt autoremove
    $ sudo apt autoclean
    
  4. Install a shiny new VBox

There are two options for installing VBox. From standard repos (Option 1) or from a PPA (Option 2). Do one or the other NOT both.

Option 1. You can install directly from the standard repos like this:

$ sudo apt install virtualbox

Option 2. Install from the PPA

If you want the absolute latest version of VBox and any potential closed source drivers follow these steps to install from the PPA.

4.2.1. Add the following line to your /etc/apt/sources.list:

deb https://download.virtualbox.org/virtualbox/debian bionic contrib

4.2.2. Download Oracle public key:

$ 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 -

4.2.3. Install VirtualBox:

sudo apt-get update
sudo apt-get install virtualbox

More info on PPA install here.

  1. Enjoy :)
Joshua Besneatte
  • 4,773
  • 5
  • 23
  • 42
  • 2
    it's not works.. !!! still got same error.. ! – Budi Mulyo Sep 06 '19 at 04:45
  • This does not solve the problem. The kernel module can not be built. – EvertW Sep 14 '22 at 09:37
  • The above command for adding the repository will have to be altered if you are not using the bionic release. Update the repo to your distro and be sure to purge the old install so you are starting with a fresh install. – Joshua Besneatte Oct 23 '22 at 18:01
0

I know is a old topic, but I had the same issue with Ubuntu 22.04, as far as my knowledge go, is because of the Secure Boot.

I tried troubleshooting running virtualbox through temrinal, so I got a message that suggested me to run

sudo /sbin/vboxconfig

that helped me to put a signature to the kernel driver (again, if I got it right) with a guided procedure.

So far everything is working fine,I hope this could help.

If I wrote something wrong or not clear let me know :)