freebsd-wifibox: Config directories don't mount inside VM
Hello,
I’m trying to configure wifibox as AP. I added passthru device and started wifibox:
service wireguard start
wifibox console:
localhost:~# ifconfig
localhost:~#
localhost:~# mount
/dev/root on / type squashfs (ro,relatime,errors=continue)
devtmpfs on /dev type devtmpfs (rw,nosuid,noexec,relatime,size=10240k,nr_inodes=13653,mode=755)
proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
tmpfs on /run type tmpfs (rw,nosuid,nodev,size=22496k,nr_inodes=819200,mode=755)
mqueue on /dev/mqueue type mqueue (rw,nosuid,nodev,noexec,relatime)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000)
shm on /dev/shm type tmpfs (rw,nosuid,nodev,noexec,relatime)
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
debugfs on /sys/kernel/debug type debugfs (rw,nosuid,nodev,noexec,relatime)
tmpfs on /tmp type tmpfs (rw,relatime,size=128k)
localhost:~# cat /etc/fstab
tmpfs /tmp tmpfs size=128K 0 0
config /media/etc 9p trans=virtio,ro,noatime,nodiratime,norelatime 0 0
var /var 9p trans=virtio,rw 0 0
app_config /etc/hostapd 9p trans=virtio,rw 0 0
localhost:~# mount app_config
mount: permission denied (are you root?)
localhost:~# id
uid=0(root) gid=0(root) groups=0(root),1(bin),2(daemon),3(sys),4(adm),6(disk),10(wheel),11(floppy),20(dialout),26(tape),27(video)
As you see, VM doesn’t mount config directories. And as a result, doesn’t bringing up network interfaces.
Debug logs:
2023-02-22T11:38:23+0200 DEBUG Program started as /usr/local/sbin/wifibox, with arguments: start
2023-02-22T11:38:23+0200 INFO Begin: wifibox start
2023-02-22T11:38:23+0200 DEBUG start=GN
2023-02-22T11:38:23+0200 INFO Creating bridge interface: wifibox0
2023-02-22T11:38:23+0200 DEBUG [ifconfig] wifibox0
2023-02-22T11:38:23+0200 INFO Linking tap interface to wifibox0: tap0
2023-02-22T11:38:23+0200 INFO vmm.ko is expected at path: /boot/kernel/vmm.ko
2023-02-22T11:38:23+0200 INFO vmm.ko is found at path: /boot/kernel/vmm.ko
2023-02-22T11:38:23+0200 DEBUG assert loaded: kmod=vmm, kmod_file=/boot/kernel/vmm.ko
2023-02-22T11:38:24+0200 DEBUG assert hardware support present: iommu=1, amdvi=0
2023-02-22T11:38:24+0200 DEBUG Backends reported by bhyve:
2023-02-22T11:38:24+0200 DEBUG [bhyve] ahci
2023-02-22T11:38:24+0200 DEBUG [bhyve] ahci-hd
2023-02-22T11:38:24+0200 DEBUG [bhyve] ahci-cd
2023-02-22T11:38:24+0200 DEBUG [bhyve] e1000
2023-02-22T11:38:24+0200 DEBUG [bhyve] dummy
2023-02-22T11:38:24+0200 DEBUG [bhyve] hda
2023-02-22T11:38:24+0200 DEBUG [bhyve] fbuf
2023-02-22T11:38:24+0200 DEBUG [bhyve] amd_hostbridge
2023-02-22T11:38:24+0200 DEBUG [bhyve] hostbridge
2023-02-22T11:38:24+0200 DEBUG [bhyve] lpc
2023-02-22T11:38:24+0200 DEBUG [bhyve] nvme
2023-02-22T11:38:24+0200 DEBUG [bhyve] passthru
2023-02-22T11:38:24+0200 DEBUG [bhyve] virtio-9p
2023-02-22T11:38:24+0200 DEBUG [bhyve] virtio-blk
2023-02-22T11:38:24+0200 DEBUG [bhyve] virtio-console
2023-02-22T11:38:24+0200 DEBUG [bhyve] virtio-input
2023-02-22T11:38:24+0200 DEBUG [bhyve] virtio-net
2023-02-22T11:38:24+0200 DEBUG [bhyve] virtio-rnd
2023-02-22T11:38:24+0200 DEBUG [bhyve] virtio-scsi
2023-02-22T11:38:24+0200 DEBUG [bhyve] uart
2023-02-22T11:38:24+0200 DEBUG [bhyve] xhci
2023-02-22T11:38:24+0200 INFO Bringing up null-modem devices for console connection
2023-02-22T11:38:24+0200 DEBUG assert loaded: kmod=nmdm, kmod_file=nmdm
2023-02-22T11:38:24+0200 INFO Null-modem devices are available
2023-02-22T11:38:24+0200 INFO Waiting for bhyve to start up
2023-02-22T11:38:24+0200 DEBUG Program started as /usr/local/sbin/wifibox, with arguments: _manage_vm
2023-02-22T11:38:24+0200 DEBUG assert daemonized: parent=daemon
2023-02-22T11:38:24+0200 INFO VM manager launched
2023-02-22T11:38:24+0200 INFO Gathering necessary configuration files for launching the guest
2023-02-22T11:38:24+0200 INFO Pulling bhyve options from configuration file
2023-02-22T11:38:24+0200 DEBUG cpus=1, memory=128M, passthru=0/20/3, console=yes
2023-02-22T11:38:24+0200 INFO Guest console is configured to use
2023-02-22T11:38:24+0200 INFO Passthru device is configured: 0/20/3
2023-02-22T11:38:24+0200 INFO PPT driver is configured for pci0:20:3 device
2023-02-22T11:38:24+0200 INFO tap interface is configured: tap0
2023-02-22T11:38:24+0200 INFO Launching guest wifibox from /usr/local/share/wifibox with grub-bhyve
2023-02-22T11:38:24+0200 INFO Application config is found at /usr/local/etc/wifibox/hostapd
2023-02-22T11:38:24+0200 INFO Application config will be mounted writeable
2023-02-22T11:38:24+0200 DEBUG Devices: virtio-blk,/usr/local/share/wifibox/disk.img virtio-9p,config=/usr/local/etc/wifibox/appliance,ro virtio-9p,var=/var/run/wifibox/appliance virtio-9p,app_config=/usr/local/etc/wifibox/hostapd
2023-02-22T11:38:24+0200 DEBUG Arguments: -S -M 128M -r host -c /dev/nmdm-wifibox.1A -d /usr/local/share/wifibox wifibox
2023-02-22T11:38:24+0200 INFO Launching guest wifibox from /usr/local/share/wifibox with bhyve
2023-02-22T11:38:24+0200 DEBUG Arguments: -c 1 -m 128M -AHP -u -S -l com1,/dev/nmdm-wifibox.1A -s 0,hostbridge -s 31,lpc -s 4:0,virtio-blk,/usr/local/share/wifibox/disk.img -s 4:1,virtio-9p,config=/usr/local/etc/wifibox/appliance,ro -s 4:2,virtio-9p,var=/var/run/wifibox/appliance -s 4:3,virtio-9p,app_config=/usr/local/etc/wifibox/hostapd -s 5:0,e1000,tap0 -s 6:0,passthru,0/20/3 wifibox
2023-02-22T11:38:24+0200 DEBUG [bhyve] wrmsr to register 0x140(0) on vcpu 0
2023-02-22T11:38:24+0200 DEBUG [bhyve] rdmsr to register 0x64d on vcpu 0
2023-02-22T11:38:24+0200 DEBUG [bhyve] rdmsr to register 0x64e on vcpu 0
2023-02-22T11:38:24+0200 DEBUG [bhyve] rdmsr to register 0x34 on vcpu 0
2023-02-22T11:38:25+0200 INFO Guest wifibox has started up
2023-02-22T11:38:25+0200 INFO Guest is managed by PID 7301
2023-02-22T11:38:25+0200 INFO Bringing up Unix Domain Socket pass-through
2023-02-22T11:38:25+0200 INFO Found guest IP address: 10.0.0.2
2023-02-22T11:38:25+0200 INFO Configured sockets: [path=/var/run/hostapd/wlan0,user=root,group=0,mode=770,port=1200]
2023-02-22T11:38:25+0200 INFO Hooking up 10.0.0.2:1200 as /var/run/hostapd/wlan0 (root:0@770)
2023-02-22T11:38:25+0200 INFO End: wifibox start
2023-02-22T11:38:28+0200 DEBUG Program started as /usr/local/sbin/wifibox, with arguments: console
2023-02-22T11:38:28+0200 INFO Begin: wifibox console
Don’t have any idea where should I dig to solve this problem. Could you please advise me?
Also please add sample configuration about creating AP. man 8 wifibox has nice samples but nothing regarding hostapd config or setup AP in general. It would be great to have hostapd/hostapd.conf with commented sample configuration. Users could just uncomment sample config and edit it according to their needs instead of reading man hostapd.
Thank you!
About this issue
- Original URL
- State: open
- Created a year ago
- Comments: 23 (10 by maintainers)
To track the issue with
bhyve: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=269827dmesgfrom host system: https://pastebin.com/QRkCkG5Admesgfrom VM: https://pastebin.com/87AmxRrE