Goal
I'd like to emulate the boot process (any boot process) in AArch64 (ARM64) on the actual, real, AArch64 hardware as I'm working on a bootloader and an emulation workflow is much faster.
Problem
Every attempt to use QEMU results in a blank screen. I have tried running bootloaders, and tried to boot Linux directly. There are no error messages.
Various Attempts
First attempt:
# sudo apt-get install qemu qemu-system-arm qemu-efi-aarch64 qemu-utils qemu-system-aarch64 -nographic -machine virt,gic-version=3 -m 512M -smp 4 some-aarch64-linux.iso # Blank screen. Press ctrl+a c to exit. Second attempt:
# Create an EFI bootloader dd if=/dev/zero of=flash0.img bs=1M count=64 dd if=/usr/share/qemu-efi-aarch64/QEMU_EFI.fd of=flash0.img conv=notrunc qemu-system-aarch64 -nographic -machine virt,gic-version=3 -m 512M -smp 4 \ -drive file=flash0.img,format=raw,if=pflash # Blank screen. Press ctrl+a c to exit. Third attempt:
qemu-img create -f qcow2 alpine.img 8G wget -O alpine-virt.iso http://dl-cdn.alpinelinux.org/alpine/v3.12/releases/aarch64/alpine-virt-3.12.1-aarch64.iso sudo kvm -machine virt -hda alpine.img -cdrom alpine-virt.iso -m 512 > KVM is not supported for this guest CPU type > kvm_init_vcpu failed: Invalid argument Fourth attempt:
qemu-img create -f qcow2 alpine.img 8G wget -O alpine-virt.iso http://dl-cdn.alpinelinux.org/alpine/v3.12/releases/aarch64/alpine-virt-3.12.1-aarch64.iso qemu-system-aarch64 -nographic -machine virt -hda alpine.img -cdrom alpine-virt.iso -m 512 # Blank screen. Press ctrl+a c to exit. Fifth attempt with Docker on an x86-64 machine:
docker run -it --rm --name qemu-container \ -e QEMU_ARCH=aarch64 \ -e QEMU_HDA=/tmp/hda.qcow2 \ -e QEMU_HDA_SIZE=1G \ -e QEMU_CPU=4 \ -e QEMU_RAM=512 \ -v ${PWD}/alpine-virt-3.12.1-aarch64.iso:/tmp/os.iso:ro \ -e QEMU_CDROM=/tmp/os.iso \ -e QEMU_BOOT='order=d' \ -e QEMU_PORTS='2375 2376' \ tianon/qemu start-qemu -machine virt # Results: # + qemu-img create -f qcow2 -o preallocation=off /tmp/hda.qcow2 1G # Formatting '/tmp/hda.qcow2', fmt=qcow2 cluster_size=65536 preallocation=off compression_type=zlib size=1073741824 lazy_refcounts=off refcount_bits=16 # + exec qemu-system-aarch64 -smp 4 -m 512 -drive file=/tmp/hda.qcow2,index=0,media=disk,discard=unmap,detect-zeroes=unmap,if=none,id=hda -device virtio-scsi-pci -device scsi-hd,drive=hda -cdrom /tmp/os.iso -boot order=d -netdev user,hostname=30047d3b64c0,hostfwd=tcp::22-:22,hostfwd=udp::22-:22,hostfwd=tcp::2375-:2375,hostfwd=udp::2375-:2375,hostfwd=tcp::2376-:2376,hostfwd=udp::2376-:2376,id=net -device virtio-net-pci,netdev=net -serial stdio -vnc :0 # Frozen. Press ctrl+c to send a signal Prior Research:
- Qemu and AARCH64 (SO used inappropriate command)
- QEMU AArch64 Seems to Hang with no Log Messages (SO used inappropriate architecture)
- https://linuxhint.com/install_qemu_debian/ (same blank screen)
- https://futurewei-cloud.github.io/ARM-Datacenter/qemu/how-to-launch-aarch64-vm/ (same blank screen)