C.J. Collier: Finding: Promoting SeaBIOS Cloud Images to UEFI Secure Boot (Proxmox)
Planet Debian [Unofficial]
March 31, 2026
Discovery
Legacy cloud templates often lack the partitioning and bootloader binaries required for UEFI Secure Boot. Attempting to switch such a VM to OVMF in Proxmox results in “not a bootable disk.” We discovered that a surgical promotion is possible by manipulating the block device and EFI variables from the hypervisor.
The Problem
- Protective MBR Flags: Legacy installers often set
the
pmbr_bootflag on the GPT’s protective MBR. Strict UEFI implementations (OVMF) will ignore the GPT if this flag is present. - Missing ESP: Cloud images often lack a FAT32 EFI System Partition (ESP).
- Variable Store: A fresh Proxmox
efidisk0is empty and lacks both the trust certificates (PK/KEK/db) and the BootOrder entries required for an automated boot.
The “Promotion” Rule
To upgrade a SeaBIOS VM to Secure Boot without a full OS reinstall:
- Surgical Partitioning: Map the disk on the host and
add a FAT32 partition (Type
EF00). Clear thepmbr_bootflag from the MBR. 2. Binary Preparation: Boot the VM in SeaBIOS mode to installshimandgrub-efipackages. Usegrub2-mkconfigto populate the new ESP. 3. Trust Injection: Use thevirt-fw-varsutility on the hypervisor to programmatically enroll the Red Hat/Microsoft CA keys and any custom certificates (e.g., FreeIPA CA) into the VM’sefidisk. 4. Boot Pinning: Explicitly set the UEFIBootOrderto point to theshimx64.efipath viavirt-fw-vars --append-boot-filepath.
Solution (Example Command
Sequence)
On the Proxmox Host (root):
# Map and Clean MBR
DEV=$(rbd map pool/disk)
parted -s $DEV disk_set pmbr_boot off
# Inject Trust and Boot Path (VM must be stopped)
virt-fw-vars --inplace /dev/rbd/mapped_efidisk \
--enroll-redhat \
--add-db <GUID> /path/to/ipa-ca.crt \
--append-boot-filepath '\EFI\centos\shimx64.efi' \
--sb
This workflow enables high-integrity Secure Boot environments using existing SeaBIOS infrastructure templates.
Tweet
Discussion in the ATmosphere