Unlike Linux Cloud Images, there are no Windows Server VM images provided by Microsoft, so I created pve-build-windows-template to generate PVE friendly VM templates. A non-interactive run turns a Windows Server ISO into a sysprepped, Cloudbase-Init-capable PVE template.
How to use it
What it does
Produces two templates — Server Core and Desktop Experience — at consecutive VMIDs. Per run it:
Environment was tested with: Server 2019, 2022, 2025. UEFI/GPT, q35, OVMF, TPM 2.0, Secure Boot with pre-enrolled keys, virtio-scsi-single.
Link: https://github.com/ciroiriarte/pve-tools#pve-build-windows-template
How to use it
Bash:
./pve-build-windows-template \
--iso dstore01:iso/win2022.iso \
--edition both --sku standard \
--storage dstore01 --start-id 9020
What it does
Produces two templates — Server Core and Desktop Experience — at consecutive VMIDs. Per run it:
- injects virtio storage/NIC drivers into WinPE so Setup sees the disk
- installs the virtio set, QEMU guest agent, SPICE agent and Cloudbase-Init
- enables RDP with its firewall rule
- sets the Windows Update policy
- runs sysprep /generalize /oobe /shutdown
- verifies offline
- attaches the cloud-init drive and seals.
Environment was tested with: Server 2019, 2022, 2025. UEFI/GPT, q35, OVMF, TPM 2.0, Secure Boot with pre-enrolled keys, virtio-scsi-single.
Link: https://github.com/ciroiriarte/pve-tools#pve-build-windows-template