Skip to content

Creating Cloud Image Template on Proxmox

  • Follow commands below for Rocky Linux and Ubuntu cloud images.
  • Once template is created, VMs can be cloned from the template.
1. Preparations
Connect to PVE
ssh pve

List storage pools - we will be using vm_ct
pvesm status
output
Name                        Type     Status     Total (KiB)      Used (KiB) Available (KiB)        %
local                        dir     active        70892712        10550868        56694972   14.88%
local-lvm                lvmthin     active       147714048               0       147714048    0.00%
vm_ct                    lvmthin     active       957100032       471754605       485345426   49.29%

List configured networks - we will be using vmbr0
brctl show
output
bridge name     bridge id               STP enabled     interfaces
fwbr30040i0     8000.7ef38b20b3aa       no              fwln30040i0
                                                        tap30040i0
fwbr30080i0     8000.2ed716ece7b9       no              fwln30080i0
                                                        tap30080i0
vmbr0           8000.705a0f4343e0       no              fwpr30040p0
                                                        fwpr30080p0
                                                        nic0
2. Get Cloud Image
Latest images at https://dl.rockylinux.org/pub/rocky
wget https://dl.rockylinux.org/pub/rocky/10/images/x86_64/Rocky-10-GenericCloud-Base.latest.x86_64.qcow2
Latest images at https://cloud-images.ubuntu.com/releases
wget https://cloud-images.ubuntu.com/releases/noble/release/ubuntu-24.04-server-cloudimg-amd64.img
3. Create new VM with 4 GB (4096 MB) RAM on storage vm_ct with vmbr0 bridge
VM ID: 8001, name: rocky-cloud; CPU: host (did not work with default kvm64)
qm create 8001 --memory 4096 --name rocky-cloud --cores 2 --sockets 2 --cpu host --net0 virtio,bridge=vmbr0
VM ID: 8002, name: ubuntu-cloud, CPU: can leave default kvm64
qm create 8002 --memory 4096 --name ubuntu-cloud --cores 2 --sockets 2 --cpu kvm64 --net0 virtio,bridge=vmbr0
4. Import downloaded image to newly created VM
VM ID: 8001, Downloaded disk: Rocky-10-GenericCloud-Base.latest.x86_64.qcow2, Storage: vm_ct
qm importdisk 8001 Rocky-10-GenericCloud-Base.latest.x86_64.qcow2 vm_ct
output
... successfully imported disk 'vm_ct:vm-8001-disk-0'

VM ID: 8002, Downloaded disk: ubuntu-24.04-server-cloudimg-amd64.img, Storage: vm_ct
qm importdisk 8002 ubuntu-24.04-server-cloudimg-amd64.img vm_ct
output
... successfully imported disk 'vm_ct:vm-8002-disk-0'

5. Attach imprted disk to VM
VM ID: 8001, Storage: vm_ct, Disk: vm-8001-disk-0
qm set 8001 --scsihw virtio-scsi-pci --scsi0 vm_ct:vm-8001-disk-0
output
update VM 8001: -scsi0 vm_ct:vm-8001-disk-0 -scsihw virtio-scsi-pci
VM ID: 8002, Storage: vm_ct, Disk: vm-8002-disk-0
qm set 8001 --scsihw virtio-scsi-pci --scsi0 vm_ct:vm-8002-disk-0
output
update VM 8002: -scsi0 vm_ct:vm-8002-disk-0 -scsihw virtio-scsi-pci
6. Attach logical volume cloudinit drive to the new VM
VM ID: 8001, Storage: vm_ct, Disk: cloudinit
qm set 8001 --ide2 vm_ct:cloudinit
output
update VM 8001: -ide2 vm_ct:cloudinit
  Logical volume "vm-8001-cloudinit" created.
  Logical volume vm_ct/vm-8001-cloudinit changed.
ide2: successfully created disk 'vm_ct:vm-8001-cloudinit,media=cdrom'
generating cloud-init ISO
VM ID: 8002, Storage: vm_ct, Disk: cloudinit
qm set 8002 --ide2 vm_ct:cloudinit
output
update VM 8002: -ide2 vm_ct:cloudinit
  Logical volume "vm-8002-cloudinit" created.
  Logical volume vm_ct/vm-8002-cloudinit changed.
ide2: successfully created disk 'vm_ct:vm-8002-cloudinit,media=cdrom'
generating cloud-init ISO
7. Set to Boot from cloudinit
VM ID: 8001
qm set 8001 --boot c --bootdisk scsi0
output
update VM 8001: -boot c -bootdisk scsi0
VM ID: 8002
qm set 8002 --boot c --bootdisk scsi0
output
update VM 8002: -boot c -bootdisk scsi0
8. Enable serial console for use with Web VNC within Proxmox
VM ID: 8001
qm set 8001 --serial0 socket --vga serial0
output
output: update VM 8001: -serial0 socket -vga serial0
VM ID: 8002
qm set 8002 --serial0 socket --vga serial0
output
output: update VM 8002: -serial0 socket -vga serial0
9. Set defaults from Proxmox (PVE) GUI
  • User:
  • Password:
  • DNS domain: (uses host settings by default)
  • DNS servers: (uses host settings by default)
  • SSH public key:
  • IP Config (net0): (make sure to select DHCP for IPv4 or provide Static value)

10. DO NOT START THIS VM to preserve clean machine id, etc.

11. At this point, if needed, Processors and Memory can be changed as needed.

12. Right-Click and Convert to Template