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

16.04kernelupdatesvirtualbox

I received the updates through normal Software Updater, 10-Jan-2018. After this VirtualBox would not start any VM, complaining about dkms and asking to make modprobe vboxdrv. Following the advice I reinstalled virtualbox-dkms with:

sudo apt-get --reinstall install virtualbox-dkms

After this and a reboot I tried to start a VM which freezed the whole machine and a hard reboot was necessary.

Is there a way to make VirtualBox work with the latest kernels?

EDIT:

As suggested by N0rbert, the command:

apt-cache policy `dpkg -S VirtualBox | head -n1 | sed -e 's/://g' | awk '{print $1}'`

gives:

virtualbox-qt:
  Installed: 5.0.40-dfsg-0ubuntu1.16.04.2
  Candidate: 5.0.40-dfsg-0ubuntu1.16.04.2
  Version table:
 *** 5.0.40-dfsg-0ubuntu1.16.04.2 500
        500 http://fr.archive.ubuntu.com/ubuntu xenial-updates/multiverse amd64 Packages
        100 /var/lib/dpkg/status
     5.0.18-dfsg-2build1 500
        500 http://fr.archive.ubuntu.com/ubuntu xenial/multiverse amd64 Packages

EDIT (on 29-Mar-2018): Issue is resolved for me, with the Ubuntu Ubdate from today. I have seen that it had some virtualbox-updates, therefore I tried to boot with the most recent kernel again. Then I had to run

sudo apt-get –reinstall install virtualbox-dkms

And after this my virtual machines in VirtualBox started working without crashing the whole computer. Finally!

Best Answer

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.