Skip to content

Instantly share code, notes, and snippets.

@casperghst42
Last active November 23, 2025 21:54
Show Gist options
  • Select an option

  • Save casperghst42/9f03f331d357f6bcda5285afdec87007 to your computer and use it in GitHub Desktop.

Select an option

Save casperghst42/9f03f331d357f6bcda5285afdec87007 to your computer and use it in GitHub Desktop.
Create a cloud-init Debian 12 image on proxmox
#!/bin/bash
# Author: Casper Pedersen (github.com/casperghst42)
# License: GPL2
wget https://cloud.debian.org/images/cloud/bookworm/latest/debian-12-generic-amd64.qcow2
virt-customize -a debian-12-generic-amd64.qcow2 --install qemu-guest-agent --install resolvconf --install systemd-resolved --update --run-command 'mkdir -p /etc/network/interfaces.d' --run-command 'echo "auto ens18" >> /etc/network/interfaces.d/ens18' --run-command 'echo "iface ens18 inet manual" >> /etc/network/interfaces.d/ens18'
qm create 100000 --name "debian12-cloudinit-template" --memory 2048 --net0 virtio,bridge=vmbr0
qm importdisk 100000 debian-12-generic-amd64.qcow2 local-lvm -format qcow2
qm set 100000 --scsihw virtio-scsi-pci --scsi0 local-lvm:vm-90000-disk-0
qm resize 90000 scsi0 10G
qm set 100000 --ide2 local-lvm:cloudinit
qm set 100000 --boot c --bootdisk scsi0
qm set 100000 --serial0 socket --vga serial0
@e9x
Copy link

e9x commented Jul 10, 2025

thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment