Combined OVMF code and vars file

bhaskaraba

New Member
Mar 8, 2024
4
0
1
Hello,

I have a customized UEFI code file (OVMF-code.fd) and a customized UEFI vars file (OVMF-vars.fd) seperately that I need to attach to the VM instance. AFAIK, the "efidisk0" argument takes only the UEFI vars file. So, my question is:

1. There is "-pflash" option available in 'qemu-system-x86_64', using which we can attach both the code file and vars file seperately, something like this:
-drive if=pflash,format=raw,unit=0,file=$OVMF-bin.fd,readonly=on \
-drive if=pflash,format=raw,unit=1,file=$OVMF-vars.fs \
So, how do we achieve this in qm/proxmox ?

2. If the above is not supported in proxmox, then is there any tool which can convert these 2 files into a single file and hence I can attach it using the "efidisk0" argument for qm ?

Thank you.
Bhaskara.
 
We do not have an "official" way to use a custom firmware image with a custom vars file. It can however still be done:
  • Disable OVMF by setting bios: seabios
  • Configure the custom arguments in /etc/pve/qemu-server/<vmid>.conf
    Code:
    args: -drive 'if=pflash,unit=0,format=raw,readonly=on,file=/path/to/OVMF_CODE_4M.fd' -drive 'if=pflash,unit=1,format=raw,file=/path/to/OVMF_VARS_4M.fd'
 
  • Like
Reactions: bhaskaraba
We do not have an "official" way to use a custom firmware image with a custom vars file. It can however still be done:
  • Disable OVMF by setting bios: seabios
  • Configure the custom arguments in /etc/pve/qemu-server/<vmid>.conf
    Code:
    args: -drive 'if=pflash,unit=0,format=raw,readonly=on,file=/path/to/OVMF_CODE_4M.fd' -drive 'if=pflash,unit=1,format=raw,file=/path/to/OVMF_VARS_4M.fd'

Great!! Thanks a lot Filip for you quick reply and suggestion. I will try this out. Thanks again.