23

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 '18 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 '19 at 17:27
  • I posted the solution of this issue here – Adriana Hernández Dec 30 '19 at 16:50
22

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
5
  • This also worked today with a persistent inability to reinstall Virtualbox 6.0 on 4.15.0-58-generic. – Jackspace Aug 19 '19 at 17:50
  • Worked for me Thank you ! – SudarP Sep 9 '19 at 7:57
  • 2
    Did not work for me on ubuntu 18.04. – Mubashar Abbas Oct 31 '19 at 16:44
  • Did not work for Ubuntu 19.10. – Malachi Bazar Nov 1 '19 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 '20 at 22:39
6

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

just this solved the same problem on my Kubuntu 18.4.2

3
  • 1
    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 '19 at 11:02
  • Isn't this the same answer as the one before? – mLstudent33 Feb 6 '20 at 0:11
  • by this I was going to say it worked for me WITHOUT < $ sudo /sbin/vboxconfig > – Asklep Jul 24 '20 at 14:55
2

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.