maandag, mei 21, 2007

VMware: deploying a VM using a custom sysprep.inf answer file

You can create a template VM and use sysprep to rename, reSID, etc. a new VM. The difference between the default approach and my approach is that in my approach you can completely configure your VM as you would like (for example, use the correct regional settings).

In our example below you will notice that the regional settings default to Belgium/Dutch. You can change this (or other settings) using the setupmgt.exe found in de DEPLOY.CAB on your windows 2003 CD-ROM.

The steps:

  • Create a template VM, install the latest VMware tools and convert your VM to a Template

    IMPORTANT: make sure the VM is not joined to a domain, otherwise the Join to Domain section during the sysprep will fail.
  • Download the sysprep 1.1 files from http://www.microsoft.com/download and unzip them in the following directory on your VirtualCenter server: C:\Documents and Settings\All Users\Application Data\VMware\VMware VirtualCenter\sysprep\1.1 (you can also use the unzipped content in the deploy.cab on the windows CD-ROM located under SUPPORT\TOOLS)
  • Create a custom sysprep.inf file using the setupmgr.exe file found in deploy.cab. The content should look similar to the following:

    ;SetupMgrTag
    [Unattended]
    OemSkipEula=Yes
    [GuiUnattended]
    AdminPassword=<yourpassword>
    EncryptedAdminPassword=NO
    OEMSkipRegional=1
    TimeZone=105
    OemSkipWelcome=1
    [UserData]
    ProductID=12345-67890-12345-67890-12757
    FullName="MyCompanyName"
    OrgName="MyCompanyName"
    [RegionalSettings]
    LanguageGroup=1
    SystemLocale=00000813
    UserLocale=00000813
    InputLocale=0813:00000813
    [SetupMgr]
    DistFolder=C:\sysprep\i386
    DistShare=whistlerdist
    [Identification]
    JoinDomain=<NetBIOS Domain Name>
    DomainAdmin=<administrator name or delegated user>
    DomainAdminPassword=<Password>
    [Networking]
    InstallDefaultComponents=Yes
  • In the VI Client when connected to your VirtualCenter, go to Edit => Customization Specifications. Create a new customization file.
  • Select the appropriate OS type (in our case Windows) and check “Use custom sysprep answer file”. Fill out an appropriate name (like “Sysprep Windows 2003 SP2”)
  • In the next screen, select Import a file and browse to your sysprep.inf file or copy/paste the contents in the sysprep.inf text field
  • When using DHCP, select Typical Settings in the next screen. Select Custom settings when using a static IP.

    IMPORTANT: Make sure to fill out the default gateway & alternate gateway with the same gateway IP (this is a known issue)
  • Make sure Generate New SID is selected in the next screen
  • The Sysprep customization should know be available to use in combination with your template.

2 opmerkingen:

Chris zei

Great article!

Carlo Costanzo zei

Check out http://www.ipmer.com/2008/05/sysprep-windows-2008-in-vmware.html
for windows 2008 Sysprep Trick. You will need to classify it as a Vista Machine.

CARLO.