#!/bin/bash # Please ensure the following packages are installed on host: # qemu-arm qemu-img qemu-uefi-aarch64 # Update options if needed: HDDIMAGE="opensuse-Tumbleweed-aarch64-20190605-gnome@aarch64.qcow2" # ISOFILE="openSUSE-Tumbleweed-DVD-aarch64-Snapshot20190605-Media.iso" # Create an empty HDD of 40G if needed # [ -e $HDDIMAGE ] || /usr/bin/qemu-img create -f qcow2 $HDDIMAGE 40G # Setup BIOS if needed [ -e pflash-code-overlay0 ] || /usr/bin/qemu-img create -f qcow2 -b /usr/share/qemu/aavmf-aarch64-code.bin pflash-code-overlay0 # [ -e pflash-vars-overlay0 ] || /usr/bin/qemu-img create -f qcow2 -b /usr/share/qemu/aavmf-aarch64-vars.bin pflash-vars-overlay0 [ -e pflash-vars-overlay0 ] || /usr/bin/qemu-img create -f qcow2 -b opensuse-Tumbleweed-aarch64-20190605-gnome@aarch64-uefi-vars.qcow2 pflash-vars-overlay0 # Launch qemu /usr/bin/qemu-system-aarch64 \ "-serial" \ "file:serial0" \ "-soundhw" \ "ac97" \ "-device" \ "virtio-gpu-pci" \ "-m" \ "2048" \ "-machine" \ "virt,gic-version=host" \ "-cpu" \ "host" \ "-netdev" \ "user,id=qanet0" \ "-device" \ "virtio-net,netdev=qanet0,mac=52:54:00:12:34:56" \ "-device" \ "virtio-scsi-pci,id=scsi0" \ "-device" \ "virtio-blk-device,drive=hd1,serial=1" \ "-drive" \ "file=$HDDIMAGE,cache=unsafe,if=none,id=hd1,format=qcow2,discard=on" \ "-drive" \ "id=pflash-code-overlay0,if=pflash,file=pflash-code-overlay0,unit=0,readonly=on" \ "-drive" \ "id=pflash-vars-overlay0,if=pflash,file=pflash-vars-overlay0,unit=1" \ "-device" \ "nec-usb-xhci" \ "-device" \ "usb-tablet" \ "-device" \ "usb-kbd" \ "-smp" \ "2" \ "-enable-kvm" \ "$@"