Bhyve and UEFI NVRAM

Mathieu Arnold mat at FreeBSD.org
Thu Jan 16 09:04:47 UTC 2020


Hi,

I have been trying to install arch linux in bhyve, it works great if I
uses the BIOS with grub, but for my purpose, I need to be able to boot
using UEFI mode.
So, I install the vm using the arch iso, it works just fine, I use the
tutorial here https://wiki.archlinux.org/index.php/EFISTUB to boot using
UEFI directly, without adding a layer of boot manager, which is
basically using:

efibootmgr --disk /dev/vda --part 1 --create --label "Arch Linux" --loader /vmlinuz-linux --unicode 'root=PARTUUID=XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX rw initrd=\initramfs-linux.img' --verbose

to add a boot entry to the NVRAM with the correct "thingies" to get the
UEFI firmware to find all it needs.

It works correctly because if at that point I reboot the vm, it boots
correctly into the arch installation, and as long as I don't stop/start
the vm it works.

Now, if I stop the vm and start it up again, it does not work anymore
because whatever UEFI NVRAM efibootmgr wrote to, it seems it was only
non volatile as long as the bhyve process was running, but it was not
actually saved anywhere for later use.

So, I am wondering, is there some magic bhyve thing that I could not
find in the man page that would allow me to map the nvram to a file on
the host?  Or some other magic that would allow me to change the bhyve
nvram from the bhyve command line?

Regards,

PS: as a side note, I don't use bhyve directly but I use it through
sysutils/vm-bhyve, but it should probably not matter.
-- 
Mathieu Arnold
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 963 bytes
Desc: not available
URL: <http://lists.freebsd.org/pipermail/freebsd-virtualization/attachments/20200116/cf2084c3/attachment.sig>


More information about the freebsd-virtualization mailing list