FS#69582 - LXD/QEMU: cannot start any virtual machines

Attached to Project: Community Packages
Opened by Sven (skoehler) - Monday, 08 February 2021, 09:19 GMT
Last edited by Morten Linderud (Foxboron) - Saturday, 09 October 2021, 11:49 GMT
Task Type Bug Report
Category Packages
Status Closed
Assigned To Anatol Pomozov (anatolik)
Morten Linderud (Foxboron)
Architecture All
Severity High
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 1
Private No

Details

Description:
I cannot start any virtual machines with LXD/LXC at the moment.
This is the error message:

$ lxc start debian10vm
Error: Failed to run: forklimits limit=memlock:unlimited:unlimited -- /usr/bin/qemu-system-x86_64 -S -name debian10vm -uuid e265f257-85ca-445f-be5c-0170dca5955d -daemonize -cpu host -nographic -serial chardev:console -nodefaults -no-reboot -no-user-config -sandbox on,obsolete=deny,elevateprivileges=allow,spawn=deny,resourcecontrol=deny -readconfig /var/log/lxd/debian10vm/qemu.conf -pidfile /var/log/lxd/debian10vm/qemu.pid -D /var/log/lxd/debian10vm/qemu.log -chroot /var/lib/lxd/virtual-machines/debian10vm -smbios type=2,manufacturer=Canonical Ltd.,product=LXD -runas nobody: qemu-system-x86_64:/var/log/lxd/debian10vm/qemu.conf:27: There is no option group 'spice'
qemu-system-x86_64: -readconfig /var/log/lxd/debian10vm/qemu.conf: read config /var/log/lxd/debian10vm/qemu.conf: Invalid argument
: Process exited with a non-zero value
Try `lxc info --show-log debian10vm` for more info

$ lxc info --show-log debian10vm
Name: debian10vm
Location: none
Remote: unix://
Architecture: x86_64
Created: 2021/02/07 21:51 UTC
Status: Stopped
Type: virtual-machine
Profiles: default
Error: open /var/log/lxd/debian10vm/qemu.log: no such file or directory


Additional info:
qemu 5.2.0-2
lxc 1:4.0.6-1
lxd 4.11-1

Steps to reproduce:
lxc launch images:debian/10/cloud --vm -c security.secureboot=false


This information might be of use:
qemu-devel@nongnu.org/msg771453.html"> https://www.mail-archive.com/qemu-devel@nongnu.org/msg771453.html
This task depends upon

Closed by  Morten Linderud (Foxboron)
Saturday, 09 October 2021, 11:49 GMT
Reason for closing:  Fixed
Comment by Sven (skoehler) - Monday, 08 February 2021, 11:01 GMT Comment by Sven (skoehler) - Monday, 08 February 2021, 16:41 GMT
For now, I downgraded to qemu-5.1.0-3. I can start my virtual machine again.
Comment by Morten Linderud (Foxboron) - Monday, 08 February 2021, 16:44 GMT
Turns out there is a patched qemu package in the AUR i was never informed about.

https://aur.archlinux.org/packages/qemu-nonbroken/

I'll what with Anatol and figure out what we should do.
Comment by Anatol Pomozov (anatolik) - Monday, 08 February 2021, 21:23 GMT
I pulled a workaround from Debian https://salsa.debian.org/qemu-team/qemu/-/blob/master/debian/patches/build-most-modules-statically-hack.diff that compiles-in QEMU modules. It suppose to fix the regression you see.

QEMU 5.2.0-3 with this patch has been pushed to [testing]. Please check if it fixed this issue.
Comment by edac val (edacval) - Monday, 08 February 2021, 22:17 GMT Comment by Jonathan BISSON (bjonnh) - Friday, 12 February 2021, 22:46 GMT
@anatolik: I can confirm that the testing version solves the issue.
Comment by Sven (skoehler) - Monday, 15 February 2021, 12:48 GMT
qemu 5.2.0-3 from testing works just fine
Comment by Morten Linderud (Foxboron) - Tuesday, 23 February 2021, 23:07 GMT
qemu has been moved out of testing. Sorry for the delay!
Comment by Link Dupont (link) - Tuesday, 04 May 2021, 11:52 GMT
This is still happening for me with qemu-5.2.0-4.
Comment by Morten Linderud (Foxboron) - Tuesday, 04 May 2021, 12:04 GMT
Please provide details. Package versions and logs.
Comment by Link Dupont (link) - Tuesday, 04 May 2021, 12:14 GMT
Yea, sorry. I didn't know much about why this was happening at the time, but I looked more into it to fix the Fedora COPR for LXD. Turns out there's a patch that fixes the interactions between lxd and qemu versions >= 5.2.0. I put together a patch for the Fedora COPR https://github.com/ganto/copr-lxc4/pull/14. I don't have an Arch Linux install right now, but this worked on Fedora. Applying this patch should do it. https://github.com/lxc/lxd/pull/8700/commits/f86eaf85c38cda988589e64b643670189d22923f
Comment by Morten Linderud (Foxboron) - Tuesday, 04 May 2021, 12:18 GMT
Thanks! I'll apply the patch :)
Comment by Morten Linderud (Foxboron) - Thursday, 06 May 2021, 19:46 GMT
I'll keep this issue open for the foreseeable future. LXD and QEMU is going to be broken for a while since the internal device configuration in qemu breaks with qemu.conf as mentioned above. QEMU 6.0 breaks this completely and I don't think it's going to be fixed for a little while. The best thing to do is to keep qemu on the 5.x branch. I'll backport the above mentioned patch still though.
Comment by Toolybird (Toolybird) - Tuesday, 25 May 2021, 08:09 GMT
So IIUC, latest lxd-4.14 release contains a fix / workaround for the original bug?

If true, then qemu can surely lose the static hack patch and go back to fully modular?

I don't use lxd so could someone "in the know" please comment.
Comment by Morten Linderud (Foxboron) - Tuesday, 25 May 2021, 08:12 GMT
The latest lxd 4.14 works with QEMU <6.0. 6.0 and on wards contain several regression in the -readconfig option which LXD and QEMU is working on to address. I'm trying to help by actively backporting and testing patches to our releases.
Comment by edac val (edacval) - Tuesday, 25 May 2021, 15:00 GMT Comment by Morten Linderud (Foxboron) - Saturday, 09 October 2021, 11:49 GMT
This should have been fixed with qemu 6.1.0, and works fine on my end. Closing

Loading...