Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not able to boot Debian (UEFI) #336

Open
solskogen opened this issue Nov 25, 2019 · 13 comments
Open

Not able to boot Debian (UEFI) #336

solskogen opened this issue Nov 25, 2019 · 13 comments

Comments

@solskogen
Copy link

I was able to install it, and the first reboot went well (still running under "vm install ...")
But as soon as I try to start it "vm start..." it's not able to boot with UEFI.

This is my config:
loader=uefi
cpu=8
memory=2G
wired_memory="yes"
network0_type="virtio-net"
network0_switch="public"
disk0_type="ahci-hd"
disk0_name="disk0.img"
graphics="yes"
xhci_mouse="yes"
graphics_res="1024x768"
graphics_wait="yes"
uuid="4440a308-0f66-11ea-99b9-6045cb9a0b3b"
network0_mac="58:9c:fc:02:b6:8c"

@solskogen
Copy link
Author

"BOOT FAILED. EFI Hard drive"

@thebiss
Copy link

thebiss commented Dec 15, 2019

Debian's EFI filename doesn't match what bhyve UEFI expects. The workaround is to rename the file. See https://blog.tkrn.io/freenas-11-boot-failed-efi-misc-device-fix-debian/

@churchers
Copy link
Owner

This sounds like it's related to efi variables. Many Linux distributions don't use the default filename for the EFI filename (for perfectly good reasons), and use EFI variables to store the correct path. Unfortunately bhyve loses this on restart as it doesn't store the efivars anywhere.

Hopefully bhyve will fix this some day. It's been known for at least 18 months.

Peter Grehan - May 04, 2018
That is exactly the issue. The current UEFI code does not save
non-volatile variables to persistent storage. Guest o/s's are
increasingly writing their efi loaders to non-standard locations and
using nv vars to direct UEFI to boot from these locations.

I'm (very slowly) merging a fix from Leon for this in both UEFI and
bhyve which directs nv var writes to a file on the host, providing a
persistent store.

@dMopp
Copy link

dMopp commented Apr 10, 2021

Issue still persists ...

@bluntstone
Copy link

bluntstone commented Dec 31, 2021

Type this in a shell when install is finished and before rebooting. I installed debian bullseye with gnome. Runs great.

mkdir /target/boot/efi/EFI/BOOT/
cp /target/boot/efi/EFI/debian/grubx64.efi /target/boot/efi/EFI/BOOT/bootx64.efi

got it from a howto link below
https://www.cyberciti.biz/faq/how-to-install-linux-vm-on-freebsd-using-bhyve-and-zfs/

copy of my .conf file
loader="uefi"
cpu=8
memory=16G
network0_type="virtio-net"
network0_switch="public"
disk0_type="virtio-blk"
disk0_name="disk0.img"
graphics="yes"
graphics_port="5999"
graphics_res="1920x1200"
graphics_wait="auto"
xhci_mouse="yes"
uuid="f227071d-69e4-11ec-90ec-e0d55e690dc6"
network0_mac="58:9c:fc:02:e3:88"

@driesmp
Copy link
Contributor

driesmp commented Oct 26, 2023

Fixed in #449 with FreeBSD 14

@jhfoo
Copy link

jhfoo commented Dec 20, 2023

Fixed in #449 with FreeBSD 14

Does this mean no additional config required in vm-bhyve to make Debian work?

@driesmp
Copy link
Contributor

driesmp commented Dec 20, 2023

You only need "uefi_vars=yes" in the config file of the vm.

@nunotexbsd
Copy link

Anyone getting debian booting with "uefi_vars"?

@driesmp
Copy link
Contributor

driesmp commented Feb 10, 2024

Yes, do you have 14 release or higher?

@nunotexbsd
Copy link

Got it.

(FreeBSD 15 4594eb454891 / Debian 12.4.0 amd64)

Followed instructions https://npulse.net/en/blog/125-bhyve-uefi-drops-into-efi-shell-linux-wont-boot-easy-workaround

  • Enter Boot Maintenance Manager / Boot From File, using EFI/debian/grubx64.efi
  • Permanent solution:
mkdir /boot/efi/EFI/BOOT
cp /boot/efi/EFI/debian/grubx64.efi /boot/efi/EFI/BOOT/bootx64.efi

Maybe uefi_vars don't fix it right?

@xzenor
Copy link

xzenor commented Feb 10, 2024

uefi_vars works fine. If you can boot your os from the eufi bootmenu then uefi_vars"yes" should just work. But you do need to adjust the UEFI boot settings. Just choosing the right EFI file and booting it won't fix anything.

You need to add the boot option, then the boot order and then you save those settings. Like in a regular bios. uefi_vars="yes" just makes sure those settings are actually saved for the next reboot. If you don't have that then the settings are not saved.

If it doesn't work: FreeBSD 15 is beta software. It's not production ready. ;-)
Honestly though. It probably should work if you just really change the settings.

@nunotexbsd
Copy link

@xzenor

I misunderstood uefi_vars at first.
It's working fine as I created a new boot option pointing to grubx64.efi and save. I removed BOOT/bootx64.efi as I don't need it anymore.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants