Stashing linux away for the day you need it.

I need a Linux VM on my FreeBSD machine for a bunch of FPGA dev work. Thanks to a bunch of folks on the Internet, we have a pretty quick and dirty way of getting Linux setup via bhyve.

Because I was trying to do things via wireless networking, I couldn’t use the most common and easy method for networking to just use dhcp and a bridge(4) with tap(4) on my laptop. I asked a few people in the FreeBSD Discord, trolled FuzzyKaren’s great Kubernetes blog ( and browsed a few FreeBSD forums to come up with something so simple.

Use the UEFI install method for your linux VM, I used the FreeBSD Handbook and a ZFS zvol for it storage.

I reconfigured the networking in the Ubuntu VM to be statically assigned to with a gateway of (and using my home dns server at I setup the tap0 interface being used with:

# tap interfaces for ubuntu VM
ifconfig_tap0="inet netmask"

This bit will let your laptop and your Bhyve VM see each other, but you’ll need a small amount of PF to get to the Internet:


# create all VM interfaces in this subnet

nat on $wlan_if from $vm_ubuntu to !$vm_net -> $wlan_if

pass out all
pass in all