Ubuntu Server on qemu-system-aarch64/kvm

Preparation

  1. Linaro QEMU_EFI

  2. Ubuntu Server ISO for AArch64

Installation

  • QEMU running command:

    qemu-system-aarch64 \
        -enable-kvm -cpu host \
        -M virt -bios QEMU_EFI.fd \
        -m 1024 -smp 4 \
        -nographic \
        -drive id=cdrom1,media=cdrom,if=none,file=<ubuntu_install_iso> \
        -device virtio-scsi-device -device scsi-cd,drive=cdrom1 \
        -drive id=hd0,media=disk,if=none,format=qcow2,file=<ubuntu_qcow2_image> \
        -device virtio-blk-device,drive=hd0 \
        -netdev user,id=user -device virtio-net-device,netdev=user
    
    # input:
    #   Ubuntu ISO path
    #   Ubuntu qcow2 path
    
  • Ubuntu installation

boot up issue(UEFI)

Booting up is blocking at EFI menu for arm64 rootfs of ubuntu, debian, and fedora.

2 solutions

  1. execute EFI bootup script in EFI shell EFI\ubuntu\grubaa64.efi

  2. write a EFI script startup.nsh to execute EFI bootup script

EFISTUB path

Running and Usage

  • QEMU running command:

    qemu-system-aarch64 \
        -enable-kvm -cpu host \
        -M virt -bios QEMU_EFI.fd \
        -m 1024 -smp 4 \
        -nographic \
        -drive id=hd0,media=disk,if=none,format=qcow2,file=<ubuntu_qcow2_image> \
        -device virtio-blk-device,drive=hd0 \
        -netdev user,id=user -device virtio-net-device,netdev=user
    
    # input:
    #   Ubuntu qcow2 path
    
  • guest network: dhcp:

    sudo dhclient -v enp0s1