====== Create Windows Templates ======
Please try to follow this process exactly as it is to have your windows machine provisioned correctly
So here we will describe the parts of the tutorial that we need to change
====== Windows server 2008 r2 ======
* 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 in the new vm folder C:\scripts
* copy the files shell_scripts\windows\postinstall.ps1 ,shell_scripts\windows\xenica_auostart.ps1, shell_scripts\windows\StatrtUp.cmd and shell_scripts\windows\XenicaStartUp.xml from xenica package to the new VM in C:\scripts
* now we need to **make StatrtUp.cmd run automatically on system startup** (even before login to windows),
* for that we can use task scheduler , from the command line run this command
%windir%\system32\taskschd.msc /s
* import the task c:\scripts\XenicaStartUp.xml and make sure it is enabled
* in task schedular click on import task
* choose c:\scripts\XenicaStartUp.xml
* new window will appear, in general tab click change user or group
* click advanced -> click find
* choose user Administrator
* click ok -> ok -> ok
* you will be asked about the administrator password please make sure to write it correctly (it must be WinVPS@servaRICA)
* now the main scedular window click on Task Scheduler Library from left panel
* you will find a task called XenicaStartUP , right click on it and choose run
* then from the left panel click refresh
* make sure the results of last run was 0x1
* also verify that you can see new folder in C:\ called XenicaAutoConf
* delete that new folder (C:\XenicaAutoConf)
* 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
en-US
en-US
en-US
en-US
- 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
====== Windows server 2003 r2 ======
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
[[https://cloudstack.apache.org/docs/en-US/Apache_CloudStack/4.0.0-incubating/html-single/Admin_Guide/#sysprep-for-windows-server-2003R2|win 2003 r2 sysprep]]