lxc / incus

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

Better support RHEL build of QEMU #1301

Open lebonez opened 1 month ago

lebonez commented 1 month ago

Required information

Issue description

High likelihood this could be a duplicate, I've built Incus on Rocky Linux 9.4 from source. I am hitting two major issues. It seems that Incus is expecting qemu-system-x86_64 to exist but on RedHat derivatives this does not exist. It technically exists at /usr/libexec/qemu-kvm. Doing a symlink from ln -s /usr/libexec/qemu-kvm /usr/bin/qemu-system-x86_64 works around it but that isn't ideal. The next major issue is the drop of Spice support in RedHat 9. Is it possible to build incus without expecting spice?

Steps to reproduce

  1. Install Rocky Linux 9.4.
  2. Build from source generally pretty easy I just took most of the information from the RPM spec repos.
  3. Attempt to run a VM like lxc launch images:rockylinux/9/cloud --vm VM feature won't be supported even though it should be.
  4. ln -s /usr/libexec/qemu-kvm /usr/bin/qemu-system-x86_64.
  5. lxc launch images:rockylinux/9/cloud --vm now it will complain about the VM configs due to the spice settings not being part of qemu anymore in RedHat 9.

Questions

We are definitely awaiting a EL9 zabbly incus LTS or official RPM.

stgraber commented 1 month ago

1) Should be possible though that's not particularly great as we normally want to use the architecture specific QEMU binaries. How does RHEL handle the case where you have the QEMU system binaries for multiple architectures installed? Is qemu-kvm some kind of shell script or the actual QEMU binary?

2) We may be able to detect the lack of SPICE support and degrade things, though that means no VGA access for your VMs which will make some use cases pretty unpleasant (like running Windows or a Linux desktop VM).

lebonez commented 1 month ago

Thank you for the quick response.

1) Indeed /usr/libexec/qemu-kvm on redhat is just the qemu binary unsure if it differentiates on architectures. Looking at the qemu packages available on EL9 there are no extra architecture packages like there used to be on EL8 and older.

2) Yes lack of Spice support seems most complicated but doesn't have a good solution like symlinking or a simple patch. Generally we still have virt-viewer available on EL9 but not spicy or remote-viewer. Which I assume means just have to drop to VNC only? I think the best workaround for my situation would be if there is a way to disabling spice support as a config flag or something. At a later time supporting virt-viewer VNC could be useful.

stgraber commented 1 month ago

We're not likely to add support for VNC as we actively use features of SPICE which VNC doesn't support, including USB passthrough, video acceleration channels, multi display support, ...

But hopefully we can degrade things in a way which just prevents attaching to the VGA console altogether on such systems.