UTM: Ubuntu 20 AArch64 image from gallery can't boot on Apple M1 "BdsDxe: failed to load Boot0001"

I figured out a workaround, see below

Describe the issue Followed directions from gallery to install Ubuntu 20 AArch64. Resulted in this error:

(Note, I had same result trying to install Fedora 33 AArch64 in the same way)

BdsDxe: failed to load Boot0001 "UEFI misc device" [...]

image

Eventually goes to this screen

image

Configuration

  • UTM Version: v2.0.22 (have also tested v2.0.21, v2.0.15, same result)
  • OS Version: macOS 11.1 (since upgraded to 11.2.1, same result)
  • Intel or Apple Silicon? Apple M1 (Air, 16GB RAM)

Crash log N/A

Debug log debug.log

Upload VM config.plist.txt

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 15
  • Comments: 54 (9 by maintainers)

Commits related to this issue

Most upvoted comments

@scubachristopher @F4zii I was able to overcome this issue by:

  1. Disabling the network adapter temporarily to remove the step of waiting for PXE boot timeout (not sure about this step, seems I don’t have internet connectivity after install even when adding network adapter later)
  2. Typing exit at the UEFI shell and then navigating to the USB boot device manually

See attached video for the sequence that worked for me.

https://user-images.githubusercontent.com/7576968/109203157-d1373c80-7771-11eb-91aa-d8dc24969b66.mov

I was able to debug the failure by logging from EDK2. There is a race condition in QEMU’s (emulated) USB device reset and OVMF enumerating the boot options. M1 macs are too fast and can enumerate the boot options before QEMU sets up the device. This race condition is why it occurs for some people and not others and also why it stops appearing if you enable debug logging.

Without thinking too hard how to prevent the race, the hack around is to have a 1 second wait between the device enumeration and boot option enumeration.

https://github.com/utmapp/edk2/commit/bca86ecf2e1124c8a931b0dbfc276c7280df35c7

@scubachristopher @F4zii I was able to overcome this issue by:

  1. Disabling the network adapter temporarily to remove the step of waiting for PXE boot timeout (not sure about this step, seems I don’t have internet connectivity after install even when adding network adapter later)
  2. Typing exit at the UEFI shell and then navigating to the USB boot device manually

See attached video for the sequence that worked for me.

successful_boot.mov

Tried the same but the screen pops and closes within a second not sure whats the issue

I updated the guide for a workaround: https://mac.getutm.app/gallery/ubuntu-20-04#troubleshooting

In the meantime I will continue to investigate why the emulated USB disk drive is not seen as a boot device on ARM64 builds of QEMU.

I ran into the same issue when installing Kali Linux on host Macbook M1, Big Sur.

Apparently, boot sequence was looking for the missing file startup.nsh.

At EFI cli, you can type fs0:\efi\[your_OS]\grubx64.efi to boot. You can use tab completion to figure out the directory. In my case: fs0:\efi\kali\grubx64.efi.

When on the OS, hope onto root and create the file startup.nsh manually. echo '\EFI\kali\grubx64.efi' > /boot/efi/EFI/kali/startup.nsh"(change the name accordingly)

Hi all,

I am getting the same issue as the header. Please let me know, if there is a fix other than the previous comments in this loop. Please see the attached picture of error.

Screenshot 2022-03-11 at 18 49 02

same problem here, ive tried waiting but it doesnt get past this screen it was working for a while on kernel version 5.04.0-99 but the newer kernel versions > 5.04.0-100 doesnt seem to work i read in a different thread that this could be due to force stopping the VM causes drive corruption maybe ?

@Henrb Thank you so much! Also, just to expound on your answer, once the vm is booted and you are presented with the Shell>, you can type exit to get back to the menu that shows the Boot Maintenance Manager then Boot from File.

From here you can navigate to kali/grubaa64.efi as mentioned.

In Drives, change the Interface from VirtIO to NVMe. I think there might be a problem in the EFI drivers. I’ll look more into it.

EDIT: oh this is before installing Ubuntu? So it’s failing to boot from the ISO?

I solved this problem on arm architecture.follow this steps,it’s worked for me.

  1. You need to mount iso as usb file,add part like this when you execute ‘virsh edit “virtualmachine”’ <disk type='file' device='cdrom'> <driver name='qemu' type='raw'/> <source file='/data/iso/CentOS-7-aarch64-Minimal-2009.iso'/> <target dev='vdb' bus='usb'/> <readonly/> <address type='usb' bus='0' port='1'/> </disk>
  2. You can try to execute boot manually with command ‘fs0:\efi[osname]\bootaa64.efi’,but usually failed with permission.
  3. You need type exit to use bios,in bios use “Device Manager” -> “Secure Boot” to close secure boot.

I solved the issue with downloading Ubuntu Server 22.04 for ARM, it seems that I either was trying to install amd version or the iso just not compatible for now.

I suggest a permanent fix in #4002

this video helped me resolve the issue. For me the problem was also the wrong iso version. The one linked in the description solved my problem.

Hello, I had the case for the installation of kali linux arm for mac m1 download on download site, you have to go to the uefi settings and manually launch the launch file, launch> echap bios> boot maintenance manager > boot for files, find the file to install on the hard drive in the location “grubaa64.efi” thanks google trad, Regards henrb.

This issue isn’t about network?

So the winning combination for me that resulted in Ubuntu 20 installed with internet working:

  • Follow all instructions in gallery (virtio 👍 )
  • Mash ESC at startup
  • Use boot manager -> USB to boot from ubuntu image.

Seems to be working, also worked for Fedora 33 (was using .xz instead of .iso before)