Host with kernel 4.13 freezes when starting a VM with VirtualBox

Bug #1736116 reported by Stephan Springer on 2017-12-04
338
This bug affects 65 people
Affects Status Importance Assigned to Milestone
virtualbox (Ubuntu)
High
Unassigned

Bug Description

This is a spin-off of bug 1729568. With Kernel 4.13 (from linux-generic-hwe-16.04-edge), the host system freezes completely when starting a VM using VirtualBox. A black boot window pops up right before the freeze.

Stephan Springer (geryon) wrote :

LocutusOfBorg (costamagnagianfranco) wrote in https://bugs.launchpad.net/ubuntu/+source/virtualbox/+bug/1729568/comments/21 :

@geryon, can you please try what Vlad mentioned here?

"Boot issue solved by removing intel-microcode package - no idea why it was installed."

I think you just need to disable iommu, but removing that package might be even better, or trying the one from bionic might also help us
https://launchpad.net/ubuntu/+source/intel-microcode

Stephan Springer (geryon) wrote :

There is no intel-microcode package installed, only intel-gpu-tools and libdrm-intel1. But I'll try that iommu kernel command line.

Quote from https://bugs.launchpad.net/ubuntu/+source/virtualbox/+bug/1729568/comments/20 :
Disabling iommu might fix the issue
https://www.reddit.com/r/archlinux/comments/732hp4/arch_freezing_after_413_kernel_update/

Stephan Springer (geryon) wrote :

Nope, neither intel_iommu=igfx_off nor intel_iommu=off prevent the freeze.

@Vlad, yes please try hwe-edge! thanks

Changed in virtualbox (Ubuntu):
importance: Undecided → High
Changed in virtualbox (Ubuntu):
status: New → Confirmed
Vlad Orlov (monsta) wrote :

In guest system, hwe-edge kernel works fine, I left a comment at bug 1729568.
Is this a problem with having 4.13 in host system as well? My host system has 4.10 and VirtualBox 5.1.30.

Stephan Springer (geryon) wrote :

I'm experiencing this freeze with Linux 4.13 on the host and Windows as the guest. But the freeze happens when the guest starts booting, so I don't think the guest system matters much.

Vlad Orlov (monsta) wrote :

Ok, so we were trying different things... I did all tests and experiments (including removing intel-microcode package), which I mentioned in bug 1708315 and bug 1729568, in Xenial VM. I didn't change anything on my host system.

Vlad Orlov (monsta) on 2017-12-05
summary: - Host freezes when starting a VM with VirtualBox
+ Host with kernel 4.13 freezes when starting a VM with VirtualBox
Changed in virtualbox (Ubuntu):
status: Confirmed → New
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in virtualbox (Ubuntu):
status: New → Confirmed

Xenial VM with kernel 4.14

For those people having host freezes, please try to reproduce them using packages from virtualbox.org and open a bug report there if appropriate. It would be appreciated if you link to any appropriate Launchpad bugs, but still provide all information on the virtualbox.org bug, including a log file from the last virtual machine you started.

Tobias Karnat (tobiaskarnat) wrote :

I have the same issue with latest the candidate kernel required to fix Meltdown on Xenial.
linux-hwe-edge 4.13.0-25.29~16.04.1 from ppa:canonical-kernel-team/pti

Because "the Rolling HWE kernel for Ubuntu 16.04 will go to 4.13 early, instead of also fixing 4.10 HWE kernel" I cannot stay on 4.10 and this is urgent.

Tobias Karnat (tobiaskarnat) wrote :

Package from virtualbox.org cannot be used as the latest 5.0 build is 5.0.40 and even this needs to be patched as described in #1729568 to build the kernel modules.

Vlad Orlov (monsta) wrote :

So I'm now on kernel 4.13 after the update of -hwe kernel from 4.10, and my vbox 5.1.30 (from the official virtualbox.org repo) runs fine on this host. Apparently, only 5.0.40, which is in Xenial repos, has this problem.

Lubuntu 16.04 LTS 64 bit up-to-date

Freezes ---> linux-image-4.13.0-26-generic 4.13.0-26.29~16.04.2

Fine ------> linux-image-4.10.0-42-generic 4.10.0-42.46~16.04.1

virtualbox 5.0.40-dfsg-0ubuntu1.16.04.2
virtualbox-dkms 5.0.40-dfsg-0ubuntu1.16.04.2
virtualbox-ext-pack 5.0.40-0ubuntu1.16.04.1
virtualbox-guest-additions-iso 5.0.40-0ubuntu1.16.04.1
virtualbox-guest-dkms 5.0.40-dfsg-0ubuntu1.16.04.2
virtualbox-guest-utils 5.0.40-dfsg-0ubuntu1.16.04.2
virtualbox-qt 5.0.40-dfsg-0ubuntu1.16.04.2

My guest is WinXP.

Problem appeared after latest update of the kernel, from 4.10 to 4.13, like #13

I am seeing these symptoms exclusively for guests with VT-x/AMD-V option enabled. Guests without that option boot fine.
Identical virtualbox/kernel versions and kernel upgrade scenario as comment #14. Various guest OS. Host CPU Intel Core i5-6600T.

Pedro Côrte-Real (pedrocr) wrote :

Given the recent accelerated upgrade to 4.13 in 16.04 HWE wouldn't a simple option be to also upgrade virtualbox in 16.04 to 5.1 to get around this issue? Before this was something that probably only affected a few people on HWE-edge but now with Spectre/Meltdown people will be hitting this much more often.

Ulrich von Augsburg (stulrich) wrote :

Freezes happen on Intel PCs only here, whilst AMD PCs don't.
Could more people test this, please?

Disabling the VT-x virtualization option (#15) often isn't an option since 64 Bit guests do need the host to have this option enabled.

I'm fully agreeing with Pedro Côrte-Real's (#16) suggestion that upgrading Ubuntu 16.04's package "virtualbox 5.0.40" to at least 5.1 would be very helpful since otherwise all standard Ubuntu 16.04 HWE (Intel) installations won't be able to run Virtualbox anymore because of the freezing with Kernel 4.13 .

Christian Pointner (equinox-i) wrote :

I have the same problem on my Lenovo t450s (Intel i7-5600U). Virtualbox worked with 4.10 and freezes the host on 4.13. Disabling VT-x/AMD-V didn't solve the problem. Also disabling the new kernel page table isolation (kernel command-line: nopti) doesn't solve the issue.

Larry Gay (jshg46) wrote :

Using kernel 4.13.0.26 will also completely freeze the host when you click start in Virtualbox.

Virtualbox 5.0.40 is not working with the new kernel (4.13.0-26), but the new version of VBox (5.2) works fine.

Download it from VirtualBox page or add the source to your sources.list:

sudo sh -c 'echo "deb http://download.virtualbox.org/virtualbox/debian xenial contrib" >> /etc/apt/sources.list'

Add Oracle public key:

wget -q https://www.virtualbox.org/download/oracle_vbox_2016.asc -O- | sudo apt-key

lrite (klk745) wrote :

@LocutusOfBorg: Will 5.2.4 be rolled out in multiverse in the near future or do users experiencing that freeze need to stick with your PPA?

Yaroslav (friend.yara) wrote :

I solved same problem by installing virtualbox 5.2 from virtualbox.org:

$ sudo apt remove --purge virtualbox*
$ sudo sh -c 'echo "deb http://download.virtualbox.org/virtualbox/debian xenial contrib" >> /etc/apt/sources.list'
$ wget -q https://www.virtualbox.org/download/oracle_vbox_2016.asc -O- | sudo apt-key add -
$ sudo apt install virtualbox-5.2

Then download VirtualBox 5.2.4 Oracle VM VirtualBox Extension Pack from:

http://download.virtualbox.org/virtualbox/5.2.4/Oracle_VM_VirtualBox_Extension_Pack-5.2.4-119785.vbox-extpack

and open it in VirtuialBox to install.

OS: Ubuntu 16.04.3 LTS, 4.13.0-26-generic

Pedro Côrte-Real (pedrocr) wrote :

Just downgrading to non-HWE LTS seems to have fixed things for me so I'll probably stick with that instead.

Stephan Springer (geryon) wrote :

LocutusOfBorg, re #21: There are missing dependencies in your ppa (virtualbox-qt):

libqt5core5a (>= 5.6.0~beta), libqt5widgets5 (>= 5.6.0~beta), libqt5x11extras5 (>= 5.6.0)

Tobias Karnat (tobiaskarnat) wrote :

I can confirm Virtualbox 5.2 from virtualbox.org also works with linux-hwe 4.13.0-29.32~16.04.1 from ppa:canonical-kernel-team/pti which fixes Spectre with IBRS/IBPB.

And I hope Virtualbox implements IBRS/IBPB path through to also allow Spectre protection in vms.

Lope (lopeonline) wrote :

Virtualbox 5.0.40 also crashed for me on kernel 4.13.0-26.
After I click start, 4-5 lines get printed in dmesg, then the entire system freezes.

asgard2 (kamp000x) wrote :

@LocutusOfBorg
I can confirm the dependency problem with your ppa. #21

Alkis Georgopoulos (alkisg) wrote :

This is a screenshot of the host crash: https://snag.gy/HkOoeK.jpg

This happens only on 64bit 4.13 kernels, while 32bit installations with 4.13 work fine.
It happens with any guest, even if there's no guest OS installed yet.

It does not happen at all if the host has kernel=4.10.

It does not happen at all with the newest 5.2.6 upstream virtualbox.

==> Please backport VirtualBox 5.2.6 to Xenial.

Bao Nguyen (baona119) wrote :

Install VB 5.2.6 works fine. The previous version freezed entire system and require hard reboot.

If 16.04 is still considered LTS supported up to 5 years (https://wiki.ubuntu.com/XenialXerus/ReleaseNotes) then we must backport it. Otherwise we should somehow change the "Support lifespan" there in order not to direct people to loose confidence for LTS versions and UBUNTU itself.
Many other problems are related to this bug (https://askubuntu.com/questions/994926/ubuntu-16-04-freezes-on-vagrant-up/997426#997426) not announced here. And freezing the whole system with the official supported installation is a serious drawback.

==> Please either backport VirtualBox 5.2.6 to 16.04 LTS OR change the official kernel in order not to freeze the system.

@ xoristzatziki (simsonbike-bugs) wrote 1 hour ago:

> Otherwise we should somehow change the "Support lifespan" there in order not to direct people to
> loose confidence for LTS versions and UBUNTU itself.

Slow down a little, and think about what you are saying:

$ apt-cache show virtualbox

Package: virtualbox
Architecture: amd64
Version: 5.0.40-dfsg-0ubuntu1.16.04.2
Priority: optional
Section: multiverse/misc

Multiverse = Unsupported, Closed-Source and Patent-Encumbered Software

That sort of tone in your post, will NOT make it more likely to get fixed, but just annoy people who might be able get it done.

It's not even clear who needs to fix it or what the problem is. It's third party software. If you absolutely needs it to work NOW. There are 3 perfectly acceptable solutions already outlined in this thread:

1. go to the core non-HWE 4.4.0-109 kernel by using advanced GRUB menu

2. got to the core non-HWE 4.4.0-109 kernal by permanently removing the HWE kernel from your machine

3. Boot from 4.10.0 using the "advanced menu" in GRUB (that's what I am currently doing)

4. install VB 5.2 from third party binary or ppa

This could be a long time getting fixed, because it's complicated, involves multiple vendors and the whole spectre mess caused it all, which is probably more important than VB. So you should choose your options from above and get on with it.

Personally I am currently using 3, and will choose 2 or 4 if situation persists for more than a few weeks.

Respect

Sorry for my tone. You are right.
(Unfortunately I do not like to use any of the options mentioned.)

Hello, for people experiencing issues with qt and my ppa, please add this additional repo
https://launchpad.net/~ci-train-ppa-service/+archive/ubuntu/stable-phone-overlay
(note: this upgrades qt to a newer version, I don't know the side effects).

Unfortunately 5.2.6 *doesn't* build with xenial qt stack, too old, so I had to tweak with an additional repo to make it at least build.

upstream has a custom-built qt version just for Ubuntu xenial, there is no known ETA for a fix, and they are currently trying to craft a patch against older virtualbox 5.0 and 5.1 packages.

There is a lot of ongoing work there, for now solutions in #32 are your best chances.

Please try my ppa with the additional qt repo, and report back! thanks

Vlad Orlov (monsta) wrote :

https://www.virtualbox.org/wiki/Linux_Downloads

5.1.30 from their official repo runs fine with 4.13 and doesn't require any Qt modifications.

Alkis Georgopoulos (alkisg) wrote :

The latest upstream VirtualBox 5.2.6-120293~Ubuntu~xenial, runs fine with 4.13, using the stock Xenial Qt version.

Why does the Ubuntu package need a new Qt when the upstream package doesn't?

Isn't 4.13 the first kernel to fix that Intel bug that was all over the news earlier this month?

I've been booting with 4.10 in order to use virtualbox; does that make me susceptible to that kernel-memory-leaking-intel-bug?

http://www.businessinsider.com/linus-torvalds-linux-inventor-is-furious-at-intel-2018-1

xoristzatziki's suggestion of backporting VirtualBox 5.2.6 to 16.04 LTS is what I think needs to happen here.

Following Alkis Georgopoulos's advice, I can confirm that 5.2.6 works great on the 4.13 kernel

To install it, I ran all of this as one command:

sudo sh -c 'echo "deb http://download.virtualbox.org/virtualbox/debian xenial contrib" >> /etc/apt/sources.list' ; wget -q https://www.virtualbox.org/download/oracle_vbox_2016.asc -O- | sudo apt-key add ; sudo apt remove virtualbox ; sudo apt update ; sudo apt install virtualbox-5.2

Vlad Orlov (monsta) wrote :

Kernel 4.4 also has been patched for these Intel bugs, so you can use it instead of 4.13 if you don't need the latest hardware support.

Pedro Côrte-Real (pedrocr) wrote :

I was seeing more screen tearing after going back to the 4.4 kernel and corresponding xserver so I decided I wanted to be able to use the HWE stack again. I almost moved to virtualbox 5.2 from the virtualbox.org repos but then I just decided to backport virtualbox 5.1.30 from artful and that worked fine. The process is roughly:

```sh
$ sudo apt build-dep virtualbox
# Set your /etc/apt/sources.list deb-src entries to point to artful. You want to replace xenial with artful in the lines:
# deb-src http://pt.archive.ubuntu.com/ubuntu/ xenial multiverse
# deb-src http://pt.archive.ubuntu.com/ubuntu/ xenial-updates multiverse
$ apt source virtualbox
$ cd virtualbox-5.1.30-dfsg
$ sudo dpkg-buildpackage -us -uc -nc
# This will fail but tell you some missing dependencies that you need to install
# You can install everything but kbuild but we will just ignore it next (the -d flag)
$ sudo dpkg-buildpackage -d -us -uc -nc
# now you have the packages built
$ cd ..
$ sudo dpkg -i <whichever packages you need>
```

If you also need the proprietary extensions package you can just grab the exact one from artful from here:

https://packages.ubuntu.com/bionic/virtualbox-ext-pack

This virtualbox version seems to work fine. The 5.2 from bionic fails with some qt5 issues, which may just be other missing dependencies. It would seem simple enough to just backport virtualbox 5.1 (or even 5.2) to xenial but I don't know if there's a maintainer around to do it.

Alin Trăistaru (alindt) wrote :

...and here's a PPA for backported 5.1.30 from Artful:

https://launchpad.net/~alindt/+archive/ubuntu/build-deps/+packages

sudo add-apt-repository ppa:alindt/xenial-backports-virtualbox
sudo apt-get update

Alin Trăistaru (alindt) wrote :

Sorry, wrong link in previous post.

https://launchpad.net/~alindt/+archive/ubuntu/xenial-backports-virtualbox

sudo add-apt-repository ppa:alindt/xenial-backports-virtualbox
sudo apt-get update

Pedro Côrte-Real (pedrocr) wrote :

alindt, that PPA is missing at least the -dkms, -qt and all the -guest packages. And at least for me the point of not using the official Oracle archive is to make sure I'm getting the Ubuntu packaged code. A PPA doesn't really guarantee that as the code could have been tampered with. I'm obviously not saying you did that but it would be nice if this was solved in the actual ubuntu archives.

Alin Trăistaru (alindt) wrote :

@pedrocr - No, the PPA isn't missing anything, it's just showing you the _source_ packages used to build all the packages (DEBs) you mentioned. Click on the "virtualbox" package and at the end of the changelog you'll see all the DEBs built/available.

The PPA is simply a backport of the official virtualbox-5.1.30 from Artful, made using backportpackage.

Cheers.

Thanks Lonnie Lee Best, your command did it for me. VirtualBox is not freezing the host anymore :)

Alkis Georgopoulos (alkisg) wrote :

I usually prefer the Ubuntu packaging to whatever upstream packaging.
But in this case, Ubuntu requires dkms, while upstream doesn't, for a long time now. There's no module compilation on each kernel upgrade.
It's an additional significant reason to prefer the upstream package.

Maybe it's time to update the Ubuntu packaging as well, and not just the source?

I'm the maintainer, please use my ppa:
https://bugs.launchpad.net/ubuntu/+source/virtualbox/+bug/1736116/comments/34

And please stop asking and re-asking the same questions.

Upstream has a CUSTOM qt version, I can't obviously push that in Ubuntu.

If you know how to fix qt to make the new vbox build, please post a patch, otherwise stop posting useless stuff here, it won't help.

I think I'll do a push of some virtualbox 5.1 probably, but only if upstream confirms there is no easy fix for xenial.

ANUPAM MITRA (anupammitra) wrote :

@ Lonnie Lee Best - I applied what you have suggested at #39. But when I launched VirtualBox, it says as under:

RTR3InitEx failed with rc=-1912 (rc=-1912)

The VirtualBox kernel modules do not match this version of VirtualBox. The installation of VirtualBox was apparently not successful. Executing

'/sbin/vboxconfig'

may correct this. Make sure that you do not mix the OSE version and the PUEL version of VirtualBox.

where: supR3HardenedMainInitRuntime what: 4 VERR_VM_DRIVER_VERSION_MISMATCH (-1912) - The installed support driver doesn't match the version of the user.

AND ALSO THE FOLLOWING:

Failed to open a session for the virtual machine Windows 7.

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

Result Code: NS_ERROR_FAILURE (0x80004005)
Component: MachineWrap
Interface: IMachine {85cd948e-a71f-4289-281e-0ca7ad48cd89}

I'm sorry if the command I wrote didn't work for you. Here's the whole thing:

sudo sh -c 'echo "deb http://download.virtualbox.org/virtualbox/debian xenial contrib" >> /etc/apt/sources.list' ; wget -q https://www.virtualbox.org/download/oracle_vbox_2016.asc -O- | sudo apt-key add ; sudo apt remove virtualbox ; sudo apt update ; sudo apt install virtualbox-5.2

Now, let's break that apart.

First of all, I'm running Ubuntu 16.04.3.

The command below adds one line to the file /etc/apt/sources.list, so that it now knows a new place from which to install virtualbox-5.2:

sudo sh -c 'echo "deb http://download.virtualbox.org/virtualbox/debian xenial contrib" >> /etc/apt/sources.list'

The next command downloads a key from virtualbox.org and adds that key to your ubuntu system:

wget -q https://www.virtualbox.org/download/oracle_vbox_2016.asc -O- | sudo apt-key add

Next, we uninstall your existing version of virtualbox:

sudo apt remove virtualbox

Next we do an update, so your system becomes aware of the packages from the new source we added:

sudo apt update

Last, we install the 5.2 version of virtualbox:
sudo apt install virtualbox-5.2

I did not encounter your issue. Maybe try this command:
sudo apt dist-upgrade ; sudo apt install virtualbox-5.2

Reboot your computer and try to launch virtualbox again.

I'm sorry my command didn't work for you. Worst case, you could undo it by opening this file and removing the last line we added:
nano /etc/apt/sources.list
(after you remove that line hit ctrl-o to save)

Then you could remove virtualbox 5.2:
sudo apt remove virtualbox-5.2

Then update your system:
sudo apt update

Then install the virtualbox you had before:
sudo apt install virtualbox

And to make the old version work, you can press the esc key a few time right when ubuntu starts to boot. Then choose advance and boot the 4.10 kernel instead of 4.13.

I hope this helps.

problem possibly started with linux-image-4.13.0-26-generic or linux-image-4.13.0-25-generic (didn't existed in previous updates, not sure which were installed in my system during "daily update", and if any of previous was installed). Problem still exists with the new linux-image-4.13.0-31-generic and exists even for command line start of VBoxHeadless with:
nohup VBoxHeadless -startvm "vm_name" &

Alexandru Iacob (isalexandru) wrote :

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.

John Goebel (jp-goebel) wrote :

#50 followed by #52 solved the problem for me, thank you very much.

Alkis Georgopoulos (alkisg) wrote :

@LocutusOfBorg, first of all, thank you very much for your continuous effort in maintaining VirtualBox.

After you mentioned that "upstream vbox ships a custom qt version", I asked about it in #vbox, and they said:
> [...] qt5 was pretty much unusable rubbish until 5.5/5.6. and then they decided to change the license for 5.7, which means that going there requires review by Oracle legal.
> [...] the "ship library" approach is what we use for the ubuntu LTS packages on virtualbox.org - slap a number of qt5.6 libs into the vbox package. which would cause seizures for a debian/ubuntu packager :P
And, talking about this particular issue,
> [...] to be accurate: we don't have the faintest idea why things blow up.

So unless Debian/Ubuntu somehow make an exception and allow us to ship Qt 5.6 in parallel with other Qt 5.x versions, either bundled with apps that need it, or as a separate package...
...getting vbox 5.2.x to Ubuntu 16.04 isn't an easy task.

Thanks again!

Vlad Orlov (monsta) wrote :

Then it's easier to settle for 5.1.x which is still supported upstream.

nor (inventarnummer) wrote :

@Lonnie Lee #39

Thank You, you made my day !!!

Wong Jia Hau (hou32hou) wrote :

#53 Thank you!

ameel (ameel-beesony) wrote :

For those getting error:

VBoxManage: error: The virtual machine 'VM1' has terminated unexpectedly during startup with exit code 1 (0x1)
VBoxManage: error: Details: code NS_ERROR_FAILURE (0x80004005), component MachineWrap, interface IMachine

Comment #52 (https://bugs.launchpad.net/ubuntu/+source/virtualbox/+bug/1736116/comments/52) above fixes the issue!

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers