The built-in intel wifi drivers whilst they do work, are pretty slow. I was getting a maximum throughput of 12Mbps, after implementing wifibox I was getting much more usable speeds.
Wifibox deploys a Linux guest (based in alpine Linux) to drive a wireless networking card on the FreeBSD host system with the help of PCI pass-through.
This guide has been tested on FreeBSD 13.1
$ doas freebsd-update fetch install
$ doas pkg update
$ doas pkg upgrade
$ doas pkg install wifibox
In order to configure bhyve wifibox we need to configure PCI pass through for the wifi adapter, it can also be helpful to enable the console.
We need to get he address of the wirelss adapter to pass through:
$ pciconf -lv | grep -B2 -i wireless
Which will give output similar to:
iwm0@pci0:2:0:0: class=0x028000 rev=0x59 hdr=0x00 vendor=0x8086 device=0x095a subvendor=0x8086 subdevice=0x5410
vendor = 'Intel Corporation'
device = 'Wireless 7265'
We can see from the above output in our example, the address of our card is pci0:2:0:0:, so the address we need for the pci card is
Edit the file
/usr/local/etc/wifbox/bhyve.conf and update the passthru parametre:
2/0/0 in our case is the output from the previous command.
In order for wifibox it needs access to a
wpa_supplicant.conf file know which networks to connect to, for this we’re going to link our existing
$ cd /usr/local/etc/wifibox/wpa_supplicant
$ doas mv wpa_supplicant.conf wpa_supplicant.bak
$ doas ln /etc/wpa_supplicant.conf ./
/etc/rc.conf and add:
### prevent intel wireless drivers loading
### start wifibox and configure interfaces
For some reason on reboot the the
wifibox0 interface fails to get an IP from DHCP, seems to be because the interface doesn’t exist before the bhyve VM is started, work around until I find a solution:
Reboot, all should be good