From c27807e86ffaab933e14d997d8ed39872314816d Mon Sep 17 00:00:00 2001 From: Nilstrieb <48135649+Nilstrieb@users.noreply.github.com> Date: Sat, 9 Mar 2024 22:25:58 +0100 Subject: [PATCH] install works --- create-vms.sh | 25 +++++++++++++++++++++---- user-data | 17 +++++++++++++++-- 2 files changed, 36 insertions(+), 6 deletions(-) mode change 100644 => 100755 create-vms.sh diff --git a/create-vms.sh b/create-vms.sh old mode 100644 new mode 100755 index 0bccb72..faf9443 --- a/create-vms.sh +++ b/create-vms.sh @@ -2,25 +2,42 @@ set -eu +DIR="$(dirname "$(realpath "$0")")" + NAME="$1" mkdir -p tmp mkdir -p vm-state -IMG=debian-12-genericcloud-amd64.qcow2 +# https://mop.koeln/blog/creating-a-local-debian-vm-using-cloud-init-and-libvirt/ +# > DO NOT DOWNLOAD THE GENERICCLOUD IMAGE +IMG=debian-12-generic-amd64.qcow2 if ! [ -f "tmp/$IMG" ]; then - curl -L -o "tmp/$IMG" https://cloud.debian.org/images/cloud/bookworm/latest/debian-12-genericcloud-amd64.qcow2 + curl -L -o "tmp/$IMG" https://cloud.debian.org/images/cloud/bookworm/latest/debian-12-generic-amd64.qcow2 fi DISK="vm-state/$NAME.qcow2" cp "tmp/$IMG" "$DISK" +meta_data=$(mktemp) + +cat >"$meta_data" <