Creating a virtual Windows Server 2022 template with Proxmox

One of my favorite features of Proxmox is the ability to create templates so I can quickly deploy a virtual machine, especially when I am implementing new features that I am not familiar with. I recently got some new hardware that will let me implement an Active Directory setup in my home lab. I plan to use this environment to become more familiar with the way it works.

I have a Proxmox cluster setup and I'm adding Windows Server 2022 and Windows 11 Enterprise virtual machines to it to become more familiar with Active Directory. Having virtual machines can let me mess around with different configurations and if I break something, I can revert back by using the snapshots feature. I also want to get familitar with the process of creating an Active Directory without referencing to my documentation as often as I currently do.

To begin, you will need the evaluation image for Windows Server 2022 which can be found here.

You will also need the VirtIO Drivers. You can find them here. I will be using the newest version available at this time which is the virtio-win-0.1.225-2.iso found here.

Instead of downloading the image to your PC, you can copy the download link and download it directly from your Proxmox server. You can find the ISO images page by heading to the ISO Images tab of the local storage.

ISO images section in Proxmox.

You can see the options I chose for my Windows Server 2022 VM below. Because I want to convert this to a template later on, I chose the minimum amount of storage required which is 32 GB.

Creating the VM with Proxmox (NOTE: I choose Windows 11 ISO in the template, I had to go back and choose the Windows Server 2022 image afterwards).

After creating the Virtual Machine, we have to add the VirtIO ISO so that we can load the drivers during the Windows installation process. You do this by going to the Hardware section, adding a CD/DVD Drive, and choosing the ISO image.

You'll then want to verify that the VM will boot off of the Windows ISO attached to it. You can change the boot order by going to the Options tab.

Now you are ready to start the VM. The installation process is similar to recent previous Windows installations. When choosing which OS to install, I choose the Standard Edition with Desktop Experience. The Desktop Experience will give you a GUI so you don't have to manage it via a CLI.

When you get to the step where you have to select a storage, you won't see any options until we load the appropriate driver. Choose Load Diver (Or type L) and then browse to the VirtIO drive > vioscsi > 2k22 > amd64 folder. Once you load that driver, you should see the drive as an option to install Windows Server 2022.

0:00
/

After the installation process is completed, you will be prompted to create a password. This password will need to be recreated after the template is created so don't worry about the complexity of it, as long as Windows accepts it as an acceptable password.

Once you're at the login screen, send the Control + Alt + Delete key combo via the Proxmox interface.

After logging in, install the VirtIO drivers by selecting the VirtIO image from Windows Explorer and run the virtio-win-guest-tools.exe file. If you run the .msi installer, you wont get all the drivers installed. Reboot the VM after the drivers are installed.

You can also choose to install updates to the VM at this time. This will save you resources as newly created machines will be up to date.

To properly convert the VM to a template, we have to run the sysprep utility to safely clone it so that when a machine is created from the template, it has its own unique identifiers.

To run the sysprep utility, I will run it as a command from the Run dialog screen. Enter the following command:

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

NOTE: You can also run the command via Command Prompt too (and I can capture the full command in a screenshot).

Once the VM powers off, all that is left to do is to convert it to a template under Proxmox. I like to remove the mounted ISO images from the VM before doing so. That includes the VirtIO image and the Windows Server ISO.

0:00
/
Removing the VirtIO image from the VM. Do the same with the Windows Installation image.

Then convert it to a template and you're done!