Creating new virtual machines is bit time consuming so to create a base virtual hard drive and just make copies of it and start-up new virtual machine is ideal, but cloning/coping vhd will lead to having virtual servers with same SID and CID on your network. There are tools like NewSID to fix it but I had problem with clone/ghost virtual machine which didn't want to be joined to a domain.
SysPrep is a tool that allows you to prepare or “prep” a machine with the operating system along with any software you wish was pre-installed and pre-configured. Once a machine is SysPrep’d, you have a new virtual hard drive that has the Windows operating system along with any additional software or features you want, such as IIS, preinstalled and pre-configured. SysPrep allows you to create your perfect system configuration packaged so that you can have a new virtual machine up and running in just minutes. And, it is available for both Windows Server 2003 32bit/64bit and Windows XP.
System Preparation tool for Windows Server 2003 Service Pack 2 32bit Deployment
System Preparation tool for Windows Server 2003 Service Pack 2 64bit Deployment
Creating the base virtual machine image/vhd
- Create new virtual machine, I did it on Hyper-V but should work for VPC 2007/Virtual Server and more.
- Install your OS. Windows Server 2003 R2 (latest service pack) or Windows XP.
- Do NOT join the virtual machine to any domain.
- Leave the administrator password blank or reset it to blank.
- Now get all latest windows updates and all.
- Install antivirus software and latest updates.
- Install the virtual additions, depending which virtualization you're using.
- Install all and latest .Net frameworks.
- Activate the OS license. Then you don't need to re-activate the OS for each new virtual machine you create.
- When I create a base for virtual servers (MOSS, K2, SQL or WEB servers) I install BGInfo, part of Windows sysinternals package, get it here. It creates cool desktop background with various server information as a desktop background.
Before you can SysPrep you virtual machine, you need to create a SysPrep.inf configuration file. This file contains the information about your machine. It will also prevent you from having to enter you CD Key each time you create a new virtual machine from you SysPrep’d image. Below is a sample of the SysPrep.inf file that you need to create. This file configures the SysPrep process and automates boot up process.
- On your virtual machine, create a folder SysPrep at the root of your C: drive (C:\SysPrep).
- Copy the following text into a text file named SysPrep.inf.
- Enter the correct values for the following keys:
- TimeZone – the value of 140 is Harare, Pretoria (UCT +02:00). You may want to change this to your local time zone, but it is not required to do so, Index numbers for [GuiUnattended]/TimeZone.
- OEMDuplicatorsting – this should contain the name of the operating system you have installed on your virtual machine.
- FullName – your name, the name you would enter if you were installing Windows.
- OrgName – the name of your company, or blank.
- ProductKey – Your product key (CD key) license.
;SetupMgrTag
[GuiUnattended]
TimeZone=140
OEMSkipRegional=1
OemSkipWelcome=1
EncryptedAdminPassword=NO
OEMDuplicatorstring="Windows Server 2003 R2 64Bit"
[Identification]
JoinWorkgroup=WORKGROUP
[Networking]
InstallDefaultComponents=Yes
[LicenseFilePrintData]
AutoMode=PerServer
AutoUsers=50
[Unattended]
OemSkipEula=Yes
InstallFilesPath=C:\sysprep\i386
[UserData]
FullName="YOUR NAME HERE"
OrgName="YOUR COMPANY NAME HERE"
ProductKey=YOUR-PRODUCT-KEY-HERE
[SetupMgr]
DistFolder=C:\sysprep\i386
DistShare=windist
Your SysPrep.inf configuration file is now ready to be used.
SysPrep-ing your Virtual Machine
SysPrep-ing your virtual machine takes just a minute or two. Most of the time is simply shutting down your virtual machine. Important: do not start this virtual machine back up or it will un-SysPrep your machine. If this does happen, you can simply go through these steps below to SysPrep you virtual machine again.
- Run the SysPrep install tool, it will install a deploy.cab file in this location, C:\WINDOWS\system32\deploy.cab.
- Extract all the files in the deploy.cab to C:\SysPrep.
- Then run SysPrep.exe
- Check the “Don't reset grace period for activation” option.
- Make sure Shutdown mode is Shut down.
- Click the Reseal button to shutdown and package.
- Click OK to generate new SID's.
- Your virtual machine will now shut down and be SysPrep’d.
- You now have a virtual image that is SysPrep’d, but not ready to be used.
- Before you use this image, you will need to make a backup copy of your virtual machine image. This will allow you to always have a SysPrep’d virtual machine ready and waiting.
- Backup your SysPrep’d virtual machine image (.vhd), and rename them to something you can easily understand and that describes what your image contains. For example:
Base2003R2x64_SysPrep.vhd - You now have your virtual machine SysPrep’d. You can now use this image to quickly create a new virtual machine in minutes, with a new machine name and new unique System ID (SID) each time you use it.
No comments:
Post a Comment