Reference: Spiffyeight77 (modified by me for Debian 13)
# Within Proxmox, create storage directory for cloud-init images
mkdir -p /var/lib/vz/template/iso/cloud-init/debian
# Navigate to debian directory
cd /var/lib/vz/template/iso/cloud-init/debian
# Download Debian 13 generic cloud image
wget https://cloud.debian.org/images/cloud/trixie/latest/debian-13-genericcloud-amd64.qcow2
# Download checksum for verification
wget https://cloud.debian.org/images/cloud/trixie/latest/SHA512SUMS
# Verify image integrity
sha512sum -c SHA512SUMS --ignore-missing
qm create 9000 --name debian-13-template --memory 2048 --cores 1 --net0 virtio,bridge=vmbr0 --ostype l26 --cpu cputype=host
# Import cloud-init image as VM disk
qm importdisk 9000 /var/lib/vz/template/iso/cloud-init/debian/debian-13-genericcloud-amd64.qcow2 local-lvm --format qcow2
# Attach disk to VM with VirtIO SCSI
qm set 9000 --scsihw virtio-scsi-pci --scsi0 local-lvm:vm-9000-disk-0
# Add cloud-init drive
qm set 9000 --ide2 local-lvm:cloudinit
# Configure boot options
qm set 9000 --boot c --bootdisk scsi0
# Add serial console for cloud-init output
qm set 9000 --serial0 socket --vga serial0
# Configure the networking
qm set 9000 --ipconfig0 ip=dhcp
# Enable the qemu guest agent(recommend)
qm set 9000 --agent enabled=1
# Start the VM for testing
qm start 9000
# Check cloud-init configuration
qm cloudinit dump 9000 user
# Monitor startup process
qm console 9000
# Check the VM IP
qm guest cmd 9000 network-get-interfaces
Once logged into the VM: # Check cloud-init status
sudo cloud-init status
# View cloud-init logs
sudo tail -20 /var/log/cloud-init-output.log
# Check system information
cat /etc/os-release
After successful testing, shutdown the VM: # Shutdown the VM
qm shutdown 9000
Convert the VM to a template: # Convert to template (irreversible operation)
qm template 9000