| Using Sysprep in Windows Embedded Standard 2009 |
by Lynda Allen (Nov. 5, 2008)
Foreword -- This whitepaper highlights a key feature of Microsoft's Windows Embedded Standard 2009 operating system. The new Windows System Preparation Tool (Sysprep) makes it easier to roll out the OS on multiple devices, as the author explains.
Using Sysprep in Windows Embedded Standard 2009 by Lynda Allen
Overview of Sysprep in Windows Embedded Standard
Sysprep modes
Automating Sysprep
Comparing Sysprep and System Cloning Tool
Overview of Sysprep
Sysprep is a tool that usually ships as part of an OEM Preinstallation Kit (OPK). It is a technology that you can use with other deployment tools to install Microsoft Windows operating systems with minimal intervention by an administrator or technician.
Sysprep is typically used during large-scale rollouts when it would be too slow and costly to have administrators or technicians interactively install the operating system on individual computers. This process of creating a master image that can then be customized and deployed to multiple computers is known as cloning.
A master image has all computer-specific information stripped from it, such as the security ID (SID), the computer name, and user settings, by Sysprep. This master image can then be deployed to multiple computers that have basically the same hardware.
Sysprep assigns a unique SID to each cloned image the first time that it starts, and at this point can also apply any number of custom settings, either by prompting the user to specify these settings in a UI, or parsing an answer file included with the image that specifies the settings you want. Each cloned image now runs through a setup process that takes only a few minutes, instead of full setup.
In Windows XP Embedded, we offered an embedded version of cloning technology through the System Cloning Tool. This tool lets developers specify when they want to "seal" the image to create the master image, either at the end of setup, or after some customization. You can also configure some settings offline before the image is deployed and run through setup. This may reduce the amount of customization that must be done after the image has restarted.
 Figure 1 -- Settings of System Cloning Tool component (Click to enlarge) The Sysprep component can also configure settings. However, it can only do so on a running image, and cannot keep some settings that were configured before Sysprep ran.
 Figure 2 -- Settings of Sysprep component (Click to enlarge) It must be noted that, although the full functionality of Sysprep is available, we did not modify the Sysprep binaries from the OPK at all. Sysprep in Windows Embedded Standard does not replace the System Cloning Tool, which is still included, enabling another great new feature. The System Center Configuration Manager (SCCM) Operating System Deployment (OSD) functionality enables embedded images to be deployed to the destination development workstation in an enterprise using SCCM.
The "Mini-Setup" mode of Sysprep is used in this scenario to apply certain settings to the destination development workstations, such as joining a domain, setting an administrator password and so on, after they are deployed. Notice that the System Cloning Tool and the Sysprep components cannot be located in the same configuration.
Sysprep Modes
There are two modes that Sysprep can run under: Windows Welcome and Mini-Setup. Windows Welcome is intended for the first user of the development workstation to set it up as they desire. This is not a scenario that seems applicable to an embedded device, where the OEM configures the features and settings, depending on the type of device they are creating and how it will be used in the field.
The Windows Welcome method also uses lots of graphics, and the inclusion of these files in an embedded image has a footprint effect. Mini-Setup, on the other hand, is a shortened GUI-mode setup, and it prompts the end-user only for required user-specific information, such as accepting the Microsoft Software License Terms, entering the product key, and entering the user name and company name.
The Sysprep component in the Windows Embedded Standard database does offer both of the above modes to the developer through the configurable settings in Target Designer. However, the default mode is Mini-Setup.
Sysprep can be run by double-clicking the file Sysprep.exe in the Sysprep folder of an image, or at a command prompt. When Sysprep is started, the Sysprep dialog box opens to let the user choose which function of Sysprep to run: Factory, Audit, or Reseal. Options can also be selected, such as Mini-Setup mode, and Shutdown or Reboot of the development workstation after Sysprep has finished.
Sysprep functions can also be specified with switches at a command prompt. For the purposes of our embedded scenario, enabling SCCM OSD, the only Sysprep function that is currently supported is the Reseal function.
 Figure 3 -- Selecting Sysprep Settings for Mini-Setup mode (Click to enlarge) After you seal the image, it will restart into the abbreviated setup and prompt you to configure the development workstation through a series of dialog boxes, as illustrated by the following screen shots:
 Figure 4 -- Configuring personalized settings during Mini-Setup (Click to enlarge)
 Figure 5 – Configuring user settings (Click to enlarge)
Automating Sysprep
Sysprep can also be fully automated, so that no user interaction is required to configure the cloned development workstation after it is deployed. This is ideal for an embedded device.
When the Mini mode of Sysprep is selected or the -mini switch is specified at a command prompt, Sysprep looks for Sysprep.inf in the same folder as Sysprep.exe (%Systemdrive%\Sysprep), and parses the development workstation information in the .inf, and then applies the appropriate settings as soon as the cloned development workstation restarts for the first time.
The above process can be automated by running Sysprep using the -quiet switch, so no user interaction is required. If the system does not detect Sysprep.inf in the same folder as Sysprep.exe, or if one of the required settings is missing or incorrect, then Setup will revert to the GUI mode and prompt the user for the information.
 Figure 6 – Running sysprep command switches with sysprep.inf file for fully automated process (Click to enlarge) The following is a list of the minimal sections that must be in the Sysprep.inf in order to fully automate the Mini Setup process:
[GuiUnattended] Set OemSkipRegional equal to 1.
[UserData] FullName OrgName
[UserData] ComputerName ProductID
[GuiUnattended] AdminPassword
[GuiUnattended] TimeZone
[Networking] [Identification] JoinWorkgroup (join a workgroup)
Additional settings that may be useful for embedded images include the following:
[Unattended] OemSkipEula
[GuiUnattended] Autologon AutoLogonCount OEMSkipWelcome
Here is an example of a real sysprep.inf file:
 Figure 7 -- Example of a sysprep.inf file (Click to enlarge) There are many more settings used by Sysprep, but not all of them are supported in Windows Embedded Standard as they are not required for the SCCM OSD scenario. Configuring these additional settings through Sysprep.inf may require additional feature components to be added to the runtime.
You can manually create a Sysprep.inf file using any text editor or you can use the utility provided with the OPK toolkit called Setup Manager (Setupmgr.exe). This file is not owned by a component in the database because it is used on the development workstation and not the destination development workstation, but it can be found in the repository.
Comparing Sysprep and System Cloning Tool
Finally, although the basic functionality of Sysprep and the System Cloning Tool are the same, creating master images, there are some differences in how they can be used in Windows Embedded Standard.
The System Cloning Tool is an embedded enabling feature, and therefore is written specifically for how embedded runtimes are created and deployed. This can be seen in the way that the System Cloning Tool can be configured offline in Target Designer to keep or discard certain settings after cloning.
Sysprep, on the other hand, is a more general purpose tool targeting desktop systems and therefore is not optimized in the same manner for use on embedded devices. Some settings configured offline can be kept after cloning using Sysprep, but some can only be configured after the runtime is deployed.
In conclusion, here is a comparison of the two:
System Cloning Tool | Sysprep | Generate New Computer Name | To keep the same computer name that was specified in Target Designer, set the value "ComputerName" to that computer name in section "[UserData]" of Sysprep.inf. If this value is not set Sysprep will generate a random computer name. | Join/Unjoin Domain | The "[Identification]" section of Sysprep.inf is a required field in fully automated setup. To make sure a domain-joined computer reconnects to the domain, set the values JOINDOMAIN, DOMAINADMIN, DOMAINADMINPASSWORD, or use the "JOINWORKGROUP" value. | Remove/Keep Autologon Settings | Toenable the autologon function, set the values ADMINPASSWORD=*, AUTOLOGON=YES, AUTOLOGONCOUNT=X in section [GuiUnattended] of Sysprep.inf. If these values are not specified, even if theAutologon component is configured in Target Designer, autologon will be disabled. | Remove/Keep Custom Network Settings | Configured network settings such as network protocols and services will not be retained automatically after reseal. These network settings can be configured in sysprep.inf in the [Networking] section. | Remove/Keep Custom User Settings | Configured user settings such as desktop background, visual effects, Start menu and folder options will be retained after reseal. There is no way to remove these custom user settings through Sysprep.inf. |
Remove/Keep Mounted Devices | Mounted drives such as a drive mapped to a network share, or a drive letter change will not be retained on reseal. There is no way to configure this in Sysprep.inf. |
Copyright (c) 2008 Microsoft Corp. All rights reserved. Reproduced by WindowsForDevices.com with permission.
About the author: Lynda Allen has been a member of Microsoft's Windows Embedded Test team for more than four years, and originally hails from South Africa.
Previous whitepapers devoted to Windows XP Embedded
WindowsForDevices coverage of Windows Embedded Standard
(Click here for further information)
|
|
|
|
|
|
|