kubernetes-the-harder-way: Seeing an "Image type X64 can't be loaded on AARCH64 UEFI system" error while following Ch. 1 Guide

I’m following along with 01_Learning_How_to_Run_VMs_with_QEMU.md and I’m at the Running a headless VM step. Everything seems to have worked correctly up until this point. This is the command I’m running:

sudo qemu-system-aarch64 \
    -nographic \
    -machine virt,accel=hvf,highmem=on \
    -cpu host \
    -smp 2 \
    -m 2G \
    -bios /opt/homebrew/share/qemu/edk2-aarch64-code.fd \
    -nic vmnet-shared \
    -hda /opt/homebrew/share/qemu/ubuntu0.img

The error I see is:

UEFI firmware (version edk2-stable202302-for-qemu built at 18:12:10 on Sep 11 2023)
Error: Image at 000BFD42000 start failed: Not Found
Error: Image at 000BFC94000 start failed: Unsupported
Error: Image at 000BFC13000 start failed: Not Found
Tpm2SubmitCommand - Tcg2 - Not Found
Tpm2GetCapabilityPcrs fail!
Tpm2SubmitCommand - Tcg2 - Not Found
Image type X64 can't be loaded on AARCH64 UEFI system.

I’m confused as to why it is trying to load an X64 image. In order to generate ubuntu0.img I followed the two commands above in the guide:

wget https://cloud-images.ubuntu.com/jammy/current/jammy-server-cloudimg-arm64.img
qemu-img create -F qcow2 -b jammy-server-cloudimg-arm64.img -f qcow2 ubuntu0.img 128G

I’ve confirmed that the two images (jammy-server-cloudimg-arm64.img & ubuntu0.img) exist in the /opt/homebrew/share/qemu directory. I ran a qemu-img info on both images and confirmed that they have qcow2 file format. This is the output of qemu-img info ubuntu0.img:

image: ubuntu0.img
file format: qcow2
virtual size: 128 GiB (137438953472 bytes)
disk size: 196 KiB
cluster_size: 65536
backing file: jammy-server-cloudimg-arm64.img
backing file format: qcow2
Format specific information:
    compat: 1.1
    compression type: zlib
    lazy refcounts: false
    refcount bits: 16
    corrupt: false
    extended l2: false
Child node '/file':
    filename: ubuntu0.img
    protocol type: file
    file length: 194 KiB (198656 bytes)
    disk size: 196 KiB

My other suspicion was that there’s an issue with the UEFI step using edk2-aarch64-code.fd, but there were no errors with that up to this point. I’ve confirmed that the flash drive also exists at the same path (/opt/homebrew/share/qemu/).

Any suggestions on what may have gone wrong with my set-up / why an x64 image is being attempted to be loaded?

Note: I believe is the line for the error I’m seeing.

About this issue

  • Original URL
  • State: closed
  • Created 6 months ago
  • Comments: 26 (9 by maintainers)

Most upvoted comments

Yeah, I stumbled on this git repo coincidentally when I had just bought my M2 machine. Getting virtualization working was my priority specifically to support Vagrant. I got VMware Fusion working, and I also set up UTM for some USB passthrough stuff I needed to get access to serial interfaces that don’t have Apple silicon drivers. It really feels like we’re walking the edges of support for a some of open source projects where the details of the ISA really matter.