Shared lib.sh builder: pvebox storage/bridge defaults, self-downloading scripts, Debian 13

This commit is contained in:
steffen committed 2026-11-04 20:47:19 +01:00
1 parent 3306959dcd
commit 24e624234b
8 files changed
+122 -105

No files matched your search

+7 -20
View File
@@ -1,27 +1,14 @@
#!/usr/bin/env bash
cd "$(dirname "$0")" && source ./lib.sh
VM_ID=9999
VM_NAME="Ubuntu-22-04-LTS-Large-Docker"
CPU_CORE=4
CPU_SOCKET=2
RAM=8192
DISK=100
#getting latest image"
wget https://cloud-images.ubuntu.com/jammy/current/jammy-server-cloudimg-amd64.img
#installing qemu guest agent and remove HW ID
virt-customize -a jammy-server-cloudimg-amd64.img --install qemu-guest-agent,neofetch
virt-customize -a jammy-server-cloudimg-amd64.img --run-command "curl -fsSL https://get.docker.com -o get-docker.sh
sh get-docker.sh"
virt-customize -a jammy-server-cloudimg-amd64.img --run-command "echo -n > /etc/machine-id"
qm create $VM_ID --name $VM_NAME --net0 virtio,bridge=vmbr0
qm set $VM_ID --cores "$CPU_CORE" --sockets "$CPU_SOCKET" --memory "$RAM"
qm importdisk "$VM_ID" jammy-server-cloudimg-amd64.img local-lvm
qm set "$VM_ID" --scsihw virtio-scsi-pci --scsi0 local-lvm:vm-"$VM_ID"-disk-0
qm set "$VM_ID" --ide2 local-lvm:cloudinit
qm set "$VM_ID" --boot c --bootdisk scsi0
qm set "$VM_ID" --serial0 socket --vga serial0
qm resize $VM_ID scsi0 "$DISK"G
qm set "$VM_ID" --ipconfig0 ip=dhcp
qm set "$VM_ID" --agent enabled=1
qm template "$VM_ID"
rm jammy-server-cloudimg-amd64.img #clean iso
echo "Template er ferdig med id "$VM_ID""
IMAGE_URL="https://cloud-images.ubuntu.com/jammy/current/jammy-server-cloudimg-amd64.img"
PACKAGES="neofetch"
DOCKER=1
build_template