Using the System Preparation Tool (Sysprep) in an Image-Based Installation

Using the System Preparation Tool (Sysprep) in an Image-Based Installation

An average Windows XP installation can last for 90 minutes, and even more, considering all the hotfixes, service packs and applications you need to install. This can make OS installations extremely time consuming operation for the IT administrator.

One way to save this time is to deploy using an image-based installation.

In an image based installation, you can create image on one reference computer, and duplicate it to computers with the same hardware abstraction layer, meaning this computers will use the same hardware platform (CPU) and will use the same hal.dll file as an interface between the operating system and the hardware. When deploying computers using images, you copy the entire computer configuration including the computer name and SID (security identifier). You can use the SYSPREP tool to solve duplicate computer names and duplicate SIDs (security identifier) problem, caused by this method of deployment.

To deploy computers using image based application with the sysprep tool you should follow the steps outlined in this article.

Reference computer vs. the Target computers

The following table presents the hardware definition of the reference computer side by the target computers:

Reference computer

Target computer

HAL hardware abstraction layer. For example multiprocessor, MPS HAL, uniprocessor HAL, 32 bit processor HAL, 64 bit processor HAL.

Same as the reference computer. One of the key files of the operating system, is hal.dll, this file job is to transfer orders from the OS to the Hardware and back. If you are using different CPU technology on the target computer, this file won’t work.

mass–storage controllers IDE,SCSI)

Must be identical for the target computers to load the controller driver and boot.  if you using different controller you should edit the sysprep.inf file with [SysprepMassStorage] (described in the end of this article)

ACPI support

Same as reference computer

Plug and Play devices such as modems, sound cards, network cards, video cards

Can differ – as long as the driver resides on the driver.cab folder, or included on the reference computer. The target computer will recognize all Plug and Play devices and the drivers will be installed automatically. In addition to this you can add device driver that are not in the driver.cab folder by editing the sysprep.inf file, described at the end of this article.

HD size

At least the same or bigger. If the HD is bigger the primary partition on this computer will be in the same size as the reference computer primary partition.

Preparing the reference computer

The reference computer is master computer from which you will make your image to duplicate other computers. To prepare the reference computer:

  1. Install the OS (only Windows 2000/2003/XP are supported). Note: the reference computer cannot be member in domain.

  2. Configure components and setting, such as drivers, display settings Windows update etc. (Beware, if you have different settings you’ll have to use more than one image – or to use an answer file). 

  3. Install applications for the users, such as Microsoft Office, company applications and so on.  Note: for the users to see the application shortcut on their desktop in the duplicate computers, you will need to copy the profile of the user who installed them, to the "Default User" folder in "Documents and Settings".

Running SYSPREP to prevent duplicate id

You should know that computers on the network cannot have the same name or the same SID (security identifier). In this kind of installation you will have to deal with this problem since you are about to duplicate computers.

One method to deal with this issue is to use the SYSPREP tool provided by Microsoft. The SYSPREP tool can be found on the Windows XP installation CD, or as a download from Microsoft’s website.

The SYSPREP tool which will be running on the reference computer will remove the computer name and SID, along with other identifiers such as the IP address, the CD Key, regional settings and EULA agreement

You do not need to be worried, on the duplicated computers SYSPREP will ask for the new computer name and will generate a new SID, with a special wizard that will be shown right after duplicating the image. This wizard is called the Mini setup Wizard.

To run SYSPREP:

Log on to the reference computer as administrator.

Create folder in %systemdrive% called "SYSPREP".

Insert your installation CD and navigate to the Deploy.cab folder in the ‘Support’Tools folder. You can also download it from this page: Download Windows XP SP2 and Windows 2003 SP1 Deploy Tools. Extract the setupcl.exe, factory.exe and sysprep.exe from the deploy.cab to the SYSPREP folder that you have created in step 2.

Run the SYSPREP program from %systemdrive%’sysrpep, by double clicking it or from the command line.

You will get the following window in which you’ll have to choose which option of  SYSPREP tool you want to use:

The reseal button/parameter will prepare your reference computer to the final image. After choosing this option the computer will restart and a Mini setup wizard will welcome you. Use this when the reference computer is done and no other change to the image is required.

Running SYSPREP –reseal at the command prompt will get the same result.

The audit boot button will restart the reference computer as is, with no wizards, just for examination and test on the reference computer. Use this option if you want to test the reference computer after booting but without resealing it.

The factory button/parameter will boot the reference computer, but to "Network–Enabled state" without starting Windows Welcome or Mini Setup wizard. In this state the reference computer will process a file named Winbom.ini which contains information about device drivers, time zones, network etc. the Winbom.ini can be created using the OPK (OEM pre-installation kit). Use this option when your duplicate computers need different settings, provided by different winbom.ini files. This parameter is perfect for OEM installation with different configurations.

Running SYSPREP –factory at the command prompt will get the same result.

Additional parameters and flags exist.

Using disk imaging application to capture the reference computer

Now that you’ve finished creating the reference computer and used SYSPREP on it, you can use an imaging application to create image and duplicate it.

Here are several disk imaging applications that you can use:

  • Acronis True Image by Acronis

  • Norton Ghost by Symantec

  • Exact Image 7

  • R-Drive Image by R–tools Technology

  • 7tools Partition Imager by Paragon Technologies

  • Image for Windows by Terabyte Unlimited

The disk imaging application will save your reference computer disk in to a file. You can save this file on CD-ROM, DVD, or on the target computer’s hard drive.                         

For example, Norton Ghost will create *gho file that you can expand on the target computer.

After using the disk imaging program, copy the image from the reference computer to the target computers and reboot, the Mini setup wizard will appear on them.

Note: SYSPREP is responsible for the appearance of the Mini setup wizard.

The Mini setup wizard

The wizard will prompt the user with some or all of the following screens:

  • Welcome

  • Microsoft License Agreement

  • Product ID

  • Regional settings

  • User name and company

  • Computer name

  • Network configuration

  • Join workgroup or domain (workstation only(

  • Server licensing (server only)

  • Time-zone selection

After finishing the Mini setup wizard, the %systemdrive%’sysprep’sysprep.pcl and the %systemdrive%’sysprep’sysprep.exe files will be deleted, insuring SYSPREP will not run again on the next boot.

Then the computers reboot, they will do so with the new configuration and with their own computer names and SIDs.

However, one small problem still exists: who’s going to provide all required information to the Mini setup wizard on all duplicate computers? Imagine running from one computer to the other, manually entering the CD Key or computer name. This is not feasible when more than a few computers are involved in the imaging process.

Luckily for us, we can create an answer file.

Using the Setup Manager to create answer file for the Mini setup wizard

You can create an answer file for the Mini setup wizard by using a Microsoft tool called "Setup Manager". The answer file’s name has to be "sysprep.inf" and in order for the Mini setup Wizard to use it, you should run the SYSPREP with the –mini parameter. To create answer file follow these steps:

  1. Extract setupmgr.exe from support’tools’deploy.cab on the installation CD to your %systemdrive%’sysprep folder.

  2. Navigate to %systemdrive%’sysprep and run setup manager.

  3. Follow the welcome screens and the instructions and choose to create SYSPREP answer file.

  4. Answer the questions and save the file as sysprep.inf on your %systemroot%’sysprep folder. Note: you have to save the file on this folder as this is the place where SYSPREP on the target computers will look for it. You can also save the file on a floppy disk, but beware to insert the floppy on the beginning of the Mini setup wizard. 

  5. The sysprep.inf format looks like this:

​[Unattended]
ExtendOemPartition
OemPnPDriversPath
OemSkipEula
InstallFilesPath
KeepPageFile
ResetSourcePath
UpdateHAL
UpdateUPHAL
UpdateInstalledDrivers
TapiConfigured
[GuiUnattended]
AdminPassword
Autologon
AutoLogonCount
OEMDuplicatorString
OEMSkipRegional
OEMSkipWelcome
TimeZone
[UserData]
Supports the same set of entries as the Unattend.txt file.
[LicenseFilePrintData]
Supports the same set of entries as the Unattend.txt file.
[GuiRunOnce]
Supports the same set of entries as the Unattend.txt file.
[Display]
Supports the same set of entries as the Unattend.txt file.
[RegionalSettings]
Supports the same set of entries as the Unattend.txt file.
[Networking]
Supports the same set of entries as the Unattend.txt file.
[Identification]
Supports the same set of entries as the Unattend.txt file.
[TapiLocation]
[Sysprep]

You can read more about the sysprep.inf file in the ref.chm help file found within depploy.cab.

Using SYSPREP for different mass storage devices

If you go back to the table in the beginning of the article that points out the reference computer vs. the target computer, you will notice that they have to be with the same mass storage device controller in order for the target computer to recognize the controller, load the driver and boot from it. If the reference computer and target computer do not share same mass storage device controller, and you duplicated the disk with no further configuration, the target computers will attempt to start, won’t find the controller driver and you will get this error message (BSOD or Blue Screen of Death):

​stop: 07b inaccessible_boot_device.

To deal with this you can load different mass storage driver by using SYSPREP and editing the sysprep.inf file:

  1. On the reference computer open sysprep.inf with notepad and add the following under the [sysprep] section:

​BuildMassStorageSection=Yes
[SysprepMassStorage]
  1. Under the value that you added, write the id and path for each storage device driver that you want to load on the reference computer:

​PCI'VEN_10B9&DEV_5215=%systemroot%'inf'mshdc.inf
PCI'VEN_10B9&DEV_5219=%systemroot%'inf'mshdc.inf
PCI'VEN_10B9&DEV_5229=%systemroot%'inf'mshdc.inf
PCI'VEN_1097&DEV_0038=%systemroot%'inf'mshdc.inf
PCI'VEN_1095&DEV_0640=%systemroot%'inf'mshdc.inf
PCI'VEN_1095&DEV_0646=%systemroot%'inf'mshdc.inf
PCI'VEN_0E11&DEV_AE33=%systemroot%'inf'mshdc.inf
PCI'VEN_8086&DEV_1222=%systemroot%'inf'mshdc.inf

After editing the sysprep.inf file you should run SYSPREP.exe on the reference computer with the –bsmd parameter, this will build a list of the mass storage devices that you supplied in the sysprep.inf file and will enable the target computers to start the image with different mass storage device that you supplied in the sysprep.inf file.

How to edit the sysprep.inf file to load device drivers that are not included on Windows

If you have device drivers that are not included in Windows Driver.cab folder but you want to install them on the target computers, do this:

  1. Copy the desired drivers to a folder on %systemdrive%, let’s say to c:’drivers. Create subfolder for each driver.

  2. Open the sysprep.inf file and add OemPnPDriversPath = Driver_Paths under the [Unattended] portion.

  3. Run sysprep –reseal -pnp. The –pnp parameter enforces Plug and Play driver detection on the target computers. If you want to avoid problems with unsigned drivers add this parameter "DriverSigningPolicy=ignore" to the sysprep.inf file.

In summary

That’s it, no more wasting all your time on OS installation and running from one computer to the other. Prepare your image, run SYSPREP on it and earn you some free time. Now that you got your free time, you can use it to learn about "ImageX", the Windows Vista imaging format.  

Related articles

You may also want to read:

Links

Use Setup Manager to Create an Answer File in Windows Server 2003 – 323438link out ico

Use Setup Manager to Create an Answer File in Windows 2000 – 308662link out ico

Updated System Preparation tool for Windows XP Service Pack 2, Windows Server 2003, and Windows XP Tablet PC Edition 2005 – 838080link out ico

Automating Tasks Before Mipetri-Setuplink out ico

Automating Tasks After Mipetri-Setuplink out ico