bhyve Debian 12 won't boot in UEFI mode in Bhyve

I am creating this topic as a continuation of the bug issue - https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=278984

Hi.
If you install Debian 12 on bhyve from an iso image in UEFI mode, you will notice that the grub boot loader will not be found.

To fix this you need to do the following:
mkdir /boot/efi/EFI/BOOT/
# copy file - workaround for bhyve grub package #
# Pay attention to destination file bootx64.efi #
cp /boot/efi/EFI/debian/grubx64.efi /boot/efi/EFI/BOOT/bootx64.efi

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

I suggest fixing bhyve so that it tries to load not only /boot/efi/EFI/BOOT/bootx64.efi, but also /boot/efi/EFI/debian/grubx64.efi.
 
https://ibb.co/c8cx9wZ

I'm trying to boot a Debian img file that I've created with qemu and that it boots if I use qemu. I imagine that I should create a new Debian vm from scratch if I want to boot it with bhyve,right ?

https://wiki.freebsd.org/bhyve

Q: Can I use disk images from QEMU, VMware, or other virtualization platforms on bhyve?​


A: bhyve does not currently support reading foreign disk image formats directly, so one will have to convert existing VMDK, QCOW, QCOW2, and VDI disk images to a raw image using qemu-img. This can be accomplished by doing the following on a FreeBSD system:

$ pkg install qemu-tools
$ qemu-img convert -f vmdk -O raw vmware_image.vmdk bhyve_raw_image.raw
 
My notes, not sure where from but: Debian UEFI FIX

1. Enter exit get out of the UEFI Shell (you will come to BHYVE panel)
2. Choose Boot Maintenance Manager
3. (In the Boot Maintenance Manager ) Choose Boot From File
4. (In File Explorer) NO VOLUME LABEL, [PciRoot(0x0)/ Pci()] press Enter
5. (Still in the File Explorer) Choose <EFI>
6. (Still in the File Explorer) Choose debian
7. (Still in the File Explorer) Choose grubx64.efi
8. Then you will get into the system

How can you fix it:
1) Get access inside your Debian Guest VM.
2) as root: cd /boot/efi/
3) mkdir -p EFI/BOOT
4) cp EFI/debian/grubx64.efi EFI/BOOT/bootx64.efi
5) reboot
 
Back
Top