Create a VM template in Proxmox

Topics: Proxmox

These steps turn a cloud image into a reusable Proxmox virtual-machine template.

Download the installation ISO file:

mkdir os-images
wget -P os-images https://cloud-images.ubuntu.com/daily/server/releases/24.04/release/ubuntu-24.04-server-cloudimg-amd64.img

Pick a free VM ID:

VMID=9000

Create a VM that’ll later become our template:

qm create ${VMID} --name "ubuntu-24.04-cloud-init-template" --memory 2048 --cores 2 --net0 virtio,bridge=vmbr0

Import the ISO as the VM’s disk:

qm importdisk ${VMID} \
  os-images/ubuntu-24.04-server-cloudimg-amd64.img \
  local-lvm

Add the disk to the VM:

qm set ${VMID} --scsihw virtio-scsi-pci --scsi0 local-lvm:vm-${VMID}-disk-0

Make it the boot disk:

qm set ${VMID} --boot c --bootdisk scsi0

Add cloudinit storage:

qm set ${VMID} --ide2 local-lvm:cloudinit

Enable DHCP:

qm set ${VMID} --ipconfig0 ip=dhcp

Set up the initial user account:

qm set ${VMID} --ciuser pubmox --cipassword 's3cr3t'

Regenerate cloudinit:

qm cloudinit update ${VMID}

Name the VM template:

qm set ${VMID} --name "ubuntu-24.04-template"

Convert the VM to a VM template:

qm template ${VMID}

Bookmarks

Questions