jails Running bhyve failed in jails

In the jail:
root@release:~ # ls
.cshrc .lesshst .profile .shrc ob.img
.k5login .login .sh_history hammer.img ob.sh

root@release:~ # cat ob.sh
#!/bin/sh
#tap=$(ifconfig tap create)
#trap 'ifconfig $tap destroy' INT EXIT
#ifconfig bridge0 addm $tap
bhyve -c 2 -AHP -s 0,hostbridge \
-s 1,nvme,/root/ob.img \
-s 2,nvme,/root/hammer.img \
-s 29,fbuf,tcp=0.0.0.0:5900,w=800,h=600,wait \
-s 30,xhci,tablet \
-s 3,lpc \
-l bootrom,/usr/local/share/uefi-firmware/BHYVE_UEFI.fd \
-m 2G ob4

When I run my script
root@release:~ # sh ob.sh
bhyve: init_bootrom: vm_create_devmem: No such file or directory

It's the devfs unhiden
root@release:~ # ls /dev
fd pts stderr stdout vmm vmmctl zfs
null random stdin urandom vmm.io zero

Now in the host, my /etc/defaults/devfs.rules
[devfsrules_jail_bhyve=6]
add include $devfsrules_hide_all
add include $devfsrules_unhide_basic
add include $devfsrules_unhide_login
add include $devfsrules_jail
add path vmm* unhide
add path vmm/* unhide

My /etc/jail.conf
root@freefall:~ # cat /etc/jail.conf
host.hostname = "${name}";
path = "/jails/${name}";
vnet;
mount.devfs;
exec.prestart = "jvn $name";
vnet.interface = "$name";
exec.poststop = "ifconfig $name destroy";
release {
exec.start = "/bin/sh /etc/rc";
exec.stop = "/bin/sh /etc/rc.shutdown";
exec.consolelog = "/var/log/jail_console_${name}.log";
allow.vmm;
devfs_ruleset = 6;
}

The /usr/sbin/jvn script
root@freefall:~ # cat /usr/sbin/jvn
#!/bin/sh
[ $# -eq 1 ] || exit 1
epair=$(ifconfig epair create up)
ifconfig bridge0 addm $epair
ifconfig ${epair%a}b name $1
 
Back
Top