Skip to content

Instantly share code, notes, and snippets.

@ayufan
Last active July 6, 2017 11:05
Show Gist options
  • Save ayufan/753dab770b90cce2a26e9de093936954 to your computer and use it in GitHub Desktop.
Save ayufan/753dab770b90cce2a26e9de093936954 to your computer and use it in GitHub Desktop.
Run KVM machine on AARCH64
set -xe
dd if=/dev/zero of=flash0.img bs=1M count=64
dd if=/usr/share/qemu-efi/QEMU_EFI.fd of=flash0.img conv=notrunc
dd if=/dev/zero of=flash1.img bs=1M count=64
wget -c http://ftp.ubuntu-tw.net/ubuntu-cloud-images/xenial/current/xenial-server-cloudimg-arm64-uefi1.img
sudo apt-get install qemu-system-arm qemu-efi
sudo qemu-system-aarch64 -enable-kvm -m 1024 -cpu host -M virt -nographic -pflash flash0.img -pflash flash1.img -drive if=none,file=xenial-server-cloudimg-arm64-uefi1.img,id=hd0 -device virtio-blk-device,drive=hd0 -netdev type=tap,id=net0 -device virtio-net-device,netdev=net0,mac=00:01:02:03:04:05
@ayufan
Copy link
Author

ayufan commented Jul 6, 2017

To execute:

bash -c "$(curl https://gist.githubusercontent.com/ayufan/753dab770b90cce2a26e9de093936954/raw/b1056d43cc41aa64f277e7febbaf886d569f4ede/qemu-arm64.bash)"

@ayufan
Copy link
Author

ayufan commented Jul 6, 2017

It requires arm64 base system.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment