Introduction
This guide walks through creating a cloud-init enabled Ubuntu template in Proxmox for rapid VM provisioning. Cloud-init
automates initial server configuration including user accounts, network settings, and package installation.
Preparing the Cloud-Init Image
1. Access Proxmox Host
First, connect to your Proxmox server via SSH:
1
| ssh proxmox-server-username@proxmox-server-ip
|
2. Download Ubuntu Cloud Image
1
2
| export VM_ID="500"
wget -O ubuntu.img https://cloud-images.ubuntu.com/releases/24.04/release/ubuntu-24.04-server-cloudimg-amd64.img
|
3. Image Customization
Install QEMU Guest Agent:
1
2
3
| virt-customize -a ubuntu.img \
--install qemu-guest-agent \
--run-command 'systemctl enable qemu-guest-agent.service'
|
Creating Proxmox VM Template
1
2
3
4
5
6
| qm create ${VM_ID} \
--name ubuntu-24.04-cloudimg-template \
--agent 1,fstrim_cloned_disks=1 \
--core 4 \
--memory 8192 \
--net0 virtio,bridge=vmbr0
|
2. Import and Attach Disk
1
2
3
4
| qm importdisk ${VM_ID} ubuntu.img local-lvm
qm set ${VM_ID} \
--scsihw virtio-scsi-pci \
--scsi0 local-lvm:vm-${VM_ID}-disk-0
|
1
2
3
4
| qm set ${VM_ID} \
--ide2 local-lvm:cloudinit \
--boot c --bootdisk scsi0 \
--serial0 socket --vga serial0
|
4. Finalize Template
Deploying VM from Template
- Right-click template → Clone
- Select Full Clone mode
- In Cloud-Init tab:
- Username: Set username(e.g.,
ubuntu)
- Password: Set secure password
- SSH Keys: Paste your public key
- IP Configuration:
- DHCP (recommended)
- Static IP:
- Address/CIDR:
192.168.1.100/24
- Gateway:
192.168.1.1
- DNS:
8.8.8.8 8.8.4.4
- Click Regenerate Image
2. Start and Connect
- Launch VM → Check IP in Summary tab
- SSH access examples:
1
| ssh username@vm-dhcp-ip-address
|
Useful Links