lima-vm / lima

Linux virtual machines, with a focus on running containers
https://lima-vm.io/
Apache License 2.0
15.5k stars 608 forks source link

Test for QEMU version 7 or higher doesn't work on Enterprise Linux (RHEL, ...) #2392

Open AmedeeBulle opened 5 months ago

AmedeeBulle commented 5 months ago

The following test doesn't work well for Enterprise Linux distributions:

https://github.com/lima-vm/lima/blob/70e681b1f3c942412eae43917dd34c41b8f8aab2/pkg/qemu/qemu.go#L358

$ qemu-system-aarch64 -version     
QEMU emulator version 8.0.0 (qemu-kvm-8.0.0-16.el9_3.3)
Copyright (c) 2003-2022 Fabrice Bellard and the QEMU Project developers
$ qemu-system-aarch64 -machine help
Supported machines are:
virt                 RHEL 9.2.0 ARM Virtual Machine (alias of virt-rhel9.2.0)
virt-rhel9.2.0       RHEL 9.2.0 ARM Virtual Machine (default)
virt-rhel9.0.0       RHEL 9.0.0 ARM Virtual Machine
none                 empty machine

There is no "-7.0" string in qemu-system-aarch64 -machine help...

afbjorklund commented 5 months ago

It probably needs a better test, based on the actual version (in this case: 8.0.0)

afbjorklund commented 5 months ago

It is unfortunate that RHEL renames the "virt" machines, in their QEMU build

EDIT: Nope, they actually remove "virt" and add a custom "virt-rhel" machine.

Apparently they are doing this for all versions and architectures (also x86_64).

pc RHEL 7.0.0 PC (i440FX + PIIX, 1996) (alias of pc-i440fx-rhel7.0.0)

q35 RHEL-8.6.0 PC (Q35 + ICH9, 2009) (alias of pc-q35-rhel8.6.0)

q35 RHEL-9.4.0 PC (Q35 + ICH9, 2009) (alias of pc-q35-rhel9.4.0)

afbjorklund commented 5 months ago

But the packages should only provide /usr/libexec/qemu-kvm, and not pretend to be (upstream) qemu

You might have to install the real qemu (from qemu.org) until this compatibility issue can be addressed.

AmedeeBulle commented 5 months ago

Background: I inadvertently found this by trying to run lima on EL9 on Raspberry Pi where it complained about -device ramfb. Drilled down in the code where I saw it was only intended for older QEMU...

AmedeeBulle commented 5 months ago

But the packages should only provide /usr/libexec/qemu-kvm

This is the case; I am symlinking to make it run and it runs fine on x86_64

nirs commented 3 months ago

The best place to ask about this is qemu-devel or qemu-discuss mailing list:

afbjorklund commented 2 months ago

In this case it was RHEL that renamed and renumbered the QEMU upstream.