One of the most important features in Windows XP, from a corporate standpoint, is its support for disk cloning. If you ever need to deploy multiple desktops that are configured identically (and who doesn’t?), you’re likely to find yourself singing the praises of WinXP’s disk imaging support. Whether you’re working in a large enterprise environment, administering systems for a small business, preparing for an MCP exam, or any combination of the above, you need to be familiar with the XP disk imaging process.
The Sysprep story
Disk cloning isn’t new, of course. The process of installing an operating system, adding software applications, configuring the system for network use, and then creating a duplicate disk image has been around for years.
Typically, administrators use a third-party program, such as Powerquest’s Drive Image or Symantec’s Ghost, to create the cloned image. None of that changes in Windows XP. However, XP includes a program, Sysprep.exe (which was introduced in Windows 2000), to help accelerate the imaging process for your third-party cloning utilities. Sysprep improves disk image deployments by preparing the disk for imaging and creating security account information unique to each machine.
The first time a user logs on to a system that has been deployed using Sysprep, a mini-Setup program runs. When the mini-Setup finishes, Windows XP generates a new user account and security identifier (SID). The creation of new SIDs is one of the most important functions of the Sysprep tool. This step prevents duplicate SIDs from existing on the same network, which would cause trouble in both workgroup and domain environments.
Before we look at how you can put Sysprep to work, here’s a quick overview of the terms we’ll use to describe the process. Microsoft calls the system you use to prepare the image the reference machine. The machine that distributes the cloned image is called the distribution system. The system that receives the image is the destinationmachine. All of this is illustrated in Figure A.
|Disk cloning requires a reference machine, a distribution system, and a destination machine.|
Steps to follow
Sysprep use is fairly straightforward. First, you need to create the image you want to duplicate. You should perform this action on the reference machine. Load Windows XP with as many applications, services, and customized settings as you want to deploy to future systems.
Once the disk is configured, verify that the operating system and applications are working properly. Really. Do it. The world will wait. You’ll thank yourself later.
The next step is to execute Sysprep.exe from a command line—but first, you’ll need to find it. You have to extract Sysprep.exe and Setupcl.exe from the Deploy.cab file found in the \Support\Tools folder on the Windows XP CD. You can accomplish this by double-clicking on each of these files. You will then be asked to select a destination where you want to extract them. Common locations include the \winnt directory or the \Sysprep directory (if you're using an answer file, which we'll cover below).
Once you extract these files, open up a command prompt and cd to the directory that contains them. Now you are ready to run the sysprep command. The following are some of the supported switches:
- -nosidgen—Instructs Sysprep not to re-create a SID on startup
- -pnp—Forces a plug-and-play detection on the next restart
- -quiet—Instructs Sysprep to run with no user interaction
- -reboot—Instructs Sysprep to restart the reference machine, as opposed to shutting it down when Sysprep’s operations complete
(For more info on switches, type sysprep /?.)
Follow the prompts that Sysprep provides. Then, run your third-party disk imaging software on the reference machine once Sysprep completes. Finally, save the master image to a shared network drive or burn it to a CD.
That’s it! You’re ready to deploy the image by connecting to it over your LAN from a destination machine or using the CD.
After the target machine is booted with the new image, the mini-Setup program runs. This mini-Setup program is the second most important feature Sysprep offers.
Don’t sweat the presence of a different network card or display adapter. The mini-Setup program includes plug-and-play capability. As long as Windows XP recognizes the device, you’re in good shape.
The mini-Setup program will prompt the user for a new computer name and new administrator password. Among the items the mini-Setup program manages are:
- Acceptance of the end-user licensing agreement.
- Creation of a new username.
- Creation of a new company name.
What about Sysprep.inf?
Prior to running Sysprep, you can specify the answers the mini-Setup program will need. Just use the Windows XP Setup Manager Wizard, which you trigger by executing the Setupmgr.exe command. You can load the Setupmgr.exe file from the Deploy.cab file found in the \Support\Tools folder on the Windows XP CD, just like you did for Sysprep.exe and Setupcl.exe.
The Windows XP Setup Manager Wizard will enable you to create a Sysprep.inf answer file, which you can use to provide unique information for the destination systems, such as network settings and regional settings.
The mini-Setup program checks for the Sysprep.inf file. Specifically, the Setupcl.exe program processes the Sysprep.inf file. Setupcl.exe is also responsible for changing the machine’s SID.
The mini-Setup program looks for the Sysprep.inf answer file in the \Sysprep folder on the reference machine’s root drive. If the mini-Setup program finds the Sysprep.inf file, it runs it. If not, it continues without it. Incidentally, the Sysprep.inf file can also be stored on a floppy disk, which should then be inserted in the destination machine immediately after the boot loader appears.
If you choose to use a Sysprep.inf answer file, the three following files must all be located in the same subfolder:
Gotchas to watch for
Despite the best of efforts, using Sysprep still throws the occasional curveball. Make sure you avoid these common issues:
- When installing and configuring the reference machine, check that the Windows XP operating system, each application, and all customized settings work as you intend before running Sysprep. If you include an error in your image, you will encounter the error every time you deploy a system using the image. (Trust me on this one.) It’s an exponential headache you don’t want.
- Ensure that all the required files are present in the \Sysprep subfolder. If they’re not, you’re dead in the water.
- Watch out for systems possessing different hardware abstraction layers (HALs) or Advanced Configuration and Power Interface (ACPI) support. Those machines will ruin your day if you try disk cloning to deploy them. When deploying disk images, the destination machine and the reference machine must share the same HALs, ACPIs, and mass storage devices.
- Keep a wary eye out for components that require Active Directory services. For example, you can’t create new user or computer accounts using Sysprep. Those accounts have to be created first within Active Directory.
While disk cloning can save significant time when deploying similar machines, it’s not without its drawbacks. The new Sysprep utility makes the imaging process much easier when dealing with Windows XP machines. For more information on Sysprep with Windows XP, read Microsoft article Q314460.