pkg lock -y pkgsed -i '' 's/enabled: no/enabled: yes/' /usr/local/etc/pkg/repos/FreeBSD.confpkg install -y vm-bhyve grub2-bhyvesed -i '' 's/enabled: yes/enabled: no/' /usr/local/etc/pkg/repos/FreeBSD.confpkg unlock -y pkg
zfs create zroot/vmsysrc vm_enable="YES"sysrc vm_dir="zfs:zroot/vm"vm initcp /usr/local/share/examples/vm-bhyve/* /zroot/vm/.templates/
vm switch create -t manual -b bridge0 public
vm iso https://dl-cdn.alpinelinux.org/alpine/v3.17/releases/x86_64/alpine-standard-3.17.2-x86_64.iso
sed -i '' 's/vanilla/lts/g' /zroot/vm/.templates/alpine.conf
vm create -t alpine -s 1G myfirstvmvm install -f myfirstvm alpine-standard-3.17.2-x86_64.iso
sysrc vm_list="myfirstvm"
vm install -f myfirstvm alpine-standard-3.17.2-x86_64.iso
Once it's back up we need to go to OPNSense web interface and commision the tap interface:[opnsense] [Interfaces] [Assignments]Look for tap0 on the dropdown and click [+ADD] now click [SAVE]
root@OPNsense: # ifconfig bridge0bridge0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500 description: bridge0 (opt2) ether 58:9c:fc:10:ff:81 id 00:00:00:00:00:00 priority 32768 hellotime 2 fwddelay 15 maxage 20 holdcnt 6 proto rstp maxaddr 2000 timeout 1200 root id 00:00:00:00:00:00 priority 32768 ifcost 0 port 0 member: tap0 flags=143<LEARNING,DISCOVER,AUTOEDGE,AUTOPTP> ifmaxaddr 0 port 13 priority 128 path cost 2000000 member: igb2 flags=143<LEARNING,DISCOVER,AUTOEDGE,AUTOPTP> ifmaxaddr 0 port 3 priority 128 path cost 55 groups: bridge vm-switch viid-4c918@ nd6 options=9<PERFORMNUD,IFDISABLED>root@OPNsense:# ifconfig tap0tap0: flags=8943<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST> metric 0 mtu 1500 description: vmnet/windows2022/0/public options=80000<LINKSTATE> ether 58:9c:fc:10:ff:ad inet6 fe80::5a9c:fcff:fe10:ffad%tap0 prefixlen 64 scopeid 0xd groups: tap vm-port media: Ethernet autoselect status: active nd6 options=23<PERFORMNUD,ACCEPT_RTADV,AUTO_LINKLOCAL> Opened by PID 88991
ifconfig tap0 name hyve0
ifconfig_tap0_name=”hyve0″