From df90539b9e7ee75c206d5b77d4f1b94882d090c7 Mon Sep 17 00:00:00 2001 From: Louis Burda Date: Wed, 1 Feb 2023 16:57:26 -0600 Subject: Add guest provisioning scripts and instructions --- qemu/install.sh | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100755 qemu/install.sh (limited to 'qemu/install.sh') diff --git a/qemu/install.sh b/qemu/install.sh new file mode 100755 index 0000000..a3740cc --- /dev/null +++ b/qemu/install.sh @@ -0,0 +1,31 @@ +#!/bin/sh + +set -ex + +gitroot=$(git rev-parse --show-toplevel) +cd "$gitroot/qemu" + +DISK="debian11.qcow2" +DEBIANISO="debian-11.4.0-amd64-DVD-1.iso" + +if [ ! -e "$DISK" ]; then + echo "Creating guest disk.." + qemu-img create -f qcow2 "$DISK" 20G +fi + +if [ ! -e "$DEBIANISO" ]; then + echo "Downloading debian DVD image.." + wget "https://cdimage.debian.org/mirror/cdimage/archive/11.4.0/amd64/iso-dvd/debian-11.4.0-amd64-DVD-1.iso" -O "$DEBIANISO" +fi + +sudo LIBVIRT_DEBUG=1 virsh net-start default 2>&1 | grep -i warning || true + +sudo PREFIX="$gitroot/AMDSEV" "$gitroot/AMDSEV/launch-qemu.sh" \ + -hda "$DISK" \ + -console serial \ + -vnc 1 \ + -mem 2024 \ + -smp 1,cores=4,threads=2 \ + -allow-debug \ + -cdrom "$DEBIANISO" + -- cgit v1.2.3-71-gd317