33

Today I noticed that my VirtualBox VMs no longer start. With messages

The virtual machine 'CGI' has terminated unexpectedly during startup with exit code 1 (0x1).

Result Code:
NS_ERROR_FAILURE (0x80004005)
Component:
MachineWrap
Interface:
IMachine
Unknown macro: {b2547866-a0a1-4391-8b86-6952d82efaa0} 

And

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

'/sbin/vboxconfig'

as root.

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

It seems this is caused by a kernel update. I actually wasn't aware that Ubuntu is doing automatic kernel updates. The log /var/log/dpkg.log shows that kernel update was going on right before problems started.

sudo dpkg --list | grep linux-image shows images lines with many 4.8, 4.10 and 4.13 versions.

[user:~] $ uname -a
Linux io 4.13.0-26-generic #29~16.04.2-Ubuntu SMP Tue Jan 9 22:00:44 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

The suggested solution for this problem unfortunately does not work.

[root:~] # /sbin/vboxconfig
vboxdrv.sh: Stopping VirtualBox services.
depmod: ERROR: could not open directory /lib/modules/4.10.0-27-generic: No such file or directory
depmod: FATAL: could not search modules: No such file or directory
depmod: ERROR: could not open directory /lib/modules/4.10.0-28-generic: No such file or directory
depmod: FATAL: could not search modules: No such file or directory
depmod: ERROR: could not open directory /lib/modules/4.10.0-30-generic: No such file or directory
depmod: FATAL: could not search modules: No such file or directory
depmod: ERROR: could not open directory /lib/modules/4.10.0-32-generic: No such file or directory
depmod: FATAL: could not search modules: No such file or directory
depmod: ERROR: could not open directory /lib/modules/4.10.0-33-generic: No such file or directory
depmod: FATAL: could not search modules: No such file or directory
depmod: ERROR: could not open directory /lib/modules/4.10.0-35-generic: No such file or directory
depmod: FATAL: could not search modules: No such file or directory
depmod: ERROR: could not open directory /lib/modules/4.10.0-37-generic: No such file or directory
depmod: FATAL: could not search modules: No such file or directory
depmod: ERROR: could not open directory /lib/modules/4.10.0-38-generic: No such file or directory
depmod: FATAL: could not search modules: No such file or directory
depmod: ERROR: could not open directory /lib/modules/4.10.0-40-generic: No such file or directory
depmod: FATAL: could not search modules: No such file or directory
depmod: ERROR: could not open directory /lib/modules/4.8.0-41-generic: No such file or directory
depmod: FATAL: could not search modules: No such file or directory
depmod: ERROR: could not open directory /lib/modules/4.8.0-45-generic: No such file or directory
depmod: FATAL: could not search modules: No such file or directory
depmod: ERROR: could not open directory /lib/modules/4.8.0-46-generic: No such file or directory
depmod: FATAL: could not search modules: No such file or directory
depmod: ERROR: could not open directory /lib/modules/4.8.0-49-generic: No such file or directory
depmod: FATAL: could not search modules: No such file or directory
depmod: ERROR: could not open directory /lib/modules/4.8.0-52-generic: No such file or directory
depmod: FATAL: could not search modules: No such file or directory
depmod: ERROR: could not open directory /lib/modules/4.8.0-54-generic: No such file or directory
depmod: FATAL: could not search modules: No such file or directory
depmod: ERROR: could not open directory /lib/modules/4.8.0-56-generic: No such file or directory
depmod: FATAL: could not search modules: No such file or directory
depmod: ERROR: could not open directory /lib/modules/4.8.0-58-generic: No such file or directory
depmod: FATAL: could not search modules: No such file or directory
vboxdrv.sh: Building VirtualBox kernel modules.
vboxdrv.sh: failed: Look at /var/log/vbox-install.log to find out what went wrong.

There were problems setting up VirtualBox.  To re-start the set-up process, run
  /sbin/vboxconfig
as root.
[root:~] # 

The install log /var/log/vbox-install.log is too large to post here but it starts with following message

make[1]: warning: -jN forced in submake: disabling jobserver mode.
test -e include/generated/autoconf.h -a -e include/config/auto.conf || (        \
echo >&2;                           \
echo >&2 "  ERROR: Kernel configuration is invalid.";       \
echo >&2 "         include/generated/autoconf.h or include/config/auto.conf are missing.";\
echo >&2 "         Run 'make oldconfig && make prepare' on kernel src to fix it.";  \
echo >&2 ;  

There are actually three questions now I think * How do I fix kernel configuration? * How do I fix VirtualBox? Should I remove and reinstall? * How do I prevent these types of issues? Should I disable auto-updates of kernel?

enter image description here enter image description here

3
  • It is not installed currently. Is that the problem? Why kernel upgrades are not working?
    – onknows
    Jan 16, 2018 at 9:21
  • I ran into the same problem with Arch Linux after some updates. sudo /sbin/vboxreload did the job for me. Found that solution by coincidence after neither /sbin/vboxconfig existed nor reinstalling would work on my machine.
    – kaiya
    Dec 14, 2019 at 17:27
  • I posted the solution of this issue here Dec 30, 2019 at 16:50

5 Answers 5

33

I met the same issue after VirtualBox upgrade to 5.2.6 r120293

Linux kernel version 4.14.13-041413-generic

The following commands sequence helped for me:

$ sudo apt install --reinstall virtualbox-dkms && sudo apt install libelf-dev
$ sudo /sbin/vboxconfig
8
  • This also worked today with a persistent inability to reinstall Virtualbox 6.0 on 4.15.0-58-generic.
    – Jackspace
    Aug 19, 2019 at 17:50
  • 2
    Did not work for me on ubuntu 18.04. Oct 31, 2019 at 16:44
  • Did not work for Ubuntu 19.10. Nov 1, 2019 at 20:17
  • 2
    Didn't work on Ubuntu 18.04 (Jan 20, 2020). Was running v 6.0, completely uninstalled 6.0 and then installed 6.1 and now it's working. Good luck all!
    – Brigadeiro
    Jan 20, 2020 at 22:39
  • 1
    The first commend works in my ubuntu 20.04, did not use the second. Thanks a lot! Dec 9, 2021 at 3:03
9

$ sudo apt install --reinstall virtualbox-dkms && sudo apt install libelf-dev

just this solved the same problem on my Kubuntu 18.4.2

3
  • 4
    You're providing same answer as provided before. Look first answer. You can write comment it if you want to say something about it or you can upvote previous answer. superuser.com/a/1286104/774524
    – Ikrom
    Apr 11, 2019 at 11:02
  • 2
    Isn't this the same answer as the one before? Feb 6, 2020 at 0:11
  • by this I was going to say it worked for me WITHOUT < $ sudo /sbin/vboxconfig >
    – Asklep
    Jul 24, 2020 at 14:55
6

After reinstalling virtualbox-dkms as above, you may also have to sudo modprobe vboxdrv to reload the kernel module.

1

On Mac, re-installing Virtualbox fixes the issue

1
  • It is March 2023, and I can confirm that this has worked for me on macOS. Mar 19, 2023 at 21:19
0

If you're running Ubuntu or Debian distribution (or either derivative of either), the driver management should be automatically handled by dkms if you have it installed.

If you didn't previously have dkms you can fix the problem for the currently running kernel version and Virtualbox version by executing the vboxconfig as root. In practice you can open new terminal window (with Alt+Ctrl+T by default) and simply type sudo /sbin/vboxconfig and press enter.

If you don't have dkms installed, you'll experience similar problem in the future, too, when Virtualbox or Linux kernel is updated next time. To avoid that, you can run sudo apt install dkms, too.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .