VirtualBox 5.0.40 crashes the whole host since update to kernel 4.13.0-26-generic

Solution 1:

Upgrading to VirtualBox 5.2 using oracle repository worked for me.

Here are the steps (legacy doc here):

1) Add oracle repository :

sudo add-apt-repository "deb http://download.virtualbox.org/virtualbox/debian xenial contrib"

Modify this command to suit your ubuntu version if you are not using Ubuntu 16.04 (xenial).

2) Add GPG keys for repository :

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 -

3) Check GPG keys :

sudo apt-key finger Oracle

should give show the following fingerprints :

B9F8 D658 297A F3EF C18D  5CDF A2F6 83C5 2980 AECF
Oracle Corporation (VirtualBox archive signing key) 

7B0F AB3A 13B9 0743 5925  D9C9 5442 2A4B 98AB 5139
Oracle Corporation (VirtualBox archive signing key)

4) Install VirtualBox 5.2

sudo apt update && sudo apt install virtualbox-5.2

In my case I had errors and I had to remove virtualbox-dkms package and run /sbin/vboxconfig :

sudo apt remove --purge virtualbox-dkms
sudo  /sbin/vboxconfig

Depending on your desktop environment, the launcher menu icon may have disappeared. In that case, recreate it manually; the command is simply virtualbox.

Solution 2:

Cross referencing:

Official bug tracking this issue is:

https://bugs.launchpad.net/bugs/1736116

There are solutions there for installing VB 5.1.30 as well as 5.2.4. Some users are reporting QT dependency issues with 5.2.4, so 5.1.30 might be a safer bet.

Several options for installing either version are listed there, and the discussion is ongoing, so I am not going to reproduce here.

Solution 3:

When you boot your machine change which kernel you boot into by going into "Advanced options for Ubuntu".

Pick the version number like 4.10 -- Should start working until this gets fixed.

Solution 4:

So, in my case, the kernel modules were not removed properly.

Here are the details:

root@Dell5280 [~]# cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=16.04
DISTRIB_CODENAME=xenial
DISTRIB_DESCRIPTION="Ubuntu 16.04.3 LTS

root@Dell5280 [~]# uname -r
4.13.0-31-generic

Problem:

root@Dell5280 [~]# modinfo vboxdrv
filename: /lib/modules/4.13.0-31-generic/updates/dkms/vboxdrv.ko
version: 5.0.40_Ubuntu r115130 (0x00240000)
license: GPL
description: Oracle VM VirtualBox Support Driver
author: Oracle Corporation
srcversion: 6D8B4900A693FC50489A130
depends:
name: vboxdrv
vermagic: 4.13.0-31-generic SMP mod_unload

FIX:

root@Dell5280 [~]# rm /lib/modules/4.13.0-31-generic/updates/dkms/vboxdrv.ko

root@Dell5280 [~]# modinfo vboxdrv
filename: /lib/modules/4.13.0-31-generic/updates/dkms/vboxdrv.ko
modinfo: ERROR: could not get modinfo from 'vboxdrv': No such file or directory
[1] root@Dell5280 [~]# /sbin/vboxconfig
vboxdrv.sh: Stopping VirtualBox services.
vboxdrv.sh: Building VirtualBox kernel modules.
vboxdrv.sh: Starting VirtualBox services.

root@Dell5280 [~]# modinfo vboxdrv
filename: /lib/modules/4.13.0-31-generic/misc/vboxdrv.ko
version: 5.2.7 r120349 (0x00290000)
license: GPL
description: Oracle VM VirtualBox Support Driver
author: Oracle Corporation
srcversion: 4880B21EFF1B605D6402982
depends:
name: vboxdrv
vermagic: 4.13.0-31-generic SMP mod_unload
parm: force_async_tsc:force the asynchronous TSC mode (int)

After this, everything works (at least in my case)

Hope it helps.

I posted the reply at https://bugs.launchpad.net/ubuntu/+source/virtualbox/+bug/1736116