https://oshogbo.vexillium.org/blog/39/
ifconfig
re0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
options=8209b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,WOL_MAGIC,LINKSTATE>
ether 04:7c:16:3b:35:b3
media: Ethernet autoselect (none)
status: no carrier
nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
lo0: flags=1008049<UP,LOOPBACK,RUNNING,MULTICAST,LOWER_UP> metric 0 mtu 16384
options=680003<RXCSUM,TXCSUM,LINKSTATE,RXCSUM_IPV6,TXCSUM_IPV6>
inet 127.0.0.1 netmask 0xff000000
inet6 ::1 prefixlen 128
inet6 fe80::1%lo0 prefixlen 64 scopeid 0x2
groups: lo
nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
wlan0: flags=8943<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST> metric 0 mtu 1500
options=0
ether 70:d8:23:27:7e:64
inet 192.168.1.163 netmask 0xffffff00 broadcast 192.168.1.255
groups: wlan
ssid DF1210 channel 161 (5805 MHz 11a) bssid a8:a2:37:19:37:e2
regdomain FCC country US authmode WPA2/802.11i privacy ON
deftxkey UNDEF AES-CCM 2:128-bit AES-CCM 3:128-bit txpower 23 bmiss 7
mcastrate 6 mgmtrate 6 scanvalid 60 wme roaming MANUAL
parent interface: iwlwifi0
media: IEEE 802.11 Wireless Ethernet OFDM/54Mbps mode 11a
status: associated
nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
tap0: flags=1008943<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST,LOWER_UP> metric 0 mtu 1500
options=80000<LINKSTATE>
ether 58:9c:fc:00:40:34
groups: tap
media: Ethernet 1000baseT <full-duplex>
status: active
nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
Opened by PID 3285
bridge0: flags=1008843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST,LOWER_UP> metric 0 mtu 1500
options=0
ether 58:9c:fc:10:ec:72
inet 192.168.67.1 netmask 0xffffff00 broadcast 192.168.67.255
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 4 priority 128 path cost 2000000
member: wlan0 flags=143<LEARNING,DISCOVER,AUTOEDGE,AUTOPTP>
ifmaxaddr 0 port 3 priority 128 path cost 370370
groups: bridge
nd6 options=9<PERFORMNUD,IFDISABLED>
# ifconfig tap0 create
# ifconfig tap0 up
# ifconfig bridge0 create
# ifconfig bridge0 addm wlan0 addm tap0
# ifconfig bridge0 up
# ifconfig bridge0 192.168.67.1/24
# cd ~/boot_root_nfs
# ./boot_root_nfs 192.168.67.1:/usr/nfs /mnt
my etc/export
/usr/nfs -alldirs -maproot=root -network 172.20.10.6 -mask 255.255.255.0
The showmount seems fine
showmount -e
Result:
-e boot.nfsroot.server=192.168.67.1
-e boot.nfsroot.nfshandle=Xa525e6f7de82c2540a00f6861e00000036eb02000000000000000000X
-e boot.nfsroot.nfshandlelen=28
-e boot.nfsroot.path=/root/nfs
-e boot.nfsroot.server=192.168.67.1
-e boot.nfsroot.nfshandle=Xa525e6f7de82c2540a008b8312000000a67e02000000000000000000X
-e boot.nfsroot.nfshandlelen=28
-e boot.nfsroot.path=/usr/nfs
Exports list on localhost:
/usr/nfs 192.168.67.1
the commands I didnt write are same as the blog
# mount 192.168.67.1:/usr/nfs /mnt
bhyveload -e boot.netif.name=vtnet0
-e boot.netif.hwaddr=00:a0:98:7e:d7:43
-e boot.netif.ip=192.168.67.2
-e boot.netif.netmask=255.255.255.0
-e boot.nfsroot.server=192.168.67.1
-e boot.nfsroot.nfshandle=Xa525e6f7de82c2540a00f6861e00000036eb02000000000000000000X
-e boot.nfsroot.nfshandlelen=28
-e boot.nfsroot.path=/root/nfs
-m4096
-h /mnt
VM1
Consoles: userboot
FreeBSD/amd64 User boot lua, Revision 1.2
ERROR: /boot/lua/loader.lua:34: module 'cli' not found:
no field package.preload['cli']
no file '/boot/lua/cli.lua'
no file '/boot/lua/5.4/lib/cli.so'
no file '/boot/lua/5.4/lib/loadall.so'
no file './cli.so'.
Type '?' for a list of commands, 'help' for more detailed help.
# bhyve -s 0,hostbridge -s 1,lpc -s 2:0,virtio-net,tap0 -m4096 -A -H -P -l com1,stdio VM1
it seems that
Can't open `/dev/gpt/efiboot0'
/dev/gpt/efiboot0: UNEXPECTED INCONSISTENCY; RUN fsck_msdosfs MANUALLY.
THE FOLLOWING FILE SYSTEM HAD AN UNEXPECTED INCONSISTENCY:
msdosfs: /dev/gpt/efiboot0 (/boot/efi)
Automatic file system check failed; help!
ERROR: ABORTING BOOT (sending SIGTERM to parent)!
2024-05-17T22:01:37.475777+08:00 - init 1 - - /bin/sh on /etc/rc terminated abnormally, going to single user mode
Enter full pathname of shell or RETURN for /bin/sh: /bin/sh
# ls
.cshrc boot home net test
.sh_history dev lib proc tftpboot
COPYRIGHT entropy libexec rescue tmp
bin etc media sbin zroot
#
I used old fstab leads to wrong mount
192.168.67.1:/usr/nfs / / nfs rw noatime nolockd 0 0
/dev/nda0p3 none swap sw 0 0
setting rc.conf
bhyvectl –destroy –vm=VM1
host run:
service pf start
vm run:
route add default 192.168.67.1