Skip to content

Instantly share code, notes, and snippets.

@andrewnk
Last active March 17, 2023 16:40
Show Gist options
  • Save andrewnk/e62b0af68b7ac9daf3e708277a797ac3 to your computer and use it in GitHub Desktop.
Save andrewnk/e62b0af68b7ac9daf3e708277a797ac3 to your computer and use it in GitHub Desktop.
Create an Ubuntu Focal Cloud-init Template on Proxmox

Get a shell into the proxmox server. Change VM_STORAGE to the location where to store your clout-init and disk image (e.g. local, local-zfs, etc.).

export VM_ID="$VM_ID"
export VM_STORAGE="freenas"

qm create $VM_ID --name "ubuntu-focal-cloudinit" --memory 2048 --cores 2 --net0 virtio,bridge=vmbr0
qm importdisk $VM_ID focal-server-cloudimg-amd64.img $VM_STORAGE

qm set $VM_ID --scsihw virtio-scsi-pci --scsi0 $VM_STORAGE:$VM_ID/vm-$VM_ID-disk-0.raw
qm set $VM_ID --boot c --bootdisk scsi0
qm set $VM_ID --ide2 $VM_STORAGE:cloudinit
qm set $VM_ID --serial0 socket --vga serial0
qm set $VM_ID --agent enabled=1
qm set $VM_ID --ipconfig0 ip=dhcp
qm resize $VM_ID scsi0 32G
qm template $VM_ID
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment