Create Windows Templates

Please try to follow this process exactly as it is to have your windows machine provisioned correctly

This procedure was tested with Windows server 2008 R2, the same procedure also work in 2012 and 2016 as well.

  • Create your windows VM and add any software you wish to have installed by default on it (the administrator password of the vm should be WinVPS@servaRICA)
  • Write your windows product key in your windows vm and activate it
  • Create a folder C:\scripts in the new vm
  • Copy the below files from xenica package to the new VM in C:\scripts
  1. postinstall.ps1
  2. Startup.cmd
  3. unattend.xml
  4. xenica_auostart.ps1
  5. diskpar.txt


  • We need to make Startup.cmd run automatically on system startup (even before login to windows),
    • for that we can use Local group policy editor , from run box type the below
gpedit.msc


  • Expand Windows Settings
  • Select Scripts (Startup/Shutdown)
  • Double click Startup
  • Click Show Files and copy/paste a shortcut of Startup.cmd file in to this folder
  • Click the Add button on the startup properties , then Click Browse and double click on the script to choose it.
  • “OK” out of all windows to apply the new settings.


  • In the downloaded package you will find this file xenica\shell_scripts\windows\unattend.xml.
  • If you are planning to have non-English windows template : open the unattend.xml file and change the following lines to match your language
<InputLocale>en-US</InputLocale>
<SystemLocale>en-US</SystemLocale>
<UILanguage>en-US</UILanguage>
<UserLocale>en-US</UserLocale>


  1. Copy the unattend.xml file into the c:\windows\system32\sysprep directory
  2. In the command line run the following command
cd c:\Windows\System32\sysprep
sysprep /oobe /generalize /shutdown /unattend:unattend.xml

  • Convert the VM to template and the name of the template must include the word windows all lower case.

The same procedure works the same way for windows server 2003 although it need new unattended file id sysprep is required (sysprep is not a must unless your users will run Active directory on their vms) use this tutorial to create sysprep unattended file for win2003 win 2003 r2 sysprep

  • cretate_windowstemplate_new.txt
  • Last modified: 2018/06/09 14:33
  • by sathish