summaryrefslogtreecommitdiffstats
path: root/qemu/launch-victim.sh
diff options
context:
space:
mode:
Diffstat (limited to 'qemu/launch-victim.sh')
-rwxr-xr-xqemu/launch-victim.sh31
1 files changed, 31 insertions, 0 deletions
diff --git a/qemu/launch-victim.sh b/qemu/launch-victim.sh
new file mode 100755
index 0000000..80e84ad
--- /dev/null
+++ b/qemu/launch-victim.sh
@@ -0,0 +1,31 @@
+#!/bin/sh
+
+set -ex
+
+gitroot=$(git rev-parse --show-toplevel)
+cd "$gitroot/qemu"
+
+if [ ! -e cmdline ]; then
+ echo "Missing qemu/cmdline.."
+ exit 1
+fi
+
+if [ ! -e debian11_encrypted.qcow2 ]; then
+ echo "Copying disk.."
+ rsync -a --info=progress2 debian11.qcow2 debian11_encrypted.qcow2
+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 debian11_encrypted.qcow2 \
+ -console serial \
+ -vnc 1 \
+ -mem 2024 \
+ -smp 1,cores=1,threads=1 \
+ -allow-debug \
+ -initrd initrd.img-5.19.0-rc6-snp-guest-d9bd54fea4d2 \
+ -kernel vmlinuz-5.19.0-rc6-snp-guest-d9bd54fea4d2 \
+ -append "$(cat cmdline)" \
+ -sev-snp
+