Sysprep is your friend (for deploying pre-configured virtual machines)

7. July 2006 10:16 by Jaguilar in General  //  Tags:   //   Comments (0)

Most you I guess have heard about Sysprep, Microsoft’s System Preparation Tool. This tool removes certain information from a system, including the Security Identifier, IP address, computer name, etc. This is recommended when you are cloning a machine, and, by removing this information, you also remove any potential conflicts when starting up the cloned image for the first time.

When working with Virtual Machines, Sysprep is a real timesaver. You can, on a virtual machine, install several configurations of servers (Win2003EE/SQLServer2005, Win2003EE/IIS6.0, etc), sysprep the images, and then have these pre-configured images ready to deploy to a Virtual Server 2005 installation when needed, by just copying the appropriate VHD file over and associating it with a new VM.

In order to run Sysprep, you first need to install it. You can get a hold of Sysprep in two ways: it is on the \Support\Tools\ file on the Windows Server installation media, or you can download it from here. Once you get a hold of the file, you should extract the contents to a directory on your HD, for example c:\Deploy.


This directory contains several useful tools, and you should definitely read the deploy.chm file for instructions and details on the process. There are two files that are of particular importance to the process: sysprep.exe and setupmgr.exe.

For sysprep to work completely automated, it requires an answer file, called sysprep.inf. This answer file contains the “answers” to all the questions asked by the Windows installer during the setup process. The answer file can be created manually with any text editor, but fortunately there is a nice wizard-like tool that can help you generate this file. This tool is the setupmgr.exe program:


This program allows you to generate the sysprep.inf file by presenting you the options and letting you enter the default answer. In order to fully automate an installation, follow these steps on the Setup Manager:

  1. Click Next on the Welcome screen
  2. Select “Create new” and click “Next”
  3. Select “Sysprep setup” and click “Next”:
  4. Select the type of system you’re going to sysprep, and click “Next”
  5. Select “Yes, fully automate the installation” and click “Next”
  6. Now you need to fill in all the information required to complete the process:

Once you complete the execution of the Setup Manager, it creates a new directory in the root of the system drive called sysprep. This directory contains all the information necessary for the Sysprep tool to execute.


Now you need to execute the Sysprep tool, sysprep.exe:

In this tool:

  1. Click “OK” on the warning dialog that appears when running the tool.
  2. Select “Don’t reset grace period for activation”
  3. Set the “Shutdown mode” to “Shut down”
  4. Click on Reseal. That will leave the image ready for copying.

Once the image is copied, you can just configure a new virtual machine with the new image, and start it up. The last portion of the Windows setup process will execute:

After a little while (<10min), the machine will reboot, and the process will be completed. You now have a brand new sysprep’d and cloned server up and running!!