bhyve UEFI

The bhyve hypervisor supports Unified Extensible Firmware Interface Graphics Output Protocol or "UEFI-GOP" in FreeBSD-CURRENT as of r302332

Retrieve the Firmware Binary

pkg install bhyve-firmware

Hypervisor, Network and Storage Preparation

Modify to suit your system, particularly with regard to the hardware network device (example is em0):

kldload vmm
ifconfig tap0 create up
ifconfig bridge0 create up
ifconfig bridge0 addm em0
ifconfig bridge0 addm tap0
truncate -s 5G disk.img

Boot a Virtual Machine

bhyve -c 2 -m 4G -w -H \
        -s 0,hostbridge \
        -s 3,ahci-cd,/path/to/uefi-OS-install.iso \
        -s 4,ahci-hd,disk.img \
        -s 5,virtio-net,tap0 \
        -s 29,fbuf,tcp=0.0.0.0:5900,w=800,h=600,wait \
        -s 30,xhci,tablet \
        -s 31,lpc -l com1,stdio \
        -l bootrom,/usr/local/share/uefi-firmware/BHYVE_UEFI.fd \
        vm0

This will create a virtual machine with 4GB of RAM with a display resolution of 800 by 600 that can be accessed via VNC at: 0.0.0.0:5900

The fbuf wait parameter instructs bhyve to only boot upon the initiation of a VNC connection, simplifying the installation of operating systems that require immediate keyboard input. This can be removed for post-installation use.

The xhci,tablet parameter provides precise cursor synchronization when using VNC, but is not supported by FreeBSD.

Desktop versions of Microsoft Windows require the presence of a CD/DVD device, which can be an empty file created with touch(1).

bhyveload and sysutils/grub2-bhyve are not required for UEFI.

This has been tested with FreeBSD/UEFI, popular GNU/Linux distributions and various versions of Microsoft Windows Desktop and Server on FreeBSD the 11-CURRENT r300097 snapshot.


CategoryVirtualization

bhyve/UEFI (last edited 2016-08-03 15:28:20 by FabianFreyer)