To leverage several of the CLM Blueprints, you need a properly created Windows Server Template VM. We will build that now.
The steps are as follows:
- Create an Answer File
- Build the Template VM
- Run Sysprep on Template VM
- Convert Template VM into XenServer Template.
Step 1: The Answer File
- Citrix Lifecycle Management needs to have access to a Windows Server template that boots directly into the OS with no prompts. To do this we will use an answer file typically used for unattended installs of the OS. We will create an answer file for the windows setup that you will place on the template VM before you run sysprep. To do this you will need to download and install the Windows Assessment and Deployment Kit otherwise known as ADK. You want the latest one as there are multiple versions. Search for this. “Windows 10 ADK”
- The current URL as of this writing is: https://msdn.microsoft.com/en-us/windows/hardware/dn913721.aspx
- Install that package on your Desktop of PC. This does NOT get installed in your template VM.
- You now need to obtain the install.wim from the Windows 2012 R2 media. If you’re on Windows 8.1 or 10 you can easily mount ISO files by right clicking them
- Locate the install.wim file in the \sources directory of the install media
- Copy that file to a folder on your local system.
- Start the Windows System Image Manager, which is part of the Windows ADK
- In the Windows Image pane, right click the Select a Windows image or catalog file option to load the install.wim file you just copied
- When you load the inastall.wim it will bring up a box with the edition you want to use. Select the version you used when creating your template VM above.
- Click File -> New Answer File and the Image Manager should look like this
- Generate the answer file from the Windows System Image Manager using the following steps:
- The first page you need to automate is the Language and Country or Region Selection page. To automate this, expand Components in your Windows Image pane, right-click and add the Microsoft-Windows-International-Core setting to Pass 7 oobeSystem. In your Answer File pane, configure the InputLocale, SystemLocale, UILanguage, and UserLocale with the appropriate settings for your language and country or region.
- You need to automate the Software License Terms Selection page, otherwise known as the End-User License Agreement (EULA). To do this, expand the Microsoft-Windows-Shell-Setup component. High-light the OOBE setting, and add the setting to the Pass 7 oobeSystem. In Settings, set HideEULAPage true.
- You need to automate is the Change Administrator Password page. Expand the Microsoft-Windows-Shell-Setup component (if it is not still expanded), expand UserAccounts, right-click on AdministratorPassword, and add the setting to the Pass 7 oobeSystem configuration pass of your answer file. Under Settings, specify a password next to Value
- Make sure the license key is properly set.
- The first page you need to automate is the Language and Country or Region Selection page. To automate this, expand Components in your Windows Image pane, right-click and add the Microsoft-Windows-International-Core setting to Pass 7 oobeSystem. In your Answer File pane, configure the InputLocale, SystemLocale, UILanguage, and UserLocale with the appropriate settings for your language and country or region.
- Click File -> Save Answer File As and place somewhere on your network where your Template VM can get to it.
Step 4: Template VM
- Build a Windows 2012 R2 Server VM from original media. Patch to current level
- Place that answer file we just created (unattend.xml) in the c:\windows\system32\sysprep folder.
- Enable the WMI firewall rules
- Also make sure RDP port 3389 is enabled incoming as well.
- XenServer tools must be installed
Step 5: Sysprep
- From your Windows 2012 R2 Template instance VM open an admin command prompt.
- Run the sysprep tool as follows:
- cd c:\Windows\System32\sysprep
- sysprep.exe /oobe /generalize /shutdown
- This will then shut the VM down when it’s done.
Step 5: Create the Template in XenCenter
- From XenCenter right click the template VM and select “Convert to Template”
- This will now be available to CLM as a template for use in Blueprints.