Since Netgate appears to be losing interest in pfSense, or more accurately, pusing the free users into a base-level subscription model for the firewall, I am looking to begin experimenting with OPNsense. Since I don't have the spare hardware to test it out and convert my pfSense configs, I was originally going to use Virtualbox, but traditionally, the kernel module generally stopped working for a long period after the respective .0 releases of FreeBSD...
It's because until the previous minor release (.1, .2, .3, etc) EOL, the version of the module is built against the previous release's kernel, and so will not work. I could have built an updated module in poudriere, but figured it would be a good time instead to get up to speed with the native alternative, bhyve.
So I installed bhyve, and I started setting it up. Unfortunately, all of the guides I looked at set things up slightly differently, especially the networking setup.
So the smorgasboard of resources I am consulting while setting this up, includes:
- The Virtualization chapter of the FreeBSD Handbook
- Vermaden's blog
- Klara's 0 to Bhyve article
- A Japanese blog that discusses setting up several OSes in bhyve
And because I am setting up OPNsense, I stumbled across: - OPNsense installation on Bhyve
So my installation process was to
-
Install the packages
pkg install vm-bhyve-devel bhyve-firmware edk2-bhyve grub2-bhyve dnsmasq
-
Set up ZFS dataset for bhyve
zfs create NCC72321/bhyve
zfs set recordsize=64K NCC72321/bhyve
zfs create NCC72321/bhyve/.templates
-
Set up virtualization kernel module
Addvmm_load="YES"
to /boot/loader.conf or add
vmm.ko
to thekld_list=
line in /etc/rc.conf. -
Enable tap network device
echo "net.link.tap.up_on_open=1" >> /etc/sysctl.conf
-
Set up bhyve parameters, basic parameters and networking
# bhyve setup
vm_enable="YES"
vm_dir="zfs:NCC72321/bhyve"
vm_list=""
vm_delay=3
At this point, I am still working out the networking, so I will continue this post once I get my brain around it.