I am trying to understand how to control the boot order of an Incus VM. The eventual goal is to PXE/HTTP boot without using the hard drive.
Set up:
$ incus launch images:alpine/3.24 bootorder --vm -c security.secureboot=false
$ incus shell bootorder
# apk add efibootmgr # install
Initial boot order (with some details elided for conciseness):
# efibootmgr
BootCurrent: 0002
Timeout: 3 seconds
BootOrder: 0002,0003,0004,0005,0006,0007,0008,0009,000A,0000,0001
Boot0000* BootManagerMenuApp ...
Boot0001* EFI Firmware Setup ...
Boot0002* UEFI QEMU QEMU HARDDISK ...
Boot0003* UEFI PXEv4 ...
Boot0004* UEFI PXEv6 ...
Boot0005* UEFI HTTPv4 ...
Boot0006* UEFI HTTPv6 ...
Boot0007* UEFI PXEv4 ...
Boot0008* UEFI PXEv6 ...
Boot0009* UEFI HTTPv4 ...
Boot000A* UEFI HTTPv6 ...
Change the boot order and shut the VM down:
# efibootmgr -o 0003
BootCurrent: 0002
Timeout: 3 seconds
BootOrder: 0003
Boot0000* BootManagerMenuApp ...
Boot0001* EFI Firmware Setup ...
Boot0002* UEFI QEMU QEMU HARDDISK ...
Boot0003* UEFI PXEv4 ...
Boot0004* UEFI PXEv6 ...
Boot0005* UEFI HTTPv4 ...
Boot0006* UEFI HTTPv6 ...
Boot0007* UEFI PXEv4 ...
Boot0008* UEFI PXEv6 ...
Boot0009* UEFI HTTPv4 ...
Boot000A* UEFI HTTPv6 ...
# halt
Note: Alpine doesn’t have shutdown, only halt which doesn’t close the Incus shell like shutdown -h now does in Debian. The VM has to be explicitly stopped.
$ incus stop -f bootorder
Restart. I expect it to only attempt to PXEv4 boot (and fail as PXE is not set up). Instead, it boots from the disk. It never attempts to boot over PXEv4.
$ incus start bootorder
To detach from the console, press: <ctrl>+a q
BdsDxe: loading Boot0002 "UEFI QEMU QEMU HARDDISK " from PciRoot(0x0)/Pci(0x1,0x1)/Pci(0x0,0x0)/Scsi(0x0,0x1)
BdsDxe: starting Boot0002 "UEFI QEMU QEMU HARDDISK " from PciRoot(0x0)/Pci(0x1,0x1)/Pci(0x0,0x0)/Scsi(0x0,0x1)
Booting `Alpine Linux v3.24'
Loading Linux virt ...
Loading initial ramdisk ...
... elided ...
Welcome to Alpine Linux 3.24
Kernel 6.18.52-0-virt on x86_64 (/dev/console)
bootorder login:
Check the boot order. It has been reset.
$ incus exec bootorder -- efibootmgr
BootCurrent: 0002
Timeout: 3 seconds
BootOrder: 0002,0003,0004,0005,0006,0007,0008,0009,000A,0000,0001
Boot0000* BootManagerMenuApp ...
Boot0001* EFI Firmware Setup ...
Boot0002* UEFI QEMU QEMU HARDDISK ...
Boot0003* UEFI PXEv4 ...
Boot0004* UEFI PXEv6 ...
Boot0005* UEFI HTTPv4 ...
Boot0006* UEFI HTTPv6 ...
Boot0007* UEFI PXEv4 ...
Boot0008* UEFI PXEv6 ...
Boot0009* UEFI HTTPv4 ...
Boot000A* UEFI HTTPv6 ...
It appears that Incus generates the UEFI variables each time it boots. Is this correct? How does one control the boot order?
Notes:
- This VM has two interfaces on different Incus networks which is why there are two sets of PXE and HTTP entries.
- The boot order is reset with
images:debian/13as well so this is not an Alpine thing. - Eventually, I would like to boot via HTTP only. I discovered that PXEv4/PXEv6 UEFI entries can be removed via
but I don’t know how to remove any of the other entries. It might work if I could remove the hard disk entry.raw.qemu: | -fw_cfg name=opt/org.tianocore/IPv4PXESupport,string=no -fw_cfg name=opt/org.tianocore/IPv6PXESupport,string=no - No hard disk at all would be nice but Incus requires one even though it won’t be used.