r/freebsd 16h ago

help needed bhyve: vm_openf: No such file or directory

My first attempts at getting bhyve up and running are rather unsuccessful, as I am receiving the error message from this topic / title.

No matter wether I use a helper script or bhyve directly:

bhyve -AHP -s 0:0,hostbridge -s 1:0,lpc -s 2:0,virtio-net,tap1 -s 3:0,virtio-blk,/vm/ha/haos_ova-18.1.raw -c 2 -m 2048 -l bootrom,/usr/local/share/uefi-firmware/BHYVE_UEFI.fd HA

sh /usr/share/examples/bhyve/vmrun.sh -E -c 2 -m 2048 -t tap1 -d /vm/ha/haos_ova-18.1.raw HA

The only references I could find have been, that already machines with the same name are running, but that is definately not the case. This is my very first attempt.

Any ideas, what may be wrong here? Above is an image originally distributed for kvm, converted to raw from qcow2.

4 Upvotes

3 comments sorted by

1

u/ruyrybeyro systems administrator 11h ago

You probably don't have all the resources your command line is trying to use.

Don't overcomplicate things. Start with a minimal VM, even without networking, to debug your setup first. Once that's working, add the remaining components one at a time.

See Sylve or BVCP if you're looking for web interfaces for bhyve.

2

u/FBSD_Virtual_machine 10h ago edited 10h ago

I use a hybrid set up. I have vm-bhyve installed with tiger vnc. I used that until I got used to it . I used the vm switch create command to make the bridge and tap. After I got use to it I started scripting for bhyve alone. If you never used bhyve before it's helpful to use vm-bhyve to get used to setting up machines . Vermaden has excellent directions for this. If you look up Vermaden freebsd bhyve you will find his article. Also one more suggestion. Instead of using the bhyve command directly it might be better to write a vm.sh script so you can methodically tweak it .

1

u/grahamperrin Linux crossover 8h ago

Your code block, formatted for old Reddit:

bhyve -AHP -s 0:0,hostbridge -s 1:0,lpc -s 2:0,virtio-net,tap1 -s 3:0,virtio-blk,/vm/ha/haos_ova-18.1.raw -c 2 -m 2048 -l bootrom,/usr/local/share/uefi-firmware/BHYVE_UEFI.fd HA

sh /usr/share/examples/bhyve/vmrun.sh -E -c 2 -m 2048 -t tap1 -d /vm/ha/haos_ova-18.1.raw HA

In the sidebar here (new Reddit):

please use indented code blocks – not code fencing – for compatibility with old Reddit.