Using Sysprep in Windows Embedded Standard 2009
In Windows Embedded Standard, the next generation of Windows XP Embedded, several new features make their debut. One of the new features that are included in this new product is the Windows System Preparation Tool (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.
For more information about Sysprep, see this Microsoft Web site.
For more information about Microsoft OEM Preinstallation Kits, see this Microsoft Web site.
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 that is 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 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.
For more information about System Cloning Tool, see this Microsoft Web site.
Settings of System Cloning Tool Component
The Sysprep component can also configure settings, although only on a running image. It cannot keep some settings that are configured before Sysprep runs.
Settings of Sysprep Component
It must be noted that, although the full functionality of Sysprep is available, we did not change the Sysprep binaries from the OPK at all. Sysprep in Windows Embedded Standard does not replace the System Cloning Tool. It is included to enable another great new feature. The System Center Configuration Manager (ConfigMgr) Operating System Deployment (OSD) functionality enables embedded images to be deployed to the destination development workstation in an enterprise, using ConfigMgr. 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.
For more information about System Center Configuration Manager Operating System Deployment, see this Microsoft Web site.
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 want. 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 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 these two modes to the developer through the configurable settings in Target Designer. The default mode is Mini-Setup.
Sysprep can be run by double-clicking Sysprep.exe in the Sysprep folder of an image, or at a command prompt. When Sysprep is started, the Sysprep dialog box is displayed to let the user choose which function of Sysprep to run, Factory, Audit, or Reseal. You can also select options, such as Mini-Setup mode, and Shutdown or Restart 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, which enables ConfigMgr OSD, the only Sysprep function that is currently supported is the Reseal function.
Selecting Sysprep settings for Mini-Setup mode
After you seal the image, it will restarts into the abbreviated setup and prompts you to configure the development workstation through a series of dialog boxes, as illustrated by the following screen shots:
Configuring personalized settings during Mini-Setup
Configuring user settings
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. This process can be automated by running Sysprep using the -quiet switch so that 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.
Running Sysprep command switches with Sysprep.inf file for fully automated process
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:
Set OemSkipRegional equal to 1.
JoinWorkgroup (join a workgroup)
Additional settings that may be useful for embedded images include the following:
Here is an example of a real Sysprep.inf file:
There are many more settings that are used by Sysprep, but not all of them are supported in Windows Embedded Standard as they are not required for the ConfigMgr OSD scenario. Configuring these additional settings through Sysprep.inf may require additional feature components to be added to the run-time image.
You can manually create a Sysprep.inf file by using a 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.
If you include the Enhanced Write Filter (EWF) or File Based Write Filter (FBWF) component in your image, you must disable them before running Sysprep. After running Sysprep, you can clone the image to other devices without additional processing if you use FBWF or EWF RAM-REG mode. This works because FBWF and EWF RAM-REG do not use a special partition. EWF RAM-REG mode stores the EWF Overlay in RAM and the EWF volume in the registry.
When you use EWF RAM or EWF Disk mode, the EWF volume is normally created on the master image by the First Boot Agent (FBA) process. By cloning the master image, you bypass the full FBA process on target devices. This means that the EWF volume is not created. Your choice of cloning utility determines whether the EWF volume will be copied from the master image to the target device. If your cloning utility creates an exact, sector-by-sector duplicate of the master image, the EWF volume will be on the target device. If your duplication utility is file-based, it will not recognize the EWF volume, and will not copy it. In that case you must create a new EWF volume on the target device after cloning by running the following command in a script or from the RunOnce section of the registry:
"rundll32 ewfdll.dll ConfigureEwf"
If your target device uses multiple physical storage media, when you run the |
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 run-time images 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. However, Sysprep 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 run-time image is deployed.
Here is a comparison of System Cloning Tool and Sysprep settings:
|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.
The "[Identification]" section of Sysprep.inf is a required field in fully automated setup. To make sure that a domain-joined computer reconnects to the domain, set the values JOINDOMAIN, DOMAINADMIN, DOMAINADMINPASSWORD, or use the “JOINWORKGROUP” value.
Remove\Keep Autologon Settings
To enable 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 the Autologon 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. You cannot 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. You cannot configure this in Sysprep.inf.