cockpit-project / cockpit-machines

Cockpit UI for virtual machines
GNU Lesser General Public License v2.1
262 stars 68 forks source link

test: Check creating and booting an EFI guest #1619

Closed martinpitt closed 1 month ago

martinpitt commented 2 months ago

Use our new "alpine-efi" bots image as guest.

This isn't very comprehensive yet, mostly to validate that the alpine-efi image works, and that c-machines/libvirt can actually boot an EFI guest. We may want to extend this to more tests in the future, so that we'll get better ARM coverage. But that at least sets a baseline.


Requires https://github.com/cockpit-project/bots/pull/6351 . Also, the first image I tried this on was fedora-40, and it failed right away. Turns out it's drumroll SELinux, so this will need a naughty. That's added to the bots PR now.

martinpitt commented 2 months ago

Why am I not surprised.. It doesn't boot:

image

Booting with

virt-install -n a1 --memory 256 --import --disk /var/lib/libvirt/images/alpine-efi --os-variant alpinelinux3.8 --graphics vnc --boot uefi --wait 0

somewhat works -- it gets past EFI and grub, and now just hangs on an empty screen -- mostly because it's so achingly slow due to emulated QEMU. I'm afraid Alpine is too complex/big to be able to sensibly boot there.

But at least this gets way further than c-machines. So now to find out where the difference is..

One major one is --os-variant fedora28 (selecting q35) vs. --os-variant alpinelinux3.8 (selecting i440fx). But that gives an "Access denied", not a "Not found".

mvollmer commented 2 months ago

The alpine-efi image is not a ISO and can't be put into a cdrom, I think, but that's what the test seems to do.

However, I have found no other way to boot the alpine-efi image with c-machines... "Cloud base image" with UEFI has the same behavior, and with BIOS it ends up in a 100% CPU loop. vm-run alpine-efi works fine.

mvollmer commented 2 months ago

Alright, using a i440fx machine and using "alpine-efi" as a "Cloud base image" works.

I couldn't get to boot the official Alpine ISO with UEFI on neither q35 nor i440fx.. If that's what progress looks like, I don't want to be part of it...

mvollmer commented 2 months ago

Alright, using a i440fx machine and using "alpine-efi" as a "Cloud base image" works.

I have pushed a commit that implements this in the test. The hardest part was to get the dialog to give us a i440fx machine...

mvollmer commented 2 months ago

it gets past EFI and grub, and now just hangs on an empty screen

That is probably because the console is not on VNC but on ttyS0.

martinpitt commented 2 months ago

@mvollmer Thanks for your investigations! TBH I'm not really that much interested in continuing to work on this -- it was a half-hearted attempt towards https://issues.redhat.com/browse/COCKPIT-970 , but this needs a lot more libvirt/qemu/images understanding and work than I currently have..

martinpitt commented 1 month ago

No time for this, sorry.