How to Create Windows Templates for Proxmox

proxmox

Creating Windows templates for Proxmox can greatly streamline the process of deploying Windows virtual machines (VMs) in your virtualization environment. Templates enable you to create standardized VMs with pre-configured settings, making it easier to manage your infrastructure efficiently. In this guide, we’ll walk you through the steps to create a Windows template for Proxmox, complete with essential configurations and optimizations.

Prerequisites

Before we begin, make sure you have the following prerequisites in place:

  1. Proxmox Virtual Environment (Proxmox VE) installed and running.
  2. A Windows ISO.
  3. Familiarity with basic Proxmox operations.
  4. The folders “conf”, “localscripts”, “powershell” from this repository https://github.com/thundervm/proxmox-windows-template

Now, let’s dive into the steps to create a Windows template for Proxmox:

The Tutorial

Create a VM and Install Windows

  1. Create a new VM in Proxmox and make sure to select the “intel e100” network device for compatibility.
  2. Install Windows on the VM using your Windows installation ISO or image, following the on-screen instructions.

Configure Static IP

  1. You need to assign a static IP to the VM for later server access, configure it in Windows networking settings. This step is required because you won’t be able to use console to access the server once display is set to serial console.

Update Windows

  1. Ensure that Windows is up to date by running Windows Update.

Enable RDP

  1. You need to allow remote desktop access to the VM, enable Remote Desktop Protocol (RDP) in Windows settings. This step is required because you won’t be able to use console to access the server once display is set to serial console.

Disable Hibernation/Standby (Windows 10, 11)

  1. Disable hibernation and standby settings to prevent the VM from entering sleep modes, this is important only for Windows 10 and 11 installations. Windows Server VM’s can ignore this step.

Clean Up Windows Updates

  1. Use the cleanmgr.exe Windows utility to remove cached updates to keep the VM clean and minimize disk usage.

Remove Recovery Partition and Expand Disk (Windows 10, 11 and Windows Server 2022)

  1. If applicable, remove the recovery partition in Windows and expand the disk size to utilize the full available space.

Create Windows Firewall Rules for RDP (Window Server 2012 R2)

  1. Configure Windows Firewall rules to allow RDP traffic after the template is cloned. Without this step you won’t be able to access the server over RDP.

Clone the VM

  1. Clone the VM in Proxmox. This ensures that if anything goes wrong, you won’t have to reinstall Windows from scratch.

Install Virtio Drivers

  1. Install the Virtio drivers in Windows to improve VM performance and compatibility.

Change Network Device to Virtio (Optional)

  1. Change the network device to Virtio for improved network performance. This is optional.

Change Hard Disk Device to Virtio (Optional)

  1. Change the hard disk device to Virtio for improved performance and update boot order. This is optional.

Add Serial Port 0 and Set Display to Serial Port 0

  1. Add a serial port and set the display to use Serial Port 0.

Install Cloudbase Init

  1. Download and install Cloudbase Init from https://cloudbase.it/downloads/CloudbaseInitSetup_x64.msi.

Launch PowerShell Script as Administrator

  1. Run the PowerShell script “FixUserService.ps1” as an administrator to ensure proper initialization.

Upload Cloudinit Configuration Files

  1. Upload cloudinit configuration files, including “Unattend.xml” and any required Python scripts, to the VM.

Disable Cloudbase Startup

  1. sc config cloudbase-init start= disabled

Launch Sysprep

  1. C:\Windows\System32\sysprep\sysprep.exe /generalize /oobe /unattend:Unattend.xml

Convert to template and enjoy!

Congratulations, you’ve reached the finish line! It’s time to convert your Proxmox VM to a template, add a CloudInit drive and embark on the journey of effortlessly creating Windows VMs in a matter of minutes.

    Leave a Reply

    Your email address will not be published. Required fields are marked *