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

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

Closed
djwhatle opened this issue Feb 25, 2021 · 54 comments

Comments

@djwhatle
Copy link

djwhatle commented Feb 25, 2021

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

@scubachristopher
Copy link

Same issue, same hardware.

@F4zii
Copy link

F4zii commented Feb 25, 2021

Same here, can also confirm this happens on other arm64 virtual machines

@djwhatle
Copy link
Author

djwhatle commented Feb 25, 2021

@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

@scubachristopher
Copy link

@djwhatle -- you're the man!

@Vishram1123
Copy link

...or you can spam esc on boot to go into the boot manager and choose QEMU USB� Harddisk

@F4zii
Copy link

F4zii commented Feb 25, 2021

Nice! that works, but now im just stuck at this screen
image

@osy
Copy link
Contributor

osy commented Feb 25, 2021

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?

@djwhatle
Copy link
Author

djwhatle commented Feb 25, 2021

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.

I was able to get to install by doing this and pressing esc at startup + using boot manager. I also got there with virtio though, so no difference in that respect.

Unfortunately NVMe gives this error at install time, virtio doesn't have the same problem.
image

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

Yes, failing to boot from ISO unless you manually select the USB drive for boot through boot manager. Even doing that, the Ubuntu image worked, but Fedora 33 still wouldn't boot.

For some reason after I got Ubuntu installed finally (by following these steps), default network connection wasn't working. I tried to swap it out for an intel network adapter but that triggered failure to start the VM.

@djwhatle
Copy link
Author

djwhatle commented Feb 25, 2021

Nice! that works, but now im just stuck at this screen

I got past this screen by waiting a few seconds, but YMMV.

@djwhatle
Copy link
Author

djwhatle commented Feb 25, 2021

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)

@osy
Copy link
Contributor

osy commented Feb 25, 2021

I think the problem is at some point I updated the OVMF to a newer version that broke support for -boot order=d argument. Or -boot order=d never worked in OVMF and we got lucky before in an older version of QEMU which happened to make the USB disk drive default. Either way I'll have to update the arguments to use bootindex directly which should be more stable.

@osy osy closed this as completed in 1a29912 Feb 26, 2021
osy added a commit that referenced this issue Feb 26, 2021
osy added a commit that referenced this issue Feb 26, 2021
@osy osy reopened this Feb 26, 2021
@osy
Copy link
Contributor

osy commented Feb 26, 2021

Reopening because after testing on a M1 mac, the error persists even after the fix. Even weirder, I went back to 2.0.15, which was used to create the guide and I'm now getting the same error there as well! But on Intel Macs, there's no issue. On M1 Mac with force emulation, it's still broken!

Even weirder, I go into EFI shell and use bcfg boot dump and see that on Intel Macs, I see both the virtio and usb devices in the right order. On M1 Macs, the usb device is missing. I honestly don't know what's going on... As bizarre as it sounds, I have to guess that macOS 11.1 or newer had something that broke this even though it's something within the emulator...

Does anyone have a M1 mac running macOS 11.0? That's the version I was on when the guide was created.

@osy
Copy link
Contributor

osy commented Feb 26, 2021

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.

@conath
Copy link
Contributor

conath commented Mar 2, 2021

I am able to boot an aarch64 VM from a USB CD drive on my iPad Pro, however I am using a custom compiled OVMF EFI. I've attached it here. The files are named "High Res" because I modified the resolutions available in the OVMF configuration to include up to 5K.
OVMF High Res.zip
To use this EFI image as your VM's firmware, attach the …EFI file as first disk, …VARS file as second disk. Set both interfaces to pflash/ PC System Flash.

EDIT: Other than the resolutions array, I didn't touch the OVMF code. It's from the stable branch. EDIT 2: it's up to 5K.

@osy
Copy link
Contributor

osy commented Mar 23, 2021

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.

utmapp/edk2@bca86ec

@osy osy closed this as completed in 808c731 Mar 23, 2021
@osy
Copy link
Contributor

osy commented Apr 7, 2021

This issue isn’t about network?

@labcerouno
Copy link

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?

It's happened to me after installing. I changed from VirtIO to NVMe and it worked!

@podfeet
Copy link

podfeet commented Jun 30, 2021

Hi - followed the instructions in the troubleshooting section and when I enter fs0:\efi\boot\bootaa64.efi into the UEFI Interactive Shell (and the mapping table says SF0: Alia(s) :CD0D0A::blk1:), the Shell responds with Command Error Status: Unsupported.

M1 Mac mini running macOS Big Sur 11.4, and pointing to the Ubuntu Server download from the support article at https://mac.getutm.app/gallery/ubuntu-20-04

What am I missing?

@hva314
Copy link

hva314 commented Jul 4, 2021

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)

@conath
Copy link
Contributor

conath commented Jul 4, 2021

Thanks @hva314 for this solution, however just to make sure: are you using the ARM version of Kali or the x86_64 version? The ARM bootloader file is bootaa64.efi, not grubx64.efi.

@podfeet
Copy link

podfeet commented Jul 4, 2021

Hi - followed the instructions in the troubleshooting section and when I enter fs0:\efi\boot\bootaa64.efi into the UEFI Interactive Shell (and the mapping table says SF0: Alia(s) :CD0D0A::blk1:), the Shell responds with Command Error Status: Unsupported.

M1 Mac mini running macOS Big Sur 11.4, and pointing to the Ubuntu Server download from the support article at https://mac.getutm.app/gallery/ubuntu-20-04

What am I missing?

I went through the installation process from scratch for what I think is the third time, and this time did not get dumped into UEFI Interactive Shell, and it proceeded to function properly. Wish I could identify what I did differently, but I can't.

@conath
Copy link
Contributor

conath commented Jul 4, 2021

Hi - followed the instructions in the troubleshooting section and when I enter fs0:\efi\boot\bootaa64.efi into the UEFI Interactive Shell (and the mapping table says SF0: Alia(s) :CD0D0A::blk1:), the Shell responds with Command Error Status: Unsupported.
M1 Mac mini running macOS Big Sur 11.4, and pointing to the Ubuntu Server download from the support article at https://mac.getutm.app/gallery/ubuntu-20-04
What am I missing?

I went through the installation process from scratch for what I think is the third time, and this time did not get dumped into UEFI Interactive Shell, and it proceeded to function properly. Wish I could identify what I did differently, but I can't.

Does it continue to work after you’ve shut it down once? (Close the VM window and start it again with the Play button)
That’s usually when the auto-boot breaks, if it is dependent on EFI NVRAM variables.

@podfeet
Copy link

podfeet commented Jul 4, 2021

Does it continue to work after you’ve shut it down once? (Close the VM window and start it again with the Play button)
That’s usually when the auto-boot breaks, if it is dependent on EFI NVRAM variables.

Yes, it works consistently after shutdown.

@steezeburger
Copy link

steezeburger commented Aug 20, 2021

@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.

@DHEERAJ-JR
Copy link

@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

GOD!!

@tiagovalePT
Copy link

I'm trying to do this on my MB Pro with a M1 pro and i can't manage to do it. Every time i click on the file to boot it simply opens a black screen and instantly comes back to the menu. Is anyone having the same error?

@tmusername
Copy link

tmusername commented Nov 10, 2021

I think I am having the same error, @tiagovalePT . To clarify: I'm getting into the boot manager and select the 'USB' option, I get a lightening quick flash of black screen and then the boot manager again.

I'm guessing it's the problem that @osy mentioned and linked to a solution. I'm too much of a newb to understand how to execute that code in this context. Can anybody please clarify if the one-second delay is a viable path?

I am attempting to install Ubuntu. When I get to the shell, I'm seeing a mapping table, and FS0 is there, as the instructions I'm following say to look for. I have tried to run the following commands from the shell:

  • fs0:\efi\boot\bootaa64.efi
  • fs0:\efi\boot\BOOTx64.EFI
  • fs0:\efi\boot\bootx64.efi
  • fs0:\efi\boot\grubx64.efi

all of which result in a message saying that it is they are not recognized as an internal or external command, operable file, or script file.

It's just occurring to me it have something to do with incorrect permission settings on the host? I'll investigate and update if I solve it, but any help on here (on this already-closed thread - mea culpa. Please redirect me if there was a more appropriate place for this) would be appreciated.

@richlife98
Copy link

@djwhatle

I met a similar issue and fail to install Ubuntu20.04 in a VM/KVM on Raspberry Pi 3. I plan to install Ubuntu 20.04 Server in KVM on Raspberry Pi3. I follow the instructions and video but the issue can't be resolved. Besides, there is no FS0.

##Can't start the Ubuntu installation process

ubuntu20.04.on.QEMU_KVM.2021-11-19.12-10-00.mp4

1

2

Here are the conditions and environment:

  1. HW: Raspberry Pi 3 with Ubuntu 20.04 Server OS
  2. OS iso installed in KVM: ubuntu-20.04.3-live-server-arm64.iso

Does anyone meet the same issue?? how to fix it??

Thanks for help very much

@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

@bablf
Copy link

bablf commented Dec 15, 2021

Does anyone meet the same issue?? how to fix it??

Same issue here

@hedeesaa
Copy link

@richlife98
I'm facing the same problem here, did you've found the solution?

@tmusername
Copy link

tmusername commented Jan 6, 2022

In case it's helpful to anyone else: I had mistakenly been trying to use the wrong iso. I was trying to install the AMD version of Ubuntu when it's the ARM version that's required. A silly mistake, but thankfully an easy one to correct.

@bablf
Copy link

bablf commented Jan 6, 2022

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.

@ShilvySusan
Copy link

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

@tinywolf3
Copy link

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

I have same problem.

@readable-ko
Copy link

@ShilvySusan @tinywolf3
I was having the same problem in my case, but after about 5 minutes i got out from that screen and its working well.

@3intermute
Copy link

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 ?

@UriZafrir
Copy link

I suggest a permanent fix in #4002

@August90dd
Copy link

I suggest a permanent fix in #4002

This is work for me! see more: https://linuxhint.com/use-uefi-interactive-shell-and-its-common-commands/

@simonhuwiler
Copy link

simonhuwiler commented Jul 26, 2022

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. From one of the other day, all VMs (Ubuntu 20.04 on Mac M1) stopped working. They run properly on console mode, but not on Full Graphics. Did not update mac nor UTM. They stopped working since I tried to launch them while mac was not connected to a docking station.

@valerii-chirkov
Copy link

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.

@Welin-Chen
Copy link

Welin-Chen commented Sep 4, 2022

I spent 4 hrs for try to solve this problem.
Finally I success!
I use wrong Ubuntu install iso file, apple m1 ARM need to install another vision
download link as follow:
m1 download
hope can help you guys!

@All3yp
Copy link

All3yp commented Oct 4, 2022

Anyone have this other problem? I do not have a fs0
Captura de Tela 2022-10-04 às 19 48 38

@SimonCK666
Copy link

Nice! that works, but now im just stuck at this screen image

Hi,

I also met this problem. AND STUCK ON THIS PAGE.
Do you have any suggestions for solving this?

Best

@KACHII-a
Copy link

UTM I was able to install on my new MacBook M1 pro, but ultimately it comes down to this screen

And I am unable to exit from it since it does not recognize my Keyboard or trackpad.

Any help please?

Hi, were you able to get past this? I'm having the same problem

@akbarjon2000
Copy link

I am fed up facing problems in Mac. I also have the same problem!!!

@Welin-Chen
Copy link

have you try use the install file as follow?
download link as follow:
m1 download

@Welin-Chen
Copy link

install m1 download

@Woodo-VIRNECT
Copy link

I solved the issue with downloading Ubuntu Server 20.04

  1. https://cdimage.ubuntu.com/releases/20.04/release/
  2. download iso file : ubuntu-20.04.5-live-server-arm64.iso

@wscgogogo
Copy link

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"'

  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.

@wscgogogo
Copy link

in first step,xml like
image

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