• No results found

SysPrepping the Reference Machine

When installing a Windows operating system using a WIM image created from a reference machine, as is done in WIM-based provisioning, the System Preparation Utility for Windows (SysPrep) is used to:

Generalize system settings and information such as computer name and SID while retaining the reference machine’s installed applications and the default profile, deleting temporary files and (optionally) user accounts, and enabling entry of new license keys

Place the \reference system in a state in which it will reinstall itself into a fresh deployment when booted

Specify individual attributes for the provisioned machine, for instance a particular language/ locale/time zone combination or a specific domain account to be added to the local Administra- tors group,

Release 5.2 25 VMware Documentation vCloud Automation Center Operating Guide

Creating a SysPrep answer file on the machine (the format of this file differs depending on the operating system of the machine)

Running the sysprep command with the appropriate options

When a SysPrepped machine is next booted, the settings specified in the answer file are applied. There are two ways to SysPrep machines provisioned by vCAC using WIM-based provisioning:

SysPrep the reference machine before creating the WIM image. This step is required.

Use custom properties in the blueprint from which the machine is provisioned to specify certain individual SysPrep settings, causing the vCAC guest agent to SysPrep each newly provisioned machine with those settings during the WinPE phase. The specified settings are added to or overwrite settings in the existing SysPrep answer file.

Combining these two methods allows for two levels of SysPrep—one applied to the reference machine and included in the WIM image, the other applied to machines provisioned during the WinPE phase with the various blueprints you create. For example, you might want to apply the same SysPrep.User- Data.OrgName setting to all your WIM images, but use blueprints to apply SysPrep.UserData.FullName during postprovisioning customization,

Table 3 lists the custom properties that you can use in a blueprint to apply SysPrep information during the WinPE phase. Not all of the custom properties apply to all Windows platforms.

Table 3 Postprovisioning SysPrep for Windows Platforms

These settings are applied using the Sysprep.Section.Key custom property, for example Sysprep.Unat- tended.OemSkipEula.

Some required SysPrep settings for WIM-based provisioning are not included in this set. You must there- fore ensure that all needed settings are included in the answer file on the reference machine from which the WIM file is created.

Section Custom Property

GuiUnattended Sysprep.GuiUnattended.AdminPassword Sysprep.GuiUnattended.TimeZone

Sysprep.GuiUnattended.OemSkipWelcome Sysprep.GuiUnattended.OemSkipRegional

Identification Sysprep.Identification.JoinDomain, Sysprep.Identification.DomainAdmin, Sys-prep.Identification.DomainAdminPassword Sysprep.Identification.JoinWorkgroup Unattended Sysprep.Unattended.OemSkipEula UserData Sysprep.UserData.ProductKey Sysprep.UserData.FullName Sysprep.UserData.ComputerName Sysprep.UserData.OrgName

The procedure for SysPrepping the reference machine differs depending on whether it is a Windows Server 2003/Windows XP system or any other Windows system.

Use the following procedure to SysPrep a Windows Server 2003 or Windows XP reference machine. 1. Create the directory %SystemDrive%\SysPrep.

2. Copy the contents of \support\tools\deploy.cab from the reference machine’s original installa- tion medium or an image of the reference machine’s operating system into %System-

Drive%\SysPrep. Unpack the contents of deploy.cab.

3. Copy the i386, amd64 or ia64 folder from the reference machine’s original installation medium or an image of the reference machine’s operating system into %SystemDrive%\SysPrep. 4. Use Windows Setup Manager (setupmgr.exe) to create a SysPrep.inf answer file. Ensure that

connections by Remote Desktop Protocol are enabled, and that the machine will be joined to the domain in which you enabled remote WMI requests as described earlier in this chapter. (You can also copy a prepared SysPrep.inf answer file from another location into the %System- Drive%\SysPrep directory.)

The following settings in the GuiUnattended section must be included in the SysPrep of machines provisioned using WIM-based provisioning:

AutoLogon=Yes AutoLogonCount=1

AutoLogonUsername=username

AutoLogonPassword=password

where username/password are the credentials used for autologon when the newly provisioned- machine boots into the guest operating system. Administrator is typically used.

5. Execute the following command:

%SystemDrive%\sysprep\sysprep.exe –mini –reseal

When processing is complete, the system shuts down.

Use the following procedure to add a SysPrep answer file to a Windows reference machine that is not a Windows Server 2003/Windows XP system and run SysPrep.

To provide maximum precision in the process of creating an answer file for these operating systems, a specially prepared master system is typically used for this purpose. (It is also possible to perform the procedure on the reference machine itself.) Like the reference machine itself, the master system must have the following installed:

.NET 4.5 (see http://msdn.microsoft.com/en-us/netframework/aa569263.aspx)

Windows Automated Installation Kit (AIK) for Windows 7 (including WinPE 3.0) (see http:// www.microsoft.com/downloads/details.aspx?FamilyID=696dd665-9f76-4177-a811- 39c26d3b3b34&displaylang=en)

Note: After installing Windows AIK you must reboot the machine before proceeding, although the installer does not prompt you to do so.

The following procedure assumes a master system is used to create the answer file. 1. Mount the Windows CD or ISO image so that it is available to the master system.

Release 5.2 27 VMware Documentation vCloud Automation Center Operating Guide

2. On the master system, open Windows System Image Manager (SIM) using Start > All Pro- grams > Microsoft Windows AIK > Windows System Image Manager.

3. Use File > Select Windows Image to browse to the sources folder on the CD or ISO and select

install.wim, then open it. A dialog appears listing operating system versions you can use as the master image. Select the version you want and click OK. The selected image is loaded into SIM and displayed. (If the catalog file is not present, SIM may need to create it first.)

4. Select File > New Answer File. The master image and a new answer file are now both loaded into SIM and associated. Select File > Save Answer File and save the answer file as Unat- tend.xml, then begin specifying customization settings as described in the following steps. 5. Expand the Components folder in the Windows Image pane.

6. Drag the appropriate Microsoft-Windows-Security component from the Windows Image pane to 3 generalize in the Components folder in the Answer File pane. Then drag the same com- ponent to 4 specialize.

7. Specify product key, registered owner name, and time zone settings by dragging the appropriate

Microsoft Windows Shelf-Setup component to 4 specialize, and providing the desired values. 8. Ensure that the machine will be joined to the domain in which you enabled remote WMI requests earlier in this chapter by dragging the appropriate Microsoft-Windows-UnattendedJoin com- ponent to 4 specialize, expanding it and selecting Identification, then providing the desired information.

9. You must enable autologon when the newly provisioned machine is booted into WinPE. Do this by dragging the appropriate Microsoft Windows Shelf-Setup component to 7 oobeSystem, expanding it, selecting AutoLogon, and setting the following

Enabled=Yes

LogonCount=1

Username=username

Password=password

where username/password are placeholders for the actual credentials used for autologon when the newly provisioned machine boots into the guest operating system. SysPrep provides the actual credentials which are user name Administrator and the password set by the custom property Sysprep.GuiUnattended.AdminPassword.

Note: You must set the autologon password with the custom property Sysprep.Gui- Unattended.AdminPassword for reference machines that use a Windows platform newer than Windows Server 2003/Windows XP.

You can also use this component to disable display of the EULA, configure the screen resolution and color depth (for example, 1280x960 is best for WMware full screen mode) and specify a default local administrator account password.

10. Configure Remote Desktop Connections as follows:

a. Open OS_Version > Components in the Windows Image pane, right-clicking Microsoft- Windows-TerminalServices-LocalSessionManager, and selecting Add Setting to Pass 4 specialize to add it to the Answer File pane under 4 specialize. Select the component and set fDenyTSConnections to false.

b. As above, select Microsoft-Windows-TerminalServices-RDP-WinStationExtensions in the Windows Image pane, add it to 4 specialize, and set UserAuthentication to 0 (zero). c. As above, select the FirewalllGroup subcomponent of the main Networking-MPSSVC-

Svc component in the Windows Image pane to 4 specialize and specify the following:

Active=true

Group=Remote Desktop

Key=rd1

Profile=all

Other common customizations you may want to add include the following:

Assigning an auto-generated computer name

Setting organization and owner Information

Setting language and locale

Setting the initial tasks screen not to show at logon

Creating a second administrative account and setting the password

Running a post-image configuration script under the administrator account at logon

Disable the initial configuration dialog and auto-start of the server manager application

Setting automatic updates to not configured (to be configured post-image)

Configuring the network location

11. Once you are satisfied with your answer file, select File > Save Answer File and save the final answer file.

12. Copy the answer file to %Windir%\Panther\unattend.xml on the reference machine. 13. On the reference machine, open a command window, change to %Windir%\System32\Sys-

prep, and enter this command

sysprep /generalize /oobe /shutdown /unattend:%WinDir%\panther\unattend.xml

A popup windows displays SysPrep is processing the answer file. When processing is com- plete, the system shuts down.