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

10,398

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

Share:
10,398

Related videos on Youtube

Max von Anon
Author by

Max von Anon

Updated on September 18, 2022

Comments

  • Max von Anon
    Max von Anon over 1 year

    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!

    • Takkat
      Takkat over 6 years
      Try to upgrade virtualbox to current release 5.2.4. Some kernel issue for newer kernels were resolved in the meantime.
    • Max von Anon
      Max von Anon over 6 years
      @Takkat: But I VirtualBox 5.2.4 is not part of Ubuntu 16.04 - I just looked up with synaptic!? I have chosen on purpose the VirtualBox from the Ubuntu distribution to be in sync with the kernel and to avoid headaches like these.
    • N0rbert
      N0rbert over 6 years
      Please update your post with output of: apt-cache policy `dpkg -S VirtualBox | head -n1 | sed -e 's/://g' | awk '{print $1}'`.
    • Charles Green
      Charles Green over 6 years
      I have found KVM/QEMU to be much more stable across kernel updates - the price that I pay for this is that there is not yet support for 3D graphics acceleration.
  • user207863
    user207863 over 6 years
    I also had to install the 5.2 extension pack, like this: curl -O http://download.virtualbox.org/virtualbox/5.2.0/Oracle_VM_Vi‌​rtualBox_Extension_P‌​ack-5.2.0-118431.vbo‌​x-extpack ; sudo VBoxManage extpack install Oracle_VM_VirtualBox_Extension_Pack-5.2.0-118431.vbox-extpac‌​k
  • Max von Anon
    Max von Anon over 6 years
    This is indeed what I did. I booted in the previous kernel and am waiting until Ubuntu updates it's virtualbox to work with their latest kernel.
  • Wiiiiiiiiiiiiiiiiiiiii
    Wiiiiiiiiiiiiiiiiiiiii over 6 years
    This works for me. Still, if you rather not spend time downloading, installing and configuring, see @therefriedbean post.
  • EvanED
    EvanED over 6 years
    For the first step, sudo echo "..." > /etc/.. won't work when run as a normal user because only the echo runs under sudo. IMO the best way to handle this is probably echo "..." | tee -a /etc/...
  • Max
    Max over 6 years
    @EvanED Thanks, I edited my answer to use add-apt-repository which I think is more self explanatory. For those who want to use sources.list.d the command is echo "deb http://download.virtualbox.org/virtualbox/debian xenial contrib" | sudo tee /etc/apt/sources.list.d/oracle-virtualbox.list.
  • MakisH
    MakisH about 6 years
    After installing the newer version, my VMs still wouldn't start. See Andy's answer on how to fix this.
  • Jeno
    Jeno about 6 years
    that might work, but the newer kernels (that don't work together with virtualbox) bring fixes for meltdown/spectre!
  • Jeno
    Jeno about 6 years
    didn't work for me because VBOX 5.2 cant open my earlier used images, it says that it can't access the image (*.vdi file)
  • Gideon Maina
    Gideon Maina about 6 years
    This helped me too after downloading virtualbox 5.2.6 from the website.
  • Gideon Maina
    Gideon Maina about 6 years
    At the moment this is the solution. Or a manual download from the virtualbox 5.2.6 site. Seems the latest kernel has issues with earlier virtualbox versions.
  • DJCrashdummy
    DJCrashdummy about 6 years
    i experienced the same qt-issues (just optical ones) in virtualbox-5.1 as in virtualbox-5.2...
  • DJCrashdummy
    DJCrashdummy about 6 years
    to avoid future problems virtualbox should be completely unistalled with something like sudo apt-get remove virtualbox* or sudo aptitude remove virtualbox before installing the new version. || additional the line wget -q https://www.virtualbox.org/download/oracle_vbox.asc -O- | sudo apt-key add - is just needed for systems older than Ubuntu 16.04 (xenial) or Debian 8 (jessie); so it can or rather should be left out on these or newer versions.
  • Fatemeh Karimi
    Fatemeh Karimi about 6 years
    can't install virtualbox-5.2 it says: E: Unable to locate package virtualbox-5.2 E: Couldn't find any package by glob 'virtualbox-5.2' E: Couldn't find any package by regex 'virtualbox-5.2' what should i do??
  • Max
    Max about 6 years
    @FatemehKarimi I think it means that either you haven't added the repository correctly (add-apt-repository command), or you haven't updated apt database (sudo apt update). Hope that helps.
  • mivk
    mivk about 6 years
    Also, detailed instructions at superuser.com/a/1305277/53547