bhyve How to use BHYVE_UEFI_VARS.fd?

I got you and it totally makes sense. BHYVE_UEFI_VARS.fd is not the firmware itself, it's just a storage to persist system variables across reboot. I think this is exact solution to my problem:

I use efibootmgr to clean up and create boot entry for my VM but when rebooting my VM, all those are lost. With this VARS.fd file, it should persist.

Can't wait to try out and hopefully 13.1-RELEASE would have it. Thanks again.
 
For the default location of these files this would be the correct syntax.
-l bootrom,/usr/local/share/uefi-firmware/BHYVE_UEFI.fd,/usr/local/share/uefi-firmware/BHYVE_UEFI_VARS.fd <vm name>
If I'm reading this diff correctly, the "ROM" loader expects a list of exactly two files, separated by a comma. The first file is opened read-only and is read into the guest's "ROM" memory. The second file is opened read-write and is mapped into the guest's "ROM" address space.
This sounds right. The firmware is read-only and settings file rw.
So the var file can probably be named anything you please just like the edk2 firmware.
 
For the ports locations of these files this would be the correct syntax.
-l bootrom,/usr/local/share/uefi-firmware/BHYVE_UEFI.fd,/usr/local/share/uefi-firmware/BHYVE_UEFI_VARS.fd <vm name>

This sounds right. So the var file can probably be named anything you please just like the edk2 firmware.
Yeah, but you really should have a separate vars file for every VM. So something like

Code:
cp /usr/local/share/uefi-firmware/BHYVE_UEFI_VARS.fd ~/guests/guest1.vars
...
-l bootrom,/usr/local/share/uefi-firmware/BHYVE_UEFI.fd,~/guests/guest1.vars <vm name>
 
Just like looking at u-boot code. Boot code is very complex and boring.
I too have been at the excellent edk2 git docs. Very well documented.
Var file not so much so.
I was just wondering what the data structure looked like.
 
Back
Top