I simply searched for “wifibox” selected it and the dependencies followed:
Code: Select all
grub2-bhyve
socat
wifibox
wifibox-alpine
wifibox-core
After the installation to the system, check the sample configuration files provided in the /usr/local/etc/wifibox directory and follow the instructions to create a working configuration, otherwise wifibox will refuse to start. For systems that might be put in sleep mode, e.g. laptops, there is a sample devd.conf(5) configuration file in the /usr/local/etc/devd directory that can be used to restart wifibox on resume.
get wifi card specs:
I used pciconf -lBbcevV iwm0 to get the pci address of my Wi-Fi card
Code: Select all
iwm0: <Intel(R) Dual Band Wireless AC 9560>
iwm0@pci0:0:20:3
Wifibox configuration
Code: Select all
# cat /usr/local/etc/wifibox/bhyve.conf
Code: Select all
cpus=1
memory=128
console=yes
passthru=0/20/3
Code: Select all
# This is a `devd(8)` configuration file to run the resume action of
# wifibox on the ACPI resume event. Review the contents and create a
# copy of it without the `.sample` extension to use it. Restart the
# `devd` service once the file has been created.
notify 11 {
match "system" "ACPI";
match "subsystem" "Suspend";
action "logger 'Stopping wifibox before suspend' && /usr/local/sbin/wifibox stop && /etc/rc.suspend acpi $notify";
};
notify 11 {
match "system" "ACPI";
match "subsystem" "Resume";
action "/etc/rc.resume acpi $notify && logger 'Starting wifibox after resume and getting IP via DHCP' && /sbin/kldunload vmm && /sbin/kldload vmm && /usr/local/sbin/wifibox start guest && /sbin/dhclient wifibox0";
};
Next configure the Host:
Disable local WiFi and enable Wifibox
By default, PCI pass-through is disabled for AMD-based hardware, hence it must be explicitly enabled via the corresponding syctl(8) variable. This can be done by adding the following line to either /etc/sysctl.conf or /boot/loader.conf depending on whether vmm(4) is going to be loaded by wifibox or it is already loaded at boot.
added this line to /boot/loader.conf
Code: Select all
# Wifibox
hw.vmm.amdvi.enable=1
Code: Select all
wifibox_enable="YES"
Code: Select all
devmatch_enable="YES"
devmatch_blocklist="if_iwm if_iwlwifi"
Disabled local wifi:
Code: Select all
#WiFi
#wlans_iwm0="wlan0"
#ifconfig_wlan0="WPA DHCP"
#create_args_wlan0="wlanmode sta regdomain FCC country US"
#wlandebug_wlan0="+state +node +auth +assoc +dot1xsm +wpa +scan"
Code: Select all
## ## WIFIBOX ## ##
wifibox_enable="YES"
devmatch_enable="YES"
devmatch_blocklist="if_iwm if_iwlwifi"
#DHCP
ifconfig_wifibox0="SYNCDHCP"
background_dhclient_wifibox0="YES"
defaultroute_delay="0"
defaultrouter="10.0.0.1"
## ## end wifibox ## ##
The wifibox0 networking interface can be brought up with the use of the netif service.
Code: Select all
# service netif start wifibox0
Code: Select all
# service routing restart
Code: Select all
#service netif start wifibox0
Code: Select all
Idle Latency: 6.47 ms (jitter: 0.84ms, low: 5.83ms, high: 7.14ms)
Download: 556.38 Mbps (data used: 982.2 MB)
20.03 ms (jitter: 16.97ms, low: 8.80ms, high: 286.34ms)
Upload: 235.55 Mbps (data used: 229.0 MB)
11.10 ms (jitter: 5.34ms, low: 5.31ms, high: 32.83ms)
Packet Loss: 0.0%
To bring the wifibox0 interface up on reboot create a /etc/rc.local script. This file probably doesn’t exist on your machine because its the old way of doing rc scripting but this seems to be the easiest way to have wifibox work upon restart of the machine.
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:
#cat /etc/rc.local
Code: Select all
/sbin/dhclient wifibox0