bhyve Handbook bhyve linux example

Has anybody successfully tried the 24.6.3. Creating a Linux Guest from the handbook with a Debian?
(the FreeBSD guest example works fine)

When I try debian-11.7.0-amd64-netinst.iso the grub menu appears. (And then you're supposed to leave the menu running and enter the second command, I guess).

bhyve -H -P -s 0:0,hostbridge -s 1:0,lpc -s 2:0,virtio-net,tap0 -s 3:0,virtio-blk,./debian.img \
-s 4:0,ahci-cd,./debian-11.7.0-amd64-netinst.iso -l com1,stdio -c 1 -m 1024M linuxguest

gives

Code:
vm exit[0]
                reason          VMX
                                        rip             0x0000000000000000
                                                                                inst_length     0
                                                                                                        status          0
                                                                                                                               exit_reason      33 (VM-entry failure due to invalid guest state)
                                                                        qualification   0x0000000000000000
                                                                                                                inst_type      0

inst_error              0
                         Abort trap

tap0 says no carrier

Code:
bridge0: flags=1008843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST,LOWER_UP> metric 0 mtu 1500
        options=0
        ether ....
        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: re0 flags=143<LEARNING,DISCOVER,AUTOEDGE,AUTOPTP>
                ifmaxaddr 0 port 1 priority 128 path cost 20000
        groups: bridge
        nd6 options=9<PERFORMNUD,IFDISABLED>
tap0: flags=8902<BROADCAST,PROMISC,SIMPLEX,MULTICAST> metric 0 mtu 1500
        options=80000<LINKSTATE>
        ether ....
        groups: tap
        media: Ethernet 1000baseT <full-duplex>
        status: no carrier
        nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>

FreeBSD 14.0-RELEASE-p3 #0: Mon Dec 11 04:56:01 UTC 2023 root@amd64-builder.daemonology.net:/usr/obj/usr/src/amd64.amd64/sys/GENERIC amd64

I checked on another machine, same result.
 
Gave up with the handbook sample.
Tried vm-bhyve. On my Celeron J4005 got "bhyve exited with status 134".

Why?

Then tried an i3, both Debian 12 and Ubuntu 22 bootet with uefi and graphics, but first no network, dhcp failed.

Code:
 vm switch add public em0
/usr/local/sbin/vm: ERROR: failed to add member em0 to the virtual switch public

There was still the bridge0 from the handbook sample. After destroying it, I could install Debian with network.

But running the installed image with vm start debian12
there is
Code:
BdsDxe: failed to load Boot0001 "UEFI Misc Device" from PciRoot(0x0)/Pci(0x4,0x0): Not Found

>>Start PXE over IPv4.

Enough adventures for today.
 
Removed all old bridge and tap devices on the Celeron, recreated the vm_bhyve image definitions from scratch.
Now a Debian and a FreeBSD guest work there, too.
 
Use uefi_vars=yes in the VM config file before debian installation and all will be good. No need to rename or move the debian loader.
Thanks, I'll try that next time.

bhyve with vm_bhyve is really great, but I didn't find yet a tutorial that covers everything.
And there are too many traps, the biggest is following the handbook.
 
The biggest threat is to not understand what you do. When you use software like vm-bhyve, you can see quickly what bhyve offers and that's good because we can't spend days just to test something. There is so much more to experiment on FreeBSD but also with others OSes.

Once you get pleased with that, it might be worth to use bhyve without any wrappers.
 
Last edited:
I have a little page on bhyve--goes through some of the issues I've run into with various forms of Linux. As has been said, if you want a GUI, you need to use uefi boot. Another moderately recent issue is that if you don't comment out the xhci_mouse="yes" line in the config. (I usually use a centOS7 template if running a GUI Linux.) However, I've not had that mouse issue with RHEL9 and clones.

To spam my own page, it's at https://srobb.net/vm-bhyve.html, it covers a little more than the github page does and points out some outdated stuff--for example, the default OpenBSD template is using grub I think but you can now use uefi.
 
Back
Top