Subject: Using aarch64 ISO with QEMU

From: Peter Hanzel <[email-masked]>
Date: Thu, 2 Jan 2020 14:50:27 +0100

Hello.

I have downloaded aarch64 ISO for virtual. I want to run it inside QEMU.
I have added edk2 as flash (UEFI). It boots to GRUB but then it fails
to run Linux virt. Has anybody qemu command line to run aarch64 alpine
ISO.
I don't want to extract kernel and initrd and run it this way. I want
to try it to boot as UEFI. I used -cdrom parameter for qemu but for
grub inside QEMU it appears as disk with 3 parts: gap1, msdos1 and
gap2 and grub cannot read them from grub command line. (ls (hd0,gpt1)/
shows unknown file system).

Thanks for any hint I could try.

---

From: PICCORO McKAY Lenz <[email-masked]>
Date: Thu, 2 Jan 2020 05:22:12 -0400

> shows unknown file system).

that message indicates the image cannot be boot from UEFI bios gpt partition

---

From: Paul Zillmann <[email-masked]>
Date: Fri, 3 Jan 2020 09:52:03 +0100

Hello Peter,

do you use the GRUB inside the ISO or any other GRUB?
On the ISO you are looking to boot /efi/boot/bootaa64.efi - this should 
be the GRUB on the ISO with the right configuration file.

I don't think you will be able to access an ISOHYBRID with gpt nor hd0.

- Paul

---

From: Peter Hanzel <[email-masked]>
Date: Fri, 3 Jan 2020 12:25:09 +0100

Hello.

I have used original aarch64 ISO from
http://dl-cdn.alpinelinux.org/alpine/v3.11/releases/aarch64/alpine-virt-3.11.2-aarch64.iso
I use QEMU 4.1.0 on windows. I use edk2-aarch64-code.fd as UEFI
bios.and arrch64 ISO as -cdrom.
It normally boots UEFI and then starts GRUB from above ISO. It
contains only "Linux virt" menuitem and after I press enter on it it
fails to start linux. There are some messages but it quickly returns
to GRUB menu, so I can't read it. Then I used grub command line to try
to set root and kernel manually, but it fails to read partitions from
ISO.

So that's the steps I have tried.

---

From: Peter Hanzel <[email-masked]>
Date: Fri, 3 Jan 2020 13:32:51 +0100

Hello again.

I have made progress. It looks like efi_vars was missing. I added
empty 64MB img file as second pflash and then it booted to console
line.
My qemu cmd line looks like:
qemu-system-aarch64.exe -M virt -m 1G -cpu cortex-a57 -pflash
edk2-aarch64-code.fd -pflash efi_vars.img -cdrom
alpine-virt-3.11.2-aarch64.iso -vga none -device
virtio-gpu-pci,xres=800,yres=600 -net nic,model=virtio -net
user,hostfwd=tcp::2222-:22 -device usb-ehci,id=ehci -device
usb-tablet,bus=ehci.0
.
Then I can successfully login on serial console. Other problem is that
on graphic console (virtio-gpu-pci) the keyboard is not working
eventhough I have added usb-tablet. But that's another story. I was
not able to get keyboard and mouse with virtio-gpu-pci on any
distribution I have tried. Maybe some qemu command line parameter is
missing.

So now I can boot and ISO is working.

---

From: PICCORO McKAY Lenz <[email-masked]>
Date: Fri, 3 Jan 2020 07:41:26 -0400

Use qemu on right OS like linux and said good bye to problems..

Lenz McKAY Gerardo (PICCORO)
http://qgqlochekone.blogspot.com