Customizing the Windows Server 2012 & 2008 and Windows 8 & 7 Provisioning Process |
|
|
|
|
||
Customizing the Windows Server 2012 & 2008 and Windows 8 & 7 Provisioning Process |
|
|
|
|
|
|
|
||
If you Windows ISOs are missing Windows drivers, you may inject drivers into your Windows ISOs using a Windows Customization and Driver Injection Utility.
After provisioning templates and roles have been created, the provisioning process can be tuned and enhanced to include the installation of applications, the execution of scripts and the copying of files onto the system being provisioned.
For the examples provided below, we created a Windows Server 2012 R2 Data Center Installation Instance named ws2012r2dc.
Editing the Provisioner PXE Server unattend.xml File
The unattend.xml file can be found at in any Install Instance directory, and will have the name of the Install Instance followed by the ".xml" extension.
/home/tftpboot/pub/ws2012r2dc/ws2012r2dc.xml This file contains the answers to questions that you would normally enter on the client system during a manual, interactive installation. Exercise caution when editing this file with winDOSfileEdit.sh, as syntax errors are easily introduced and lead to unpredictable results on the client system during provisioning. A typical "non-destructive" way to use this file is to update the Product Key, should it have been entered incorrectly when creating the Install Instance. Additional resources: •http://technet.microsoft.com/en-us/library/ff699026.aspx •http://www.sergeyv.com/blog/archive/2010/05/07/unattended-install-of-windows-server-2008-r2.aspx
IMPORTANT: while editing the unattend.xml can be a powerful way of customizing a Windows installation, changes to the unattend.xml file are extremely difficult to troubleshoot. We find that many of the examples available on the Web have incorrect syntax, and diagnosing incorrect syntax in the unattend.xml file will take an undetermined about of time. Instead, we recommend using the Provisioner PXE Server framework to copy files to and execute scripts on the Client system after Windows has been installed. This way, if a script initially fails to perform as expected, you still have a fully provisioned Windows system that you can troubleshoot and more easily fix by re-executing the script on the Client system until it works. The framework is described below. |
Copy Folders and Files from the Provisioner PXE Server to C:\ of the Provisioned Windows Client
Place files (and folders/directories) to be copied to the C:\ drive of the client system in: /home/tftpboot/pub/ws2012r2dc/postinstall/addfiles/
These files (or entire directory/folder structures) will be copied to the client system starting at: C:\
The Provisioner PXE Server deploys a sample folder and 2 sample files on each Windows Server 2012 & 2008 or Windows 8 & 7 system it provisions. A new directory was created for this example, and the files placed inside it: /home/tftpboot/pub/ws2012r2dc/postinstall/addfiles/postinstall/ You can locate the folder and the files in on the provisioned in: c:\postinstall LinMinExample.cmd (a sample script that executes and generates the file LinMinExample.log) LinMinExample.txt (a sample text file)
If you see these files, then the Provisioner PXE Server properly copied the sample folder and files.
|
Executing Post-Install Scripts on the Provisioned Windows Client
A script has been created for you to place your own scripting code to be executed on the provisioned client system after Windows has been installed: /home/tftpboot/pub/ws2012r2dc/postinstall/w2k8_r2_datacentercoreuser.cmd This script executes commands and places the resulting files in: c:\postinstall
The Provisioning Server deploys and executes a sample script on each Windows Server 2012 & 2008 or Windows 8 & 7 system it provisions. See the file LinMinExample.cmd in the directory: /home/tftpboot/pub/ws2012r2dc/postinstall/addfiles/postinstall/
If the script is properly copied and executed, you will see the resulting file on the provisioned client system in: c:\postinstall LinMinExample.log
If you see the file LinMinExample.log, then the Provisioner PXE Server properly copied and executed the sample script. Always use winDOSfileEdit.sh to edit this file and add scripts. Using traditional text editors may introduce special invisible characters into the files you edit, causing them to fail on the Windows client system in ways difficult to diagnose. |
When Editing .xml, .cmd and .bat Files
When editing .xml, .cmd, .bat, and some .txt files located in the Install Instance directory and that are copied to the client Windows system as outlined in the examples above, always use the editor winDOSfileEdit.sh. This editor is conveniently located in each directory where there are files you may decide to edit. Using traditional text editors may introduce special invisible characters into the files you edit, causing them to fail on the Windows client system in ways difficult to diagnose. If editing files on an editor other than winDOSfileEdit.sh supplied with your Provisioner PXE Server, set your editor preferences to "UNIX" (or "Linux") End of Line termination before editing files.
When remote and if you have ssh access, use a command line editor such as vi or nano. When launching nano, use the -r 1024 parameter to ensure that lines longer than 80 characters do not get split into multiple lines when saved: # nano -r 1024 <path-filename>
When done editing and saving: # unix2dos <path-filename>
After editing files, run the file command to verify the EOL termination syntax. For example: # file home/tftpboot/pub/ws2012r2dc/*xml The file command has confirmed the existence of proper End of Line terminators. The file command return must show 'with CRLF line terminators' and NOT SHOW 'with CRLF, LF line terminators' in order to properly work on Windows Clients. |
•Windows Customization and Driver Injection Utilities •The Petri IT Knowledgebase contains instructions on configuring network and other settings that can be executed in post-installation scripts. You can review the syntax of most commands by entering "/?" after it, for example, C:\> netsh /? •http://www.sergeyv.com/blog/archive/2010/05/07/unattended-install-of-windows-server-2008-r2.aspx
|
Adding Drivers to the Windows Server 2012 & 2008 or Windows 8 & 7 ISO
At this time, Provisioner does not include a method to add Windows Server 2012 & 2008 or Windows 8 & 7 drivers to the install media as it does for Windows Server 2003/XP. Provisioner's Windows Server 2012 & 2008 and Windows 8 & 7 provisioning method does not require Windows-specific NIC drivers, but rather is uses different technology (Live-Ubuntu) to transport the Provisioner PXE Server-ready Windows ISO to the client system before executing the installation locally.
To add drivers (and more) to your Windows ISO, use a Windows Customization and Driver Injection Utility to inject the drivers and other content into the ISO source image, then process the ISO as you would any Microsoft-supplied ISO.
The XML changes referenced would be made to the Provisioner PXE Server .xml files (as referenced above in this Topic). There is an alternative tool, vLite, but it is not licensed for commercial use and therefore we cannot recommend it. |