Skip to content

Instantly share code, notes, and snippets.

@ZeroDeth
Created December 19, 2023 08:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ZeroDeth/cc5f5d8063883f69b815a45ebc30f4cf to your computer and use it in GitHub Desktop.
Save ZeroDeth/cc5f5d8063883f69b815a45ebc30f4cf to your computer and use it in GitHub Desktop.
  1. Download the ISO using the GUI (tested on https://cloud-images.ubuntu.com/lunar/current/lunar-server-cloudimg-amd64-disk-kvm.img)
  2. Create the VM via CLI
VMID=<TEMPLATE ID HERE>
STORAGE=<YOUR STORAGE HERE>

qm create $VMID --memory 2048 --balloon 0 --core 2 --name ubuntu-cloud --net0 virtio,bridge=vmbr0
cd /var/lib/vz/template/iso/
qm importdisk 5000 lunar-server-cloudimg-amd64-disk-kvm.img $STORAGE
qm set $VMID --scsihw virtio-scsi-pci --scsi0 ${STORAGE}:vm-$VMID-disk-0,discard=on,ssd=1
qm set $VMID --ide2 ${STORAGE}:cloudinit
qm set $VMID --boot c --bootdisk scsi0
qm set $VMID --serial0 socket --vga serial0
  1. Expand the VM disk size to a suitable size (suggested 10 GB)
qm resize $VMID scsi0 10G
  1. Head over to Proxmox UI > VMID > Cloud-Init section and set username, password, ssh keys and ip address configuration as desired.
  2. Create the Cloud-Init template
qm template $VMID
  1. Deploy new VMs by cloning the template (full clone)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment