bhyve Bhyve with Bios Boot

Afternoon,

I'm trying to get Haiku to run in Bhyve. While the installation goes great and I can get its UEFI bootloader up, the bootloader doesn't like something about the installed system and won't run it. FreeBSD 12.2, Haiku R1 B2.

While I realize this is not FreeBSD's fault, I was wondering if there was a way to just bypass the UEFI part and just BIOS boot an OS on Bhyve. Haiku on Qemu works great this way, but Bhyve is a faster, native solution and I'd prefer that. If anyone knows what option I can use to accomplish this, it would be greatly appreciated.

Current command is:
sh vmrun.sh -T -c 4 -m 12000M -t tap0 -E -d /dev/zvol/zroot/HaikuDisk0p1 Haiku

And also:
sudo bhyve -AHP -s 0:0,hostbridge -s 31:0,lpc -s 2:0,virtio-net,tap1 -s 3:0,virtio-blk,/dev/zvol/zroot/HaikuDisk0 -c 4 -m 12000M -s 29,fbuf,tcp=0.0.0.0:5900,w=1920,h=1080,wait -s 30,xhci,tablet -l bootrom,/usr/local/share/uefi-firmware/BHYVE_UEFI.fd Haiku
 
Last edited by a moderator:
bhyveload(8) is used for legacy bios. It is also needed for 32-bit VM's As we have no 32bit UEFI BIOS support.

My advice is drop the script (vmrun.sh) and do it manually. Just like you showed.

Here is my example 32-bit VM
Code:
bhyveload -S -m 4G -c /dev/nmdm0A -d /vm/freebsd/freebsd-i386a.img freebsd-i386a
bhyve -S -c 8 -m 4G -AHP -s 0:0,hostbridge -s 1:0,lpc -s 5:0,ahci-hd,/vm/freebsd/freebsd-i386a.img -s 7:0,passthru,15/0/0 -l com1,/dev/nmdm0A freebsd-i386a

Once you get your two commands right you can put them in /etc/rc.local for auto startup on boot.
Just add some 'sleep 10' statements to let bhyveload complete before starting bhyve.

Bhyve Wiki has a bhyveload example too.
 
bhyveload has nothing to do with BIOS. As detailed in the man page you linked to, it is for loading a FreeBSD guest.

The UEFI firmware used to have a CSM version that included the BIOS compatibility features of UEFI. I've used this once to load SmartOS (IIRC), but that was carefully following instructions provided by bhyve developers and I've never had much luck getting anything else running.

When you say you have got the UEFI bootloader up, have you followed the instructions on their website to correctly create the EFI partition and put BOOTX64.EFI on it?
 
I decided to have a go myself and see if it would run, and found the following -

The installer seems to boot fine although I get a VNC error every time it starts up (looks like it wants to modify the VNC terminal resolution) and I have to restart my VNC client (TightVNC).

I following the instructions at https://www.haiku-os.org/guides/uefi_booting/ to create an EFI & BeFS partition, formatted both and completed the installation.
After this I mounted the new EFI partition and created the relevant directories. At this point I got a bit stuck as it simply tells you to "copy BOOTX64.EFI from the install CD", but DiskSetup would not let me mount this partition. Eventually I found an option in one of the main menus to mount this and got the bootcode copied to the hard drive.

At this point I rebooted and, while I did get a Haiku boot screen from the UEFI bootloader, it just told me there was no system to boot.

I then for some reason decided to try nvme for the disk instead of virtio-blk and it started up fine.
So try replacing virtio-blk with nvme.
 
bhyveload has nothing to do with BIOS. As detailed in the man page you linked to, it is for loading a FreeBSD guest.
Well I read it as he wanted to boot something other than UEFI and legacy bios mode is all I know of except grub2.
But you are correct. bhyveload is only for booting FreeBSD in legacy bios mode.
Sorry for the noise. Haiku would obviously not boot from bhyveload. My bad.
 
I should’ve followed up on this last week — I ended up successfully getting the EFI partition loaded because it turned out the EFI boot loader is very much a work in progress for Haiku. An update in one of the nightly releases fixed it. That said, I’m definitely trying this again... As soon as I can get FreeBSD 13 to boot...
 
Back
Top