Using Sysprep to Duplicate Disks

Disk duplication is a good choice if you need to install an identical configuration on multiple computers. On a master computer, you install Windows 2000 and any applications that you want installed on all of the target computers. Then you run Sysprep and a third-party disk imaging utility. Sysprep prepares the hard disk on the master computer so that the disk imaging utility can transfer an image of the hard disk to the other computers. This method decreases deployment time dramatically compared to standard or scripted installations.

To use Sysprep, your master and target computers must have identical HALs, Advanced Configuration and Power Interface (ACPI) support, and mass storage device controllers. Windows 2000 automatically detects Plug and Play devices, and Sysprep redetects and re-enumerates the devices on the system when the computer is turned on after Sysprep has run. This means that Plug and Play devices, such as network adapters, modems, video adapters, and sound cards, do not have to be the same on the master and target computers. The major advantage of Sysprep installation is speed. The image can be packaged and compressed and only the files required for the specific configuration are created as part of the image. Additional Plug and Play drivers that you might need on other systems are also created. The image can also be copied to a CD and distributed to remote sites that have slow links.

note-iconNote

Because the master and target computers are required to have identical HALs, ACPI support, and mass storage device controllers, you might need to maintain multiple images for your environment.

Sysprep allows you to configure a master image containing the necessary components for a member server, then later configure the server and optionally promote it to a domain controller. This can be done manually or by running the commands in the [GuiRunOnce] section of Sysprep.inf. For more information about Sysprep.inf, see "Using Sysprep to Duplicate Disks" later in this chapter.

important-iconImportant

When performing disk duplication, check with your software vendor to make certain you are not violating the licensing agreement for installation of the software you want to duplicate.

Overview of the Sysprep Process

This section describes the process of building a source computer to use for disk duplication.

  1. Install Windows 2000 – Install Windows 2000 Server on a computer that has hardware similar to the intended target computers. While building the computer, you must not join it to a domain and you must keep the local administrative password blank.

  2. Configure the computer – Log on as the administrator, then install and customize Windows 2000 Server and associated applications. You might include Internet Information Services (IIS) or set other services.

  3. Validate the image – Run an audit, based on your criteria, to verify that the image configuration is correct. Remove residual information, including anything left behind from audit and event logs.

  4. Prepare the image for duplication – After you are confident the computer is configured exactly the way that you want, you are ready to prepare the system for duplication. You accomplish this by running Sysprep with the optional Sysprep.inf file, which is described later in this chapter. When Sysprep has completed, the computer shuts down automatically or indicates that it is safe to shut down.

  5. Duplicate – At this point, the computer hard disk is triggered to run Plug and Play detection, create new security identifiers (SIDs), and run the Mini-Setup Wizard the next time the system is started. You are now ready to duplicate or image the system using a hardware or software solution. The next time that Windows 2000 Server is started from this hard disk, or is started from any duplicated hard disk created from this image, the system will detect and reenumerate the Plug and Play devices to complete the installation and configuration on the target computer.

important-iconImportant

Components that depend on Active Directory cannot be duplicated.

Sysprep Files

To use Sysprep, run Sysprep.exe manually or configure Setup to run Sysprep.exe automatically by using the [GuiRunOnce] section of the answer file. To run Sysprep, the files Sysprep.exe and Setupcl.exe must be located in a Sysprep folder at the root of the system drive (% systemdrive %\Sysprep\). To place the files in the correct location during an automated Setup, you must add these files to your distribution folders under the $OEM$\$1\Sysprep\ subfolder. For more information about this subfolder, see "Structuring the Distribution Folder" earlier in this chapter.

These files prepare the operating system for duplication and start the Mini-Setup Wizard. You can also include an optional answer file, Sysprep.inf, in the Sysprep folder. Sysprep.inf contains default parameters that you can use to provide consistent responses where they are appropriate. This limits the requirement for user input, thereby reducing potential user errors. You can also place the Sysprep.inf file on a floppy disk to be placed in the floppy disk drive after the Windows startup screen appears, in order to allow further customization at the target computer's location. The floppy disk drive is read when the "Please Wait" Mini-Setup Wizard screen appears. When the Mini-Setup Wizard has successfully completed its tasks, the system restarts one last time, the Sysprep folder and all of its contents are deleted, and the system is ready for the user to log on.

Sysprep.exe

Sysprep.exe has three optional parameters:

  • quiet — runs Sysprep without displaying onscreen messages.

  • nosidgen — runs Sysprep without regenerating SIDs that are already on the system. This is useful if you do not intend to duplicate the computer on which you are running Sysprep.

  • reboot — automatically restarts the computer after Sysprep shuts it down, eliminating the need for you to manually turn the computer back on.

Sysprep.inf

Sysprep.inf is an answer file that is used to automate the Mini-Setup process. It uses the same .ini file syntax and key names (for supported keys) as the Setup answer file. You need to place the Sysprep.inf file in the %systemdrive%\Sysprep folder or on a floppy disk. If you use a floppy disk, you can provide the floppy after the Windows startup screen. The floppy drive will be read when the "Please Wait" Mini-Setup screen appears. Note that if you do not include Sysprep.inf when running Sysprep, the Mini-Setup Wizard displays all the available dialog boxes listed under "Using Sysprep to Duplicate Disks" later in this chapter.

note-iconNote

If you provided a Sysprep.inf file on the master computer and you want to change the Sysprep.inf on a per-computer basis, you can use the floppy disk method previously discussed.

Following is a sample of a Sysprep.inf file:

[Unattended]

;Prompt the user to accept the EULA.

OemSkipEula=No

;Use Sysprep's default and regenerate the page file for the system

;to accommodate potential differences in available RAM.

KeepPageFile=0

;Provide the location for additional language support files that

;might be needed in a global organization.

InstallFilesPath=%systemdrive%\Sysprep\i386

[GuiUnattended]

;Specify a non-null administrator password.

;Any password supplied here will only take effect if the original source

;for the image (master computer) specified a non-null password.

;Otherwise, the password used on the master computer will be

;the password used on this computer. This can only be changed by

;logging on as Local Administrator and manually changing the password.

AdminPassword=""

;Set the time zone

TimeZone=20

;Skip the Welcome screen when the system boots.

OemSkipWelcome=1

;Do not skip the regional options dialog box so that the user can

;indicate which regional options apply to them.

OemSkipRegional=0

[UserData]

;Prepopulate user information for the system.

FullName="Authorized User"

OrgName="Organization Name"

ComputerName=XYZ_Computer1

[GUIRunOnce]

;Promote this computer to a Domain Controller on reboot.

DCPromo/answer:<location of dc promo answer file>

[Identification]

;Join the computer to the domain ITDOMAIN

JoinDomain=ITDOMAIN

[Networking]

;Bind the default protocols and services to the network card(s) used

;in this computer.

InstallDefaultComponents=Yes

note-iconNote

You can change the administrative password using Sysprep.inf only if the existing administrative password is null. This is also true if you want to change the administrator password through the Sysprep GUI.

For more information about the answer file sections and commands used with Sysprep.inf, see the Appendix "Sample Answer Files for Unattended Setup" in this book.

Setupcl.exe

Setupcl.exe does the following:

  • Regenerates new security IDs for the computer.

  • Starts the Mini-Setup Wizard.

Mini-Setup Wizard

The Mini-Setup Wizard starts the first time that a computer starts from a disk that has been duplicated by the Sysprep method. The wizard gathers any information that is needed to further customize the target computer. If you do not use Sysprep.inf, or if you leave some sections of the file blank, the Mini-Setup Wizard displays screens for which no answer was provided in Sysprep.inf. The possible screens include:

  • End-User License Agreement (EULA)

  • Regional options

  • User name and company

  • Computer name and administrator password

  • Network settings

  • TAPI settings (only displayed if a modem or a new modem device exists on the computer)

  • Server licensing (server only)

  • Time zone selection

  • Finish/Restart

If you want to bypass these screens, you can specify certain parameters within Sysprep.inf. These parameters are listed in Table 13.6.

note-iconNote

Because Setup detects optimal settings for display devices, you will no longer see the "Display Settings" screen when Setup or the Mini-Setup Wizard is running. You can specify [Display] settings either in the answer file used for your master computer or in the Sysprep.inf file used for your target computer. If [Display] settings are in the answer file that is used for your master computer, Sysprep will retain those settings unless Sysprep.inf contains different settings, or unless a video adapter or monitor requiring settings different from those of the master computer is detected.

Table   13.6 Parameters in Sysprep.inf for Bypassing the Mini-Setup Wizard

Parameter

Value

 

 

Regional options

[RegionalSettings] section
[GuiUnattended]
OemSkipRegional=1

User name and company

[UserData]
FullName="User Name"
OrgName="Organization Name"

Computer name and administrator password

[UserData]
ComputerName=W2B32054
[GuiUnattended]
AdminPassword=""

Network settings

[Networking]
InstallDefaultComponents=Yes

TAPI settings

[TapiLocation]
AreaCode=425

Time zone selection

[GuiUnattended]
TimeZone=<desired time zone index>

Finish/Restart

NA

Running Sysprep Manually

After you install Windows 2000 Server, you can use Sysprep to prepare the system for transfer to other similarly configured computers. To run Sysprep manually, you must first install Windows 2000 Server, configure the system, and install the applications. Then run Sysprep without the ** – reboot command-line ** switch. After the system shuts down, duplicate the image of the drive to the similarly configured computers.

When users start up their duplicated computers for the first time, Sysprep Mini-Setup will run, allowing the users to customize their systems. You can also preassign all or part of the Sysprep configuration parameters by using Sysprep.inf. The Sysprep folder (which contains Sysprep.exe and Setupcl.exe) is automatically deleted after Sysprep Mini-Setup completes.

To prepare a Windows   2000 Server installation for duplication

  1. On the Start menu, click Run , and then type:
    cmd

  2. At the command prompt, change to the root folder of drive C, then type:
    md sysprep

  3. Load the Windows 2000 Server CD. Open the Deploy.cab file in the \Support\Tools folder.

  4. Copy Sysprep.exe and Setupcl.exe to the Sysprep folder.
    If you are using Sysprep.inf, also copy this file to the Sysprep folder. Note that Sysprep.exe, Setupcl.exe, and Sysprep.inf must exist in the same folder so that Sysprep can function properly.

  5. At the command prompt, change to the Sysprep folder:
    cd sysprep

  6. Type one of the following, as required:

    Sysprep

    Sysprep –reboot

    Sysprep / <optional parameter>

    Sysprep / <optional parameter> -reboot

    Sysprep / <optional parameter 1> .../ <optional parameter X>

    Sysprep / <optional parameter 1> .../ <optional parameter X> -reboot

  7. If the – reboot command-line switch was not specified, perform the following:
    When a message appears telling you to shut down the computer, on the Start menu, click Shut Down . You are now ready to use a third-party disk-imaging utility to create an image of the installation.

  8. If the – reboot command-line switch was specified for auditing purposes only, then the computer restarts and the Mini-Setup Wizard runs. In this case, perform the following:

    • Verify that the Mini-Setup Wizard provides the desired prompts. At this time you can also audit the system and other applications. Once auditing is complete, run Sysprep again without the ** – reboot command-line switch.

    • When a message appears telling you to shut down the computer, on the Start menu, click Shut Down . You are now ready to use a third-party disk-imaging utility to create an image of the installation.

note-iconNote

You can add a Cmdlines.txt file to the Sysprep folder, to be processed by Setup. This file will run post-Setup commands, including those required for application installation.

Running Sysprep Automatically After Setup Completes

The [GuiRunOnce] section of the answer file contains commands to be executed after Setup completes. You can use the [GuiRunOnce] section to create an installation that completes Setup, automatically logs on to the computer, runs Sysprep in – quiet mode, and then shuts down the computer. For this to occur, you need to do the following:

  1. Include the required Sysprep files in the distribution folders under $OEM$\$1\Sysprep\ to copy the files to the correct location on the system drive.

  2. In the [GuiRunOnce] section of the answer file, make the following the last command that is run on the computer:

    %systemdrive%\Sysprep\Sysprep.exe –quiet

  3. If multiple reboots are required, make this the last command used the last time the [GuiRunOnce] section is used.

Using Sysprep to Extend Disk Partitions

Windows 2000 GUI Setup and Mini-Setup can be used to extend NTFS partitions through answer files. This new functionality does the following:

  • Allows you to create images that can be extended into larger disk partitions to take full advantage of hard disks that might have more space than the original hard disk on the master computer.

  • Provides a way to create images on smaller hard disks.

To determine the best way to integrate this functionality in your environment, you need to review the steps that follow and choose the method that will work best for you based on the tools that you are using to image the operating system.

caution-iconCaution

If your imaging tools allow you to edit the image, you can delete the Pagefile.sys, Setupapi.log, and the Hyberfil.sys (if applicable) because these files will be recreated when the Mini-Setup Wizard runs on the target computer. You must not delete these files on an active system because this can cause the system to function improperly. These files should only be deleted, if desired, from the image.

To extend a hard disk partition when using a third-party imaging product or a hardware imaging device that supports NTFS used by Windows   2000

  1. Configure the partition on the master computer hard disk to the minimum size required to install Windows 2000 with all the components and applications that you intend to preinstall. This reduces your overall image size requirements.

  2. Include FileSystem=ConvertNTFS in the [Unattended] section of the answer file that is used to create the master image. You do not need to include ExtendOemPartition here because you want to maintain the smallest possible image size.

    note-iconNote

    ConvertNTFS does not work in Sysprep.inf because this is a text mode–only function and Sysprep does not go through text mode.

  3. In the [Unattended] section of Sysprep.inf, include the statement:

    ExtendOemPartition = 1

    (or additional size, in megabytes, to extend the partition)

  4. Install Windows 2000 to the master computer. Sysprep will shut the system down automatically.

  5. Image the drive.

  6. Place the image on the target computer where the target computer has the same size system partition as the master computer.

  7. Restart the target computer.
    The Mini-Setup Wizard starts and the partition is extended almost instantaneously.

To extend a hard disk partition when using an imaging product that does not support NTFS used by Windows   2000

  1. Configure the partition on the master computer hard disk to the minimum size required to install Windows 2000 with all the components and applications that you intend to preinstall. This will reduce your overall image size requirements.

  2. Convert the file system to NTFS by using the Convert.exe tool provided in Windows 2000.

  3. Include the following as the last two items of the [GuiRunOnce] section of the answer file used to create the master image:

    [GuiRunOnce]

    <Command1> = "<command line>"

    <Command2> = "<command line>"

    ...

    <Commandn-1> = "Convert c:\ /fs:ntfs"

    <Commandn> = "%systemdrive%\sysprep\sysprep.exe -quiet"

    where:

    • <command line> includes any commands you need to run to install applications or configure the operating system before you image it.

    • <Commandn-1> is the next-to-last command to be carried out in the [GuiRunOnce] section of the answer file. This will run the convert command. Because convert cannot convert the active system to NTFS while the operating system is running, the operating system is set to do so on the next restart. Because Sysprep is the next item to run, the system will not be converted to NTFS during that process.

    • <Commandn> is the last command to run on the computer. This should be Sysprep.exe. When Sysprep is run, it prepares the computer for imaging, then shuts down the computer.

    note-iconNote

    You cannot include ExtendOemPartition in the master answer file for this step because the partition on which the image is generated is not NTFS. You also might want to keep the image as small as possible.

  4. Under the [Unattended] section of Sysprep.inf, include the statement:

    ExtendOemPartition = 1

    (or additional size, in megabytes, to extend the partition)

  5. Install Windows 2000 on the master computer. Sysprep will shut the system down automatically.

    important-iconImportant

    Do not restart the computer.

  6. Image the drive.

  7. Place the image on the target computer where the target computer has the same size system partition as the master computer.

  8. Restart the target computer.
    The computer will initially begin in conversion mode to convert the system partition on the target computer to NTFS.
    The computer will automatically restart.
    The Mini-Setup Wizard begins, and the partition is extended almost instantaneously.