Skip to main content

Proxmox Golden VM Templates & Lab Provisioning

Proxmox VE Golden VM Template and SCCM Lab Provisioning Pipeline

Hello all and welcome to the start of the Active Directory SCCM and End-Point Lab series. This lab will consist of an Active Directory domain controller (DC01), SQL Server & Configuration Manager (CM01), and a few Windows clients that we will create for testing of policies and application deployments in future installments.

Before we stand up Active Directory (DC01), SQL Server and Configuration Manager (CM01), or a single Windows 11 client (CLIENT01), we have a foundational infrastructure problem to solve first: how do we deploy, wipe, and rebuild multi-VM Windows lab topologies in minutes instead of losing entire weekends clicking through Windows Setup?

This phase covers building reusable, sysprepped Proxmox VE golden VM templates (VM 9001 for Windows Server 2022 on pve-dell01 and VM 9002 for Windows 11 Enterprise on pve-dell02) using shared ISO storage (Fileshare_TurnKeySMB).


The "Why" Before the "How": Hypervisor Templates vs. SCCM Thin Images​

In labs of this type, we will inevitably break something—whether testing risky Active Directory schema extensions, tuning SQL Server memory caps, or troubleshooting a failed Task Sequence. When a break happens, waiting 45 minutes per VM to install Windows Server from an ISO, inject storage drivers, run Windows Update, and repeat across three machines quickly kills momentum.

That is where Proxmox VM Templates (qm template) come in. A Proxmox template lets us build each OS once, install VirtIO drivers and the QEMU Guest Agent, generalize the OS with sysprep, and freeze the disk into a read-only clone source. From there, spinning up a fresh DC01 or CM01 takes seconds with qm clone.

[Hypervisor Provisioning Templates != SCCM Golden Images]

It is important not to confuse hypervisor provisioning templates with ConfigMgr OS Deployment (OSD):

  • Proxmox VM Templates (VM 9001 / VM 9002): Used before SCCM exists to rapidly clone infrastructure servers (DC01, CM01) and blank test endpoints (CLIENT01) whenever we need a clean lab reset.
  • SCCM Thin-Image OSD: Once CM01 is online, ConfigMgr deploys endpoints dynamically over PXE using a clean Microsoft install.wim, injecting hardware drivers, cumulative updates, and applications on the fly via Task Sequences rather than maintaining bloated "thick" images.

Lab Storage & ISO Pre-Staging (Fileshare_TurnKeySMB)​

Rather than copying gigabytes of Windows ISOs onto the local NVMe disk of every Proxmox node in my dcruz-homelab cluster, all installation media is staged centrally on Fileshare_TurnKeySMB. This is a TurnKey Samba server/container hosted on the lab01 node. It acts as a centralized ISO repository that I configured to be accessible to all nodes in my Proxmox cluster, residing under /mnt/pve/Fileshare_TurnKeySMB/template/iso/.

Downloading Windows Server 2022 ISO directly to Fileshare_TurnKeySMB via Proxmox URL downloader

Proxmox task log confirming ISO download to shared TurnKey SMB storage

The following ISOs were staged on the shared SMB storage server before creating the templates:

ISO FileOS / PurposeSizeTarget Template
SERVER_EVAL_x64FRE_en-us.isoWindows Server 2022 Evaluation (180-day)4.70 GiBVM 9001 (tpl-win-server-2022)
26100.1742.240906-0331.ge_release_svc_refresh_CLIENTENTERPRISEEVAL_OEMRET_x64FRE_en-us.isoWindows 11 Enterprise 24H2 Evaluation (90-day)5.39 GBVM 9002 (tpl-win11-enterprise)
virtio-win.isoRed Hat VirtIO SCSI, NetKVM, Balloon & QEMU Guest Agent drivers~700 MBBoth 9001 & 9002

Building Template 9001 (tpl-win-server-2022)​

Instead of clicking through 10 screens in the Proxmox web wizard—where it is easy to forget critical settings for an optimized setup of the VM template—we provision VM 9001 deterministically from the pve-dell01 shell. Let's take a look at the series of commands that I have worked out:

# Step 1: Create the VM skeleton with UEFI (OVMF), Q35 chipset, VirtIO SCSI, and QEMU Guest Agent
qm create 9001 --name tpl-win-server-2022 \
--memory 4096 --cores 4 --cpu host \
--machine q35 --bios ovmf \
--ostype win11 \
--scsihw virtio-scsi-pci \
--net0 virtio,bridge=vmbr0 \
--agent enabled=1

Above we are defining all the core settings for the VM, setting name, memory, core count, machine type, bios, OS type, network settings, etc. All the fundamental components to our VM.

# Step 2: Provision the EFI variable disk (with Secure Boot keys) and a 64 GB thin-provisioned NVMe-backed OS disk

pvesm set local-lvm --nodes pve-dell01
qm set 9001 --efidisk0 local-lvm:0,efitype=4m,pre-enrolled-keys=1
qm set 9001 --scsi0 local-lvm:64,discard=on,ssd=1

Proxmox storage summary showing local-lvm enabled and active on pve-dell01 local-lvm enabled and active on pve-dell01 (151.64 GB NVMe thin pool).

Terminal output showing efidisk0 and scsi0 volume creation on pve-dell01 4 MB UEFI NVRAM (efidisk0 with Microsoft 2023 Secure Boot keys) and 64 GB thin-provisioned scsi0 volume created.

Since we are using local-lvm for our VM storage on pve-dell01 & pve-dell02—the nodes used for this project series—we need to ensure the following items are configured:

  • pvesm set local-lvm --nodes pve-dell01: Prior to running the commands below, I had to set up the local-lvm pool, enabling usage of the rest of the SSD storage we have available on the node (note: in a multi-node cluster, pass all nodes that use local-lvm—e.g., --nodes lab01,lab02,pve-dell01,pve-dell02—so enabling one node does not overwrite the others).
  • --efidisk0 local-lvm:0,efitype=4m,pre-enrolled-keys=1: Creates a 4 MB EFI disk, pre-populates Microsoft Secure Boot certs, and enables trust of Windows Server and Windows 11 with Secure Boot active.
# Step 3: Attach both the Windows Server 2022 ISO and the VirtIO driver ISO

qm set 9001 --ide2 Fileshare_TurnKeySMB:iso/SERVER_EVAL_x64FRE_en-us.iso,media=cdrom
qm set 9001 --ide0 Fileshare_TurnKeySMB:iso/virtio-win.iso,media=cdrom
qm set 9001 --boot 'order=ide2;scsi0'

The above is straightforward: it attaches the SMB file share that I have on my lab01 PVE node and targets the ISOs needed for the OS install.

Here is the finished Windows Server template on our pve-dell01 node:

Proxmox Hardware tab for VM 9001 showing OVMF, Q35, VirtIO SCSI, and EFI Disk VM 9001 (tpl-win-server-2022) hardware summary: OVMF (UEFI), pc-q35-11.1, VirtIO SCSI (discard=on,ssd=1), and EFI Disk (pre-enrolled-keys=1).


Building Template 9002 (tpl-win11-enterprise)​

Here is the set of commands we will run on pve-dell02. Windows 11 Enterprise enforces TPM 2.0 alongside UEFI Secure Boot. Thus, adding --tpmstate0 keeps our SCCM client testbed aligned with real enterprise BitLocker, Credential Guard, and Windows 11 hardware-compliance checks (no registry bypass hacks required):

# Step 1: Create the Windows 11 VM skeleton (note the added TPM 2.0 state disk)
qm create 9002 --name tpl-win11-enterprise \
--memory 4096 --cores 4 --cpu host \
--machine q35 --bios ovmf \
--ostype win11 \
--scsihw virtio-scsi-pci \
--net0 virtio,bridge=vmbr0 \
--agent enabled=1

# Step 2: Provision EFI NVRAM, TPM 2.0 state, and a 64 GB OS disk

pvesm set local-lvm --nodes pve-dell02
qm set 9002 --efidisk0 local-lvm:0,efitype=4m,pre-enrolled-keys=1
qm set 9002 --tpmstate0 local-lvm:0,version=v2.0
qm set 9002 --scsi0 local-lvm:64,discard=on,ssd=1

# Step 3: Attach Windows 11 24H2 Enterprise ISO and VirtIO driver ISO

qm set 9002 --ide2 Fileshare_TurnKeySMB:iso/26100.1742.240906-0331.ge_release_svc_refresh_CLIENTENTERPRISEEVAL_OEMRET_x64FRE_en-us.iso,media=cdrom
qm set 9002 --ide0 Fileshare_TurnKeySMB:iso/virtio-win.iso,media=cdrom
qm set 9002 --boot 'order=ide2;scsi0'

Proxmox Hardware tab for VM 9002 on pve-dell02 showing OVMF, Q35, VirtIO SCSI, EFI Disk, and TPM v2.0 VM 9002 (tpl-win11-enterprise) hardware summary on pve-dell02, adding TPM State (version=v2.0) alongside OVMF (UEFI) and Q35.


In-Guest Preparation, Sysprep & Template Conversion​

Once each VM boots into Windows Setup:

Load VirtIO Storage Driver at Disk Selection​

Because scsi0 uses virtio-scsi-pci, Windows Setup will not see the 64 GB disk until we click Load driver and browse ide0 (virtio-win.iso) to amd64\2k22\ (for Server 2022) or amd64\w11\ (for Windows 11).

Windows Server​

3-panel collage showing VirtIO SCSI driver loading during Windows Server 2022 Setup Loading D:\amd64\2k22\vioscsi.inf during Windows Server 2022 Setup so the 64 GB VirtIO SCSI disk becomes visible, then setting a temporary Administrator password.

Windows 11​

3-panel collage showing VirtIO SCSI driver loading during Windows 11 24H2 Setup Loading D:\amd64\w11\vioscsi.inf in Windows 11 24H2 Setup to bring Disk 0 Unallocated Space (64.0 GB) online.

After selecting the 64 GB disk and completing the initial file copy, Windows 11 reboots into OOBE. Because the VirtIO NetKVM driver isn't installed yet (unless loaded via Install driver), Windows 11 Enterprise prompts for an Entra ID sign-in rather than a local account.

[Bypassing Entra ID Sign-In on Windows 11 Enterprise OOBE]

On Windows 11 Enterprise 24H2, OOBE defaults to an Entra ID ("Let's set things up for your work or school") prompt. Since DC01 does not exist yet and we are building a generic template, we do not sign in with an online account:

  1. I clicked Sign-in options directly below the email field and selected Domain join instead—on Windows 11 Enterprise/Pro this switches OOBE straight to creating a temporary local admin account (e.g., labadmin).
  2. (Alternative for zero leftover profiles:) Pressing Ctrl + Shift + F3 at OOBE boots into Audit Mode as the built-in Administrator, where we can install tools/updates and run sysprep directly.

2-panel collage showing Windows 11 OOBE network prompt and Domain join instead option Handling the OOBE network prompt (Install driver / I don't have internet) and selecting Sign-in options → Domain join instead to create labadmin.

Install Full VirtIO Guest Tools & QEMU Guest Agent​

After completing OOBE into a temporary local admin account, I ran virtio-win-gt-x64.msi and guest-agent\qemu-ga-x86_64.msi from the virtio-win CD drive so VirtIO networking (NetKVM), ballooning, and Proxmox IP reporting come online.

Apps and features confirming VirtIO driver installer and QEMU Guest Agent installed Both Virtio-win-driver-installer and QEMU guest agent confirmed installed in Apps & Features on both templates.

Apply Baseline Updates & Detach ISOs​

I went ahead and ran Windows Update to bring both VM templates up to date. Then I verified that Device Manager had zero unknown PCI devices, confirming that all virtualized hardware was recognized and operating correctly.

Device Manager showing Red Hat VirtIO Ethernet Adapter and QEMU SCSI Disk with zero unknown devices Device Manager verification showing Red Hat VirtIO Ethernet Adapter and QEMU HARDDISK SCSI Disk Device with zero unknown PCI devices.

[Windows Server 2022 Servicing Lock (KB890830 / 0x80070643)]

On a fresh Server 2022 ISO build, Windows Update often hits Installing - 100% on the Cumulative Update (e.g., KB5122882) for 5–15 minutes while TiWorker.exe commits WinSxS transactions. During that window, KB890830 (Malicious Software Removal Tool) may fail concurrently with Download error - 0x80070643 (ERROR_INSTALL_FAILURE) because the servicing lock is held. Waiting for the Cumulative Update to flip to Pending restart, rebooting once, and retrying allowed KB890830 to install cleanly afterward.

Windows Update showing KB5122882 at 100% alongside KB890830 0x80070643 servicing lock

Generalizing with Sysprep​

I opened an elevated PowerShell prompt inside both the Windows Server and Windows 11 VMs and ran the following command to strip machine-specific SIDs, Event Logs, and hardware bindings. This effectively preps and freezes the VM for templating via Proxmox (no reboot required):

C:\Windows\System32\Sysprep\sysprep.exe /generalize /oobe /shutdown

Sysprep generalizing Windows Server 2022 before shutdown Windows Server 2022 (VM 9001) generalizing cleanly and powering off before qm template.

Key Learnings: Troubleshooting Sysprep Validation Blockers​

Both templates initially threw Sysprep was not able to validate your Windows installation (System Preparation Tool 3.14) when running sysprep /generalize /oobe /shutdown. Whenever Sysprep aborts during pre-flight validation, the exact blocker is always recorded in setuperr.log:

Get-Content C:\Windows\System32\Sysprep\Panther\setuperr.log -Tail 30

Below are the three real-world blockers encountered across Server 2022 and Windows 11 24H2—and how each was resolved:

  1. Windows Server 2022 — Per-User Edge Appx Package (0x80073cf2)

    • Symptom: AppxSysprep.dll failed validation because Microsoft.MicrosoftEdge.Stable auto-updated under the Administrator profile without being provisioned for all users (Package ... was installed for a user, but not provisioned for all users).
    • Fix: I removed the per-user Appx registration (the standard Edge binary in Program Files (x86) remains intact) and re-ran Sysprep:
      Get-AppxPackage -AllUsers *Microsoft.MicrosoftEdge.Stable* | Remove-AppxPackage -AllUsers

    2-panel collage showing Sysprep validation error and setuperr.log 0x80073cf2 Edge Appx failure Left: System Preparation Tool 3.14 validation error. Right: setuperr.log identifying Microsoft.MicrosoftEdge.Stable (0x80073cf2).

  2. Windows 11 24H2 — Reserved Storage In Use (0x800F0975)

    • Symptom: spopk.dll (Sysprep_Clean_Validate_Opk) aborted with hr = 0x800F0975 ("Audit mode cannot be turned on if reserved storage is in use. An update or servicing operation may be using reserved storage."), even though no updates appeared active in Settings.
    • Fix: I stopped the Windows Update/servicing daemons holding the lock, committed the pending component-store cleanup, and disabled Reserved Storage (which also reclaimed ~7 GB on the 64 GB template disk):
      net stop wuauserv
      net stop usosvc
      net stop bits
      dism /Online /Cleanup-Image /StartComponentCleanup
      dism /Online /Set-ReservedStorageState /State:Disabled

    2-panel collage showing setuperr.log 0x800F0975 Reserved Storage lock and DISM status Left: setuperr.log reporting 0x800F0975 (spopk.dll). Right: DISM confirming Reserved Storage is enabled while TrustedInstaller is active.

  3. Windows 11 24H2 — Auto-Enabled BitLocker via TPM 2.0 (0x80310039)

    • Symptom: Once Reserved Storage cleared, BdeSysprep.dll blocked Sysprep with 0x80310039 ("BitLocker is on for the OS volume. Turn BitLocker off to run Sysprep."). Because VM 9002 provisions TPM 2.0 (--tpmstate0) + UEFI Secure Boot, Windows 11 24H2 automatically encrypted C: during setup—and Sysprep refuses to generalize an encrypted OS volume.
    • Fix: I decrypted C: with manage-bde, waited for Conversion Status: Fully Decrypted (0.0%), and re-ran sysprep:
      manage-bde -off C:
      manage-bde -status C:

    2-panel collage showing setuperr.log 0x80310039 BitLocker error and manage-bde decryption followed by Sysprep Left: setuperr.log reporting 0x80310039 (BdeSysprep.dll). Right: manage-bde -status C: reaching Fully Decrypted (0.0%) followed by a clean sysprep run.

Eject ISOs & Convert to Proxmox Templates​

Because VM 9001 resides on pve-dell01 and VM 9002 resides on pve-dell02 (and qm operates on local-node VMs), I ran the cleanup and qm template conversion on each respective host to detach both CD-ROMs, reset the boot order to scsi0, and lock both VMs as read-only golden templates:

# On pve-dell01: clean up installation media and convert VM 9001 into an immutable template
qm set 9001 --ide0 none --ide2 none
qm set 9001 --boot order=scsi0
qm template 9001

# On pve-dell02: clean up installation media and convert VM 9002 into an immutable template
qm set 9002 --ide0 none --ide2 none
qm set 9002 --boot order=scsi0
qm template 9002

2-panel collage showing qm template conversion on pve-dell01 and pve-dell02 Running the conversion on pve-dell01 (VM 9001 → base-9001-disk-*) and pve-dell02 (VM 9002 → base-9002-disk-*). Note that qm skips the non-local VMID on each host.


Cloning & Snapshotting DC01, CM01 & CLIENT01​

With 9001 (pve-dell01) and 9002 (pve-dell02) frozen, provisioning the entire Lab-00 SCCM topology takes three qm clone commands split across the two Dell hypervisors, followed by hardware sizing for SQL/ConfigMgr:

# On pve-dell01: Clone Domain Controller (DC01) and Primary Site + SQL Server (CM01)
qm clone 9001 200 --name DC01 --full 1
qm clone 9001 201 --name CM01 --full 1

Cloning DC01 and CM01 from template 9001 on pve-dell01

# Size server resources to match Lab-00 Baseline (CM01 needs 16 GB RAM & 150 GB disk for SQL + Content Library)
qm set 200 --memory 4096 --cores 2
qm set 201 --memory 16384 --cores 4
qm resize 201 scsi0 +86G

Resizing CM01 disk to 150 GiB and setting RAM/CPU allocations on pve-dell01

[Understanding the LVM-Thin Overcommit Warning]

After resizing CM01 (201) to 150 GiB, LVM prints WARNING: Sum of all thin volume sizes (278.01 GiB) exceeds the size of thin pool pve/data. This is an overcommit notice, not an error: pve-dell01 has ~151.64 GB in local-lvm (64 + 64 + 150 = 278 GiB virtual ceiling), but thin provisioning only allocates physical blocks as Windows writes data (and discard=on,ssd=1 reclaims freed blocks via TRIM). I will keep an eye on actual physical usage with lvs pve/data (Data% and Meta%) so real consumption stays comfortably under ~80% as SQL Server, the SCCM Content Library, and snapshots grow.

# On pve-dell02: Clone Test Client (CLIENT01)
qm clone 9002 202 --name CLIENT01 --full 1
qm set 202 --memory 4096 --cores 2

Cloning CLIENT01 from template 9002 on pve-dell02

  • --full 1 - Creates an independent full clone rather than a linked clone, ensuring DC01, CM01, and CLIENT01 can be backed up, migrated, or snapshotted independently without maintaining a chain dependency back to the template volume.
[Snapshot Before Every Major SCCM Milestone]

Immediately after promoting DC01 and joining CM01 / CLIENT01 to the domain—and before extending the AD schema or installing SQL—we can take a coordinated snapshot (qm snapshot 200 pre-sccm-baseline, qm snapshot 201 pre-sccm-baseline). If an installation fails halfway through, rolling back takes 10 seconds instead of rebuilding Windows.


Verification: Trust, but Verify​

Before considering Phase 0 complete and moving into Active Directory / SCCM site setup, I confirmed both templates and the QEMU Guest Agent paths were healthy across pve-dell01 and pve-dell02:

The two commands below list out our configured templates and the cloned VMs on pve-dell01 and also display the configuration of template 9001:

qm list | grep -E "9001|200|201"
qm config 9001

qm list and qm config 9001 verification on pve-dell01

And then I ran a similar set of commands customized for pve-dell02, confirming that all of our templates and VMs are configured and ready for our upcoming projects:

# On pve-dell02:
qm list | grep -E "9002|202"
qm config 9002

qm list and qm config 9002 verification on pve-dell02

Additional Step: I wanted to confirm that the qm agent we installed in our templates was working properly and able to communicate up to the PVE environment without issue. I ran the two commands after starting VM 200 on pve-dell01 and verified that the VM could receive agent commands and respond:

qm agent 200 ping
qm guest cmd 200 network-get-interfaces

qm agent 200 ping and network-get-interfaces verification output on pve-dell01

A healthy qm agent 200 ping returns silently with no output (exit code 0), confirming Proxmox has two-way communication with the guest OS and can safely freeze NTFS during scheduled vzdump backups.


What's Next?​

With our hypervisor templates locked and DC01, CM01, and CLIENT01 cloned and cleanly snapshotted, we are ready to move into Phase 1: Primary Site Architecture—promoting Active Directory, extending the schema, capping SQL Server memory at 12 GB, and installing ConfigMgr site PR1:

  • 👉 Next Step: 01-Primary-Site-Architecture (Coming Soon in Phase 1)