Create a VMware vSphere template for Windows Server 2019

  • Article
  • 2 minutes to read

This article provides guidance for creating a Windows Server 2019 VMware vSphere virtual machine template.

Prerequisites

Note

This guide assumes that you have some VMware vSphere familiarity and you have knowledge on how to install Windows Server. It also does not review either VMware or Windows best practices.

  • Download the latest Windows Server ISO file

  • VMware vSphere 6.5 and above

  • Although it can be used locally, for faster deployment it's recommended to upload the file to a vSphere datastore or to vCenter content library.

Creating Windows Server 2019 VM template

Deploying and installing Windows Server

  1. Deploy a new virtual machine.

    A screenshot of how to create a new VMware vSphere virtual machine.

    Second screenshot of how to create a new VMware vSphere virtual machine.

    Third screenshot of how to create a new VMware vSphere virtual machine.

    Fourth screenshot of how to create a new VMware vSphere virtual machine.

    Fifth screenshot of how to create a new VMware vSphere virtual machine.

    Sixth screenshot of how to create a new VMware vSphere virtual machine.

  2. Make sure to select Microsoft Windows Server 2016 or later (64-bit) as the guest OS.

    A screenshot of Windows Server guest OS.

  3. Point to the Windows Server ISO file location.

    Seventh screenshot of how to create a new VMware vSphere virtual machine.

    Eighth screenshot of how to create a new VMware vSphere virtual machine.

  • Power on the VM and start the Windows Server installation.

    First screenshot of a Windows Server installation.

    Second screenshot of a Windows Server installation.

    Third screenshot of a Windows Server installation.

    Fourth screenshot of a Windows Server installation.

    Fifth screenshot of a Windows Server installation.

    Sixth screenshot of a Windows Server installation.

    Seventh screenshot of a Windows Server installation.

Post-installation

Before converting the VM to a template, several actions are required.

  1. Install VMware Tools and restart.

    First screenshot of a VMware Tools installation.

    Second screenshot of a VMware Tools installation.

    Third screenshot of a VMware Tools installation.

    Fourth screenshot of a VMware Tools installation.

    Fifth screenshot of a VMware Tools installation.

    Sixth screenshot of a VMware Tools installation.

    Seventh screenshot of a VMware Tools installation.

    Eighth screenshot of a VMware Tools installation.

    Ninth screenshot of a VMware Tools installation.

  2. Perform Windows updates.

  3. Change PowerShell execution policy to Bypass by running the Set-ExecutionPolicy -ExecutionPolicy Bypass command in PowerShell (can be later tuned on via group policy or a PowerShell script).

  4. Allow WinRM communication to the OS by running the allow_winrm PowerShell script.

  5. None of the following steps are mandatory but should be considered for a Windows template:

    • Disable user account control (can be later turned on via group policy or a PowerShell script)

    • Turn off Windows Defender Firewall (can be later turned on via group policy or a PowerShell script)

    • Disable Internet Explorer Enhanced Security Configuration (ESC) (can be later turned on via group policy or a PowerShell script)

    • Enable Remote Desktop Services

    • From PowerShell, install Chocolatey

                          Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))                                      
    • Install all baseline applications you may want to include in your template.

Convert to template

Reduce the VM CPU count and memory resources to the minimum and convert the VM to template, switch the CD/DVD drive to client device as well disconnect it and convert the VM to template.

A screenshot of how to reduce a virtual machine's CPU count and memory.

A screenshot of how to convert a virtual machine to a template.