Dashboard > Documentation > ... > Image Builder and Cloner Clinic > Sysprep
Documentation Log In   View a printable version of the current page.
Sysprep

Added by Paul Smernoff , last edited by Paul Smernoff on Dec 12, 2007  (view change)
Labels: 
(None)

Sysprep

Sysprep is a utility used by Windows system cloners to automate the process of unique SID generation, region customization, and workstation renaming. Sysprep can also be used to port a Windows NT based OS from one hardware system to a quite different one. When performing such a task without Sysprep one may typically encounter a 0x0000007B Blue Screen of Death (BSOD) as the new system's disk controller is unknown to the OS loaded on the hard disk drive of the previous system. Getting around this requires the use of Sysprep with some additional parameters*.

HAL Swapping

No, not the 9000 from University of Illinois at Urbana-Champaign, but rather the Hardware Abstraction Layer found in any Windows NT based OS. Like the ISO-OSI seven layer model of networks, computers use abstraction layers between... hardware, firmware, assembler, kernel, os and application. The HAL concept is not unique to Windows, but for our purposes we will focus on how it impacts Windows system cloning. If you plan on porting your Windows OS to a piece of hardware that has a different HAL then you will need to make provisions for supplying the correct one. Failure to do so very well may result in an OS that continuously Blue Screens on boot or boots, but performs poorly in the CPU arena.

This table displays the HAL type for a select set of Dell workstations and laptops. Notice the single processor machines at/after the GX240 to the GX280 can be either "Advanced Configuration and Power Interface (ACPI)" or "ACPI Uniprocessor PC." From experience, ACPI Uniprocessor boots on both Single and Dual Processor boards, so choosing the latter may make the most sense as once the system is booted the HAL can still be changed to "ACPI Multiprocessor PC" where as if it is Blue Screening the change cannot be made as easily (you would have to use something like BartPE or perform a Windows repair install). Keep in mind an "Advanced Configuration and Power Interface (ACPI)" image is required for a variety of laptops and would also work on non-hyperthreaded workstations. For this reason those maintaining multiple systems need at least two images. It is advised not to run "ACPI Multiprocessor PC" HALs on on "ACPI Uniprocessor" systems. It will boot, but the CPU performance will be seriously affected.

An MP kernel on a UP computer will noticeably reduce the computer's performance.

Machine HAL Type Dell equivalent Windows System32 Files
ACPI multiple-processor or hyperthreaded ACPI Multiprocessor PC Precision 690 (dp), OptiPlex 745 (ht), GX620 (ht), GX280 (ht if BIOS set) halmcpi.dll, ntoskrnl.exe (ntkrnlmp.exe), ntkrnlpa.exe (ntkrpamp.exe)
ACPI multiple-processor board w/ single processor ACPI Uniprocessor PC OptiPlex GX280 (non ht BIOS default), GX270, GX260, GX240, Latitude D610 halaacpi.dll, ntoskrnl.exe, ntkrnlpa.exe
ACPI single processor motherboard Advanced Configuration and Power Interface (ACPI) PC Latitude D600, D800, C810, C640, OptiPlex GX280 (_non ht BIOS default), GX270, GX260, GX240 halacpi.dll, ntoskrnl.exe (), ntkrnlpa.exe ()
Compaq SystemPro Compaq SystemPro Multiprocessor or 100% Compatible NA -
non-ACPI dual processor motherboard w/ single processor MPS Uniprocessor PC GX150, GX110, GX1 halapic.dll
non-ACPI dual processor motherboard MPS Multiprocessor PC NA halmps.dll
any Standard PC, non-ACPI, non-MPS. 386, 486, Pentium, PII, PIII Standard PC NA -
Standard PC w/ C-Step i486 Other NA hal.dll

Key Designation
dp = physcial dual CPU
ht = hyperthreaded single CPU

You can check the HAL type of any given Window XP workstation or 2003 Server by checking the Computer item under the Device Manager (Control Panel/System/Hardware tab/Device Manager) or right-click on "My Computer" and choose Manage and drop down the Device Manager item. You can also check the HAL type by right clicking on "%WINDIR%\System32\hal.dll" and clicking Properties to view the Internal Name field under the Version tab.

In Windows 2003 Server the HAL can be changed using the "Update Driver" function for the Computer item in the Device Manager (as described above).

Once you have determined the HAL type of the new host you can replace the HAL.DLL file found in "%WINDIR%\System32\" with the appropriate file associated with your HAL type. For example, halmcpi.dll (for a dual proc) can be copied to become hal.dll. This should be done prior to running Sysprep and rebooting. Once done, the hard disk drive should be ported to the new machine or cloned and then imaged to the new machine.

Planning

Sysprep should be run on a workstation/server prior to drive cloning. This way Sysprep will run when the new born clone or swapped disk boots for the first time its new host PC. To get started simply download the Windows XP SP2 Deployment Tools and extract the contents to a a directory. For this example we placed the Sysprep files in a newly created directory named "sysprep" that we made in c:\windows. Users of Windows 2003 Server can now also use this version. This can be done by double clicking on the downloaded Deplyoment Tools package and then copying the files (extracting) to the newly created sysprep folder in the Windows directory. You should see something similar to the picture below:

Creating an Answer File

Answer Files are .inf files used by Sysprep to supply the OS with a script of information during Sysprep boot. The file is typically created with a Sysprep utility named Setup Manager (setupmgr.exe). Four our purposes we will actually created the Answer File from the command line first. We do this to enable support for a greater range of disk controllers. *(our aforementioned additional parameters)

  1. Click on Start / Run and type: "notepad" (without quotes) followed by [Enter].
  2. Now type [SysprepMassStorage] in the newly opened blank document.
  3. Click File / Save As and browse to the c:\windows\sysprep directory using the "Save in:" drop down box.
  4. Name the file "sysprep.inf" (without quotes) and click Save. Close Notepad.
  5. Click on Start / Run and type: "cmd" (without quotes) followed by [Enter].
  6. Change the directory to the location of your extracted Sysprep files by typing: "cd\windows\sysprep" (without quotes) followed by [Enter].
  7. To populate the sysprep.inf Answer File with a Mass Storage section, issue the following command: "sysprep -bmsd" (without quotes) and hit [Enter]. You may see a window stating "Sysprep Working..." open and close quickly. To confirm this process worked you can navigate to c:\windows\sysprep and open the sysprep.inf file. You should see a large list of device drivers and their paths. Remember to close Notepad so the file is not in use.

Running Setup Manager

  1. Open the c:\windows\sysprep directory and double-click on setupmgr.exe.
  2. Click Next.
  3. When prompted for an Answer File, choose "Modify existing" and browse to your sysprep.inf file in c:\windows\sysprep. By default the browse window will show .txt files so change the "Files of type" drop down box to "Sysprep Inf Files (*.inf)" and then select the sysprep.inf file by double-cling it.
  4. Choose Next.
  5. You will then be warned that your Answer File was not created using Setup Manager and may not be valid. Ignore this message by clicking "Yes".
  6. On the following screen make sure "Sysprep Setup" is selected and choose Next.
  7. Choose the appropriate OS and then click Next.
  8. You now have the option to automate the Sysprep process or making the first boot a manual process. The latter is used by OEM distributors and resellers while the first option is used for those deploying workstations. For lab/sys admins the automated option is usually preferred, but will require you provide some input like CD key, etc.
  9. If you didn't choose automate you can click "Next" through all of the prompted fields in the following window. On next boot the OS will, however, prompt the user for each and every one of those fields. If automating continue, if not skip to Finishing Setup Manager.
  10. Fill out the following required fields:
  • General Settings
    • Name and Organization - required
    • Display Settings - skip
    • Time Zone - required
    • Product Key - required (on boot, corp key will not work on OEM shipped OS)
  • Network Settings
    • Computer Name - Auto generate
    • Administrator Password - skip
    • Networking Components - skip
    • Workgroup or Domain - choose Workgroup
  • Advanced Settings
    • Telephony - skip
    • Regional Settings - skip
    • Languages - skip
    • Install Printers - skip
    • Run Once - skip
    • Additional Commands - skip
    • Identification String - blank

Finishing Setup Manager

  1. Choose Finish
  2. Click "OK" to confirm the saving of your sysprep.inf file. The file is saved to a newly created directory c:\sysprep and in your c:\windows\sysprep directory. It is highly recommended to remove the latter one as unlike the c:\sysprep directory, it will remain on the system and would reveal to users your CD key. Yes, users can also obtain that with key finder software... however most anti-virus applications, like Sophos, prevent those apps from running. Feel free to keep a copy in a secure location for future use as it will speed this process up in the future.
  3. Click Cancel on the last remaining Setup Manager window.

Running Sysprep

  1. Do not engage in this step unless you are ready to seal your image for deployment or are prepared to swap the disk drive into the new host system.
  2. Double-click sysprep.exe in c:\windows\sysprep.
  3. Click OK.
  4. Select the following items: Don't reset grace period for activation, Use Mini-setup.
    For an indepth explanation of these options, read Microsoft's documentation and check the deploy.chm and ref.chm help files located in c:\windows\sysprep.
  5. Ensure "Shutdown" is the Shutdown mode.
  6. Click Reseal. Sysprep will now run for anywhere from 5 minutes to a few hours. Be patient. Leave the system alone until it is shutdown and off.
  7. Now, make an image of your system disk or remove the hard disk drive and place it in your new host system. There is no guarantee that it will boot without a Blue Screen or other issues. If you are having issues it might be due to an incompatible HAL type.

A little known secret... during mini-setup on subsequent boot one can gain access to a command window by holding Shift-F10.

Sources
http://www.myitforum.com/articles/15/view.asp?id=8997
http://support.microsoft.com/?id=309283
http://support.microsoft.com/kb/309283
http://www.microsoft.com/technet/sysinternals/information/bootini.mspx
http://campus.umr.edu/cis/desktop/

Powered by Atlassian Confluence 2.7.1, the Enterprise Wiki. Bug/feature request - Atlassian news - Contact administrators