This is an old revision of the document!
Create Windows Templates
Please try to follow this process exactly as it is to have your windows machine provisioned correctly
Windows Server
- 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
- postinstall.ps1
- Startup.cmd
- unattend.xml
- xenica_auostart.ps1
- 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>
- Copy the unattend.xml file into the c:\windows\system32\sysprep directory
- 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.
This procedure was tested with Windows server 2008 R2