Last active
August 26, 2021 10:01
-
-
Save shanduur/85df6c93e38e5689ecfde4bd304c0ca2 to your computer and use it in GitHub Desktop.
VM on Raspberry Pi 3
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export CLANG_VERSION="CLANG38" | |
export UBUNTU_RELEASE="focal" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
. config.env | |
LINARO_TIANOCORE_IMAGE="http://snapshots.linaro.org/components/kernel/leg-virt-tianocore-edk2-upstream/latest/QEMU-AARCH64/RELEASE_$CLANG_VERSION/QEMU_EFI.fd" | |
UBUNTU_CLOUD_IMAGE="https://cloud-images.ubuntu.com/$UBUNTU_RELEASE/current/$UBUNTU_RELEASE-server-cloudimg-arm64.img" | |
wget -c $LINARO_TIANOCORE_IMAGE | |
wget -c $UBUNTU_CLOUD_IMAGE | |
qemu-img create -f qcow2 -b $UBUNTU_RELEASE-server-cloudimg-arm64.img $UBUNTU_RELEASE-image-01.img | |
{ echo instance-id: kvm-$UBUNTU_RELEASE-01; echo local-hostname: kvm-$UBUNTU_RELEASE; } > meta-data | |
printf "#cloud-config\npassword: passw0rd\nchpasswd: { expire: False }\nssh_pwauth: True\n" > user-data | |
genisoimage -V cidata -J -r -o seed-kvm-$UBUNTU_RELEASE-01.iso user-data meta-data |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
. config.env | |
qemu-system-aarch64 \ | |
-M virt \ | |
-cpu host \ | |
-smp 2 \ | |
-m 384M \ | |
-nographic \ | |
-bios QEMU_EFI.fd \ | |
-cdrom seed-kvm-$UBUNTU_RELEASE-01.iso \ | |
-drive if=none,file=$UBUNTU_RELEASE-image-01.img,id=hd0 \ | |
-device virtio-blk-device,drive=hd0 \ | |
-device virtio-net-device,netdev=vmnic \ | |
-netdev user,id=vmnic,hostfwd=tcp::5555-:22 \ | |
-accel kvm \ | |
2> output.log |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment