jails bhyve: vm_openf: No such file or directory in jailed bhyve

The jail follows the following config:
Code:
acme {
exec.start = "/bin/sh /etc/rc";
exec.stop = "/bin/sh /etc/rc.shutdown";
exec.consolelog = "/var/log/jail_console_${name}.log";

allow.mount;
allow.mount.devfs;
allow.raw_sockets;
allow.vmm;
enforce_statfs = 2;
securelevel = 2;
exec.clean;
mount.devfs;
devfs_ruleset = 25;

path = "/jails/${name}";
host.hostname = "${name}";
}
With the devfs rules:
Code:
[devfs_rules_bhyve_jail=25]
add include $devfsrules_hide_all
add include $devfsrules_unhide_basic
add include $devfsrules_unhide_login
add path vmm unhide
add path vmm/* unhide
add path vmm.io unhide
add path vmm.io/* unhide
add path tap* unhide
add path nmdm* unhide
The jail was setup with
Code:
bsdinstall jail /jails/acme
service jail start acme
pkg -j acme install bhyve-firmware
And then setup the vm as in the handbook (but without network) running inside the jail
Code:
cd /root
truncate -s 16G guest.img
fetch https://download.freebsd.org/releases/ISO-IMAGES/15.1/FreeBSD-15.1-RELEASE-amd64-bootonly.iso
sh /usr/share/examples/bhyve/vmrun.sh -c 1 -m 1024M -d guest.img \
     -i -I FreeBSD-15.1-RELEASE-amd64-bootonly.iso guestname
I got a error of:
Code:
Launching virtual machine "guestname" ...
bhyveload: vm_create: No such file or directory
Trying the alternative of running directly with bhyve as follows:
Code:
bhyve -D -H -l bootrom,/usr/local/share/uefi-firmware/BHYVE_UEFI.fd example
Gives me the error:
Code:
bhyve: vm_openf: No such file or directory
 
Your devfs ruleset is missing /dev/vmmctl. Since FreeBSD 14 libvmmapi creates VMs through an ioctl on that node, so vm_create() fails with ENOENT when it can't open it. That's the "No such file or directory" you get from both bhyveload and bhyve.

Add "add path vmmctl unhide" to your ruleset and restart the jail, then it should work.
 
Back
Top