Most IT literate people know VMWare, MS Hyper-V and Linux Kernal Virtual Machine (KVM), but bhyve is relatively obscure. Bhyve is the hypervisor that runs on FreeBSD and supports Linux, FreeBSD and Windows guests. For those comfortable with QEMU / KVM / libvirt, there is a FreeBSD / bhyve port of QEMU and libvirt, so you can use some of the tooling that you are familar with to create guest VMs.

The FreeBSD bhyve / qemu / libvirt tooling is poorly documented, so here are my notes on getting this running, on FreeBSD 12.1 RELEASE.

NOTE: This example is running bhyve as nested hypervisor on FreeBSD running top of QEMU / KVM. The VM is configure with 2 NICs, one for admin access and other the quest network bridge.

STATUS #1: Mid March 2020 - Testing on KVM and outline defined...

STATUS #2: Early May 2020 - Bug with Ubuntu 20.04 / KVM / QEMU / bhyve nesting has stopped progress

Installation and Configure of bhyve

As they VM will need a network bridge, I set up my machine with 2 NI

As it is simpler, quicker and easily repeated, these instructions use binary packages for installation rather then building from source via ports collection.

While bhyve is already part of OS and you just need to load the kernal module for QEMU and libvirt you have to install the additional pkgs: qemu40, libvirt and uefi-edk2-qemu-x86_64 (UEFI firmware):

# pkg install qemu40 libvirt uefi-edk2-qemu-x86_64

Next you need to start the hypervisor and configure network bridge / tap

The validate: virt-host-validate

NOTES: In my example I have two NICs configured on the guest, one for administrative access and the other for VMs bridge.

Gettting VM Running with QEMU / libvirt

Virtual Console and VNC configuration...


Running bhyve on FreeBSD Desktop (GNOME) machine

tips with GNOME & bhyve running together

Nested bhyve with VMM on FreeBSD Desktop on QEMU / KVM

Reference & Links:

BSD Handbook - Section 21.7 FreeBSD as a Host with bhyve. This provide information on how to configure bhyve and networking but not libvirt on FreeBSD

libvirt bhyve driver - provides example configurations for libvirt with bhyve

FreeBSD Bugzilla & Ubuntu LaunchPad - Cross Post bug report: Ubuntu 20.04 KVM / QEMU Failure with nested FreeBSD bhyve