Tuesday, September 21, 2010

How to Sysprep a Virtual Machine


  • Install all the Windows updates and software needed.
  • Obtain the sysprep tool
  • Prepare SysPrep.inf (See example below)
  • Boot up the vm.
  • Copy the sysprep tool and SysPrep.inf into the vm, e.g. to a folder c:\Sysprep.
  • Extract the sysprep tool cab file, you will see the Sysprep.exe and other files needed by the tool.
  • Put the SysPrep.inf under the same folder of sysprep.exe
  • Run sysprep.exe. Click "OK
    • This starts the Sysprep process. Click "OK" to clear the warning dialog.
    • Select "Do not reset grace period for activation."
    • Make sure that the shutdown mode is "Shutdown."
    • Click "Reseal."
    • When prompted about regenerating SIDS, click "OK." The guest operating system will be Sysprepd and will automatically shut down.

Content of SysPrep.inf file:

;SetupMgrTag
[GuiUnattended]
TimeZone=4
OEMSkipRegional=1
OemSkipWelcome=1
EncryptedAdminPassword=NO
OEMDuplicatorstring="Microsoft Windows Server 2003 Enterprise Edition Service Pack 1"

[Identification]
JoinWorkgroup=WORKGROUP

[Networking]
InstallDefaultComponents=Yes

[LicenseFilePrintData]
AutoMode=PerServer
AutoUsers=50

[Unattended]
OemSkipEula=Yes
InstallFilesPath=C:\sysprep\i386

[UserData]
FullName="Your_Full_Name_Here"
OrgName="Your_Org_Name_Here"
ProductKey=Your_Product_Key_Here

[SetupMgr]
DistFolder=C:\sysprep\i386
DistShare=windist