How to boot linux unde bhyve

I have been struggling with booting Debian 12 under CORE for awhile.
The boot process would get stuck in the UEFI shell and needed a few commands to boot
/boot/efi/EFI/debian/grubx64.efi

Trying to add the location via efibootmgr didn’t work.

Finally I’ve found this:

https://www.cyberciti.biz/faq/how-to-install-linux-vm-on-freebsd-using-bhyve-and-zfs/

with the solution:

# mkdir /target/boot/efi/EFI/BOOT/
# copy file - workaround for bhyve grub package #
# Pay attention to destination file bootx64.efi #
# cp /target/boot/efi/EFI/debian/grubx64.efi /target/boot/efi/EFI/BOOT/bootx64.efi

This is output from efibootmgr after booting:

# efibootmgr -v
BootCurrent: 0001
Timeout: 0 seconds
BootOrder: 0000,0001,0002,0003,0004
Boot0000* UiApp	FvVol(7cb8bdc9-f8eb-4f34-aaea-3ee4af6516a1)/FvFile(462caa21-7614-4503-836e-8ab6f4662331)
Boot0001* UEFI Misc Device	PciRoot(0x0)/Pci(0x3,0x0)N.....YM....R,Y.
Boot0002* UEFI PXEv4 (MAC:00A0983F7283)	PciRoot(0x0)/Pci(0x4,0x0)/MAC(00a0983f7283,1)/IPv4(0.0.0.00.0.0.0,0,0)N.....YM....R,Y.
Boot0003* UEFI HTTPv4 (MAC:00A0983F7283)	PciRoot(0x0)/Pci(0x4,0x0)/MAC(00a0983f7283,1)/IPv4(0.0.0.00.0.0.0,0,0)/Uri()N.....YM....R,Y.
Boot0004* EFI Internal Shell	FvVol(7cb8bdc9-f8eb-4f34-aaea-3ee4af6516a1)/FvFile(7c04a583-9e3e-4f1c-ad65-e05268d0b4d1)

Does bhyve as shipped in TrueNAS Core support EFI variables yet? It did not last time I checked, which was a few years ago. Therefore it was necessary that whatever executable is to be booted be in the default path, with the default name, as the boot order does not persist across VM restarts.

I’ve installed Debian a few months back. Only issue was the resolution, which I corrected. Apart from that, I can’t recall any issues.

Was it Debian 12?

I believe it was 11. I’ll give 12 a try in the next day or so.

This was my experience also. Graphics were garbled until i changed resolution to 1024×768 or 800×600, i don’t remember which (just for installation). Aside from that, there wasnt any other issue.

Uploading now to give it a shot…

I just uploaded debian12 (amd64), changed the resolution to 800x600, and it ran through the graphical installer just fine. Aside from the VNC mouse bug of course.

Did the reboot work? I end up in UEFI shell after a few timeouts from PXE/HTTP boot attempts.

I’ll give that a try later on.

And it failed. Same issue as you.

If you have a test server you could try to update to 13.3 nightly, then give it a try. Lots of bhyve fixes included there.