Notes about the usage of OVMF in QEMU.

Case1

1
-bios /path/to/OVMF.fd \

Case2: split firmware

The variable store and the firmware executable are also available in the build output as separate files: “OVMF_VARS.fd” and “OVMF_CODE.fd”. This enables central management and updates of the firmware executable, while each virtual machine can retain its own variable store.

1
2
-drive if=pflash,format=raw,unit=0,readonly=on,file=/path/to/OVMF_CODE.fd \
-drive if=pflash,format=raw,unit=1,file=/path/to/OVMF_VARS.fd \

Case3: secure boot

1
2
3
-drive if=pflash,format=raw,unit=0,readonly=on,file=/path/to/OVMF_SECURE_CODE.fd \
-drive if=pflash,format=raw,unit=1,file=/path/to/OVMF_VARS.fd \
-global driver=cfi.pflash01,property=secure,value=on \

参考资料:

  1. Open Virtual Machine Firmware (OVMF) Status Report
  2. Configuring pflash devices for OVMF firmware