lxc / incus

Powerful system container and virtual machine manager
https://linuxcontainers.org/incus
Apache License 2.0
2.49k stars 199 forks source link

Can't run an arch linux VM on arch linux. Call to qemu-system-x86_64 fails with: There is no option group 'spice' #414

Closed digitalsignalperson closed 8 months ago

digitalsignalperson commented 8 months ago

Required information

Issue description

Trying to start an arch linux VM on arch linux fails. The call to qemu-system-x86_64 includes "-spice ..." and fails with "Error: Failed to run ... There is no option group 'spice'".

This seems to have been an issue in the past: https://bugs.archlinux.org/task/69582 https://gitlab.com/qemu-project/qemu/-/issues/194

I was running arch VMs on arch with LXD recently without issue (until the image was no longer on their mirrors at the time of incus fork). I thought that I had a working arch VM on incus after that but maybe I was only using containers so far.

Steps to reproduce

On a fresh arch install I'm doing

sudo pacman -S incus
sudo systemctl start incus
sudo systemctl start incus.socket
sudo systemctl start incus-user.socket
sudo incus admin init  # defaults except created a pool with dir backend
sudo usermod -v 1000000-1000999999 -w 1000000-1000999999 root
incus profile unset default raw.idmap  # found from https://wiki.debian.org/Incus will be fixed in the 0.5 release. 

VMNAME=archvm
incus init images:archlinux "$VMNAME" --vm \
    -c security.secureboot=false \
    -c limits.memory=16GiB \
    -c limits.cpu=$(nproc) \
    -c boot.autostart=false
incus start "$VMNAME"

The output of the last command is

Error: Failed to run: forklimits limit=memlock:unlimited:unlimited fd=3 fd=4 -- /usr/bin/qemu-system-x86_64 -S -name archvm -uuid 8f4f9f99-ad42-40ca-a60a-40c627379c2c -daemonize -cpu host,hv_passthrough -nographic -serial chardev:console -nodefaults -no-user-config -sandbox on,obsolete=deny,elevateprivileges=allow,spawn=allow,resourcecontrol=deny -readconfig /var/log/incus/user-1000_archvm/qemu.conf -spice unix=on,disable-ticketing=on,addr=/var/log/incus/user-1000_archvm/qemu.spice -pidfile /var/log/incus/user-1000_archvm/qemu.pid -D /var/log/incus/user-1000_archvm/qemu.log -smbios type=2,manufacturer=LinuxContainers,product=Incus -runas incus: qemu-system-x86_64: -spice unix=on,disable-ticketing=on,addr=/var/log/incus/user-1000_archvm/qemu.spice: There is no option group 'spice'
: signal: segmentation fault (core dumped)
Try `incus info --show-log archvm` for more info

The output of incus info --show-log archvm is

Name: archvm
Status: STOPPED
Type: virtual-machine
Architecture: x86_64
Created: 2024/01/21 19:55 PST
Error: open /var/log/incus/user-1000_archvm/qemu.log: no such file or directory

Information to attach

dmesg during incus start:

[11925.848181] incusbr-1000: port 4(tap45312296) entered blocking state
[11925.848186] incusbr-1000: port 4(tap45312296) entered disabled state
[11925.848200] tap45312296: entered allmulticast mode
[11925.848306] tap45312296: entered promiscuous mode
[11925.894992] qemu-system-x86[69601]: segfault at 28 ip 0000600c2305d474 sp 00007ffd9f334ec0 error 4 in qemu-system-x86_64[600c22a15000+6cb000] likely on CPU 11 (core 3, socket 0)
[11925.895000] Code: 00 00 00 00 00 90 f3 0f 1e fa 53 0f b6 d2 b9 01 00 00 00 48 89 fb 48 83 ec 30 64 48 8b 04 25 28 00 00 00 48 89 44 24 28 31 c0 <48> 8b 47 28 4c 8d 44 24 1f 4c 8d 4c 24 20 48 c7 44 24 20 00 00 00
[11926.095813] tap45312296: left allmulticast mode
[11926.095826] tap45312296: left promiscuous mode
[11926.095906] incusbr-1000: port 4(tap45312296) entered disabled state

incus config show $VNAME --expanded outputs

Error: --expanded cannot be used with a server

No output in /var/log/incus/incusd.log during incus start

stgraber commented 8 months ago

What happens if you run:

qemu-system-x86_64 -spice unix=on,disable-ticketing=on,addr=/tmp/qemu.spice
digitalsignalperson commented 8 months ago
qemu-system-x86_64: -spice unix=on,disable-ticketing=on,addr=/tmp/qemu.spice: There is no option group 'spice'
Segmentation fault (core dumped)
digitalsignalperson commented 8 months ago

Hmm, so must be a non-incus upstream arch or qemu issue? Trying another qemu script that worked until recently has the same issue.

digitalsignalperson commented 8 months ago

sorry not closed. or not sure what the deal is

stgraber commented 8 months ago
pacman -S qemu-base qemu-chardev-spice qemu-hw-usb-redirect qemu-hw-display-virtio-vga qemu-hw-display-virtio-gpu
stgraber commented 8 months ago

Basically ArchLinux seems to have split the QEMU package into a lot of sub-packages, so you need to install all the right bits to make Incus happy. Or use the big hammer and install qemu-full.

digitalsignalperson commented 8 months ago

Thanks! that does the trick