It took me some Googling and experiments before I saw it work the first time: an EFI boot inside QEMU. I was blown away.
What is an EFI boot in QEMU good for? Two things:
To predict about future bootability on actual EFI hardware.
To make a Linux installer work with WLAN as if it's LAN.
My case was a bit of both combined, but that's a story for another post.
To have QEMU do an EFI boot, besides QEMU it takes:
OVMF installed (e.g. package
An EFI-only test image for proof (e.g. MemTest86 5.x or later)
wget https://www.memtest86.com/downloads/memtest86-usb.zip unzip memtest86-usb.zip sudo qemu-system-x86_64 \ -enable-kvm -m 2G \ -bios /usr/share/edk2-ovmf/OVMF_CODE.fd \ -drive file=memtest86-usb.img,format=raw
-enable-kvm -m 2G are optional and just make things run faster.
The location of BIOS file
OVMF_CODE.fd depends on your Linux distrubution:
Enough EFI for today.