Virtual Machine Template Guidelines for VMWare – “Windows Server 2008”

Following are the guidelines/steps to create a Virtual Machine template for Windows Server 2008. Please note always start with minimum Specs and then extend later, whenever it required.

Please download below files by click on the file name. It will help you in later configuration.

It’s time to start.

1-First create a new VM

  • Right Click on Server and Choose “New Virtual Machine”
  • Enter VM Name (according to defined naming convention) and Inventory Location
  • Select Datastore
  • Select Virtual Machine Version: select latest available
  • Select “Microsoft Windows Server 2008 (64-bit)” as OS Version
  • # of Virtual Processors: 1
  • Amount of RAM: 2GB
  • Network
    • # of NICs: 1
    • Adapter Type: VMXNET 3
    • Select “Connect at Power On”
  • SCSI Controller: LSI Logic SAS
  • Create New Virtual Disk: 40GB
    • Disk Provisioning: Thin Provision
  • Virtual Device Node: SCSI (0:0)

NOTE: Thin Provision is good practice to store templates files. because, it will save some storage space.

2-Now prepare the virtual hardware

  • Right click on VM ->Hardware Upgrade(If Applicable)
  • Edit VM Settings > Options->VMWare Tools->Advanced->
    • Check upgrade Tool during power cycling check box
    • Check synchronize guest time with host check box
  • Edit VM Settings->Memory /CPU Hot plug (enable both)
  • Edit VM Settings->Advance->General Section ->Uncheck “Enable logging”

3-OS Configuration

  • Edit VM Settings->Remove Extra Hardware(USB & floppy etc)
  • Power on the VM and Install Windows Server 2008 64bit
  • Once installed shutdown the VM and go to “Edit VM Settings”->Boot Options > Select “Check box to force going into the BIOS on next boot”
  • Power on the VM (will go directly to BIOS) > Advanced > I/O Device Configuration:
    • Disable Serial port A
    • Disable Serial port B
    • Disable Parallel port
    • Disable floppy drive
  • Power on the VM and install VMware Tools-> While installation choose “Custom Install Type” and select all components
  • Set Windows “Time Zone” and time configuration.
  • Install any Windows Update and Service Pack
  • add static route (if required). below is an example, edit it according to you needs)
    • cmd: route add 172.17.0.0 mask 255.255.0.0 10.0.9.2 –p
    • cmd: route print(to verify route)
  • Enable “remote desktop”, uncheck “remote assistance”
  • In Control Panal->Windows Firewall->Add “remote desktop” in exception list.
  • Install .Net Framework and Java (if required)
  • Add inbound Rule in the firewall(if it is on)for ICMP(Ping)
  • Disconnect Windows Server 2008 ISO from VM Settings and set “device type” to “Client Device”

4-Create Snapshot

  • Create snapshot for safe side in case anything goes wrong in later configuration
    • Snapshot name->(Win_2k8_Snap01_Date and Time) and add description(FRESH OS INSTALLATION with basic configuration)

5-Test VM Alignment

  • There is not need to check the alignment because, OS later then “Windows XP/2003” are already aligned.

6-Network Configuration

  • Control Panel->View by->small icons
  • From Control Panel-> Network Connections->Right click on “Local Area Connection” and select properties->Uninstall QoS Packet Scheduler

** We don’t do QOS at the server level, our switches do that.

  • Uncheck IPv6 and close network connection screens ** We don’t use IPv6 yet so we disabled it for now

Or

  • Run below command on cmd (I prefer to use this option).

reg ADD “HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip6\Parameters” /v DisabledComponents /t REG_DWORD /d 0xffffffff /f

7-Task Manager Changes

  • Right click 3rd icon from Start Button (Windows Explorer) and select “Unpin this program from taskbar”
  • Right click 2nd icon from Start Button (Windows PowerShell) and select “Unpin this program from taskbar”
  • Right click Taskbar and choose Properties and choose Customize under Notification Area->Select “Turn system icons on or off”, and turn Volume Off, click Ok
  • Notification bar: Always show all icons and notifications on the taskbar

8-Folder and Search Options

  • Open “Computer” > Select Organize > Choose Folder and search options->Under View Tab
    • Select “Show hidden files, folders and drives”
    • Uncheck “Hide extensions for known file types”
    • Check “Allows show icons, never thumbnails + Allows show menus”
    • Check “Display the full path in the title bar”
    • Uncheck: “Hide extensions for known file types”

9-Control Panel Settings

  • Control Panel ->Power Options
    • Change Power Plan -> High Performance
    • Change plan settings -> Turn off the display -> Never
  • Control Panel -> Sound -> Sound-> Sound Scheme: No Sounds
    • Pop-up: “Would you like to enable the Windows Audio Service?” – No->
    • Uncheck “Play Windows Startup sound”
  • Control Panel -> Display -> Change screen saver -> Screen Saver
    • Set Blank
    • Wait 10 minutes
  • Disable Hibernation
    • cmd: powercfg.exe –h off
    • cmd: bcdedit /timeout 5

10-System Performance

  • From Server Manager -> Change System Properties->Select Advanced Tab
    • Performance->Settings->“Adjust for best performance”    
    • Startup and Recovery->Change the default value from 30 seconds to 5 for faster rebooting. Write debugging information: Small memory dump (256 KB)
  • Turn off indexing- >Go to “C:” Drive -> Properties -> General
    • Uncheck “Allow files on this drive to have contents indexed in addition to file properties”
    • Choose Apply -> Apply changes to C:\ only (or files and folders, to taste)
  • Delete Extra Files->C:\Users\Default -> Delete “NTUser.*” Delete “Music, Pictures, Saved Games, Videos”

11-IE Settings

  • Server Manager->configure IE ESC->Turn Internet Explorer Enhanced Security off.
  • Internet options: Use blank + Check “Delete browsing history on exit”
  • Turn on IE Option (EMPTTY Temporary internet file folder when browser is closed)
  • Go to Tools-> Compatibility view settings-> add websites (sngpl.com.pk,sngpl.net)
  • Delete temporary files from C:\Users\Administrator\appdata\local\temp

12-Swapping and defragment

  • Control Panel->System->Advanced System Properties->performance->Advance->Virtual Memory->Change
    • Uncheck “Automatically manage paging file size for all drives”
    • Select “No paging file”
    • Click “Set” to disable swap file
  • Defragment
    • Go to C: -> Properties -> Tools -> Defragment Now…
    • Select “(C:)”->Click “Defragment disk”

13-Create Snapshot

  • Create snapshot for safe side in case anything goes wrong in later configuration
  • Snapshot name->(Win_2k8_Snap02_Date and Time) and add description(Customization 1-Before Profile Setting)

14-User Profile Settings

In Windows Server 2008 and Windows 7, Microsoft has disabled the Copy To.. Button on the User Profiles screen.

This issue is known to Microsoft but no fix has been released yet, but luckily there is an alternate way to achieve this.

  • You can download a tool called ‘Windows Enabler ‘from the below link or save from attachment of this document at start.
  • http://www.freewarefiles.com/downloads_counter.php?programid=980
  • Save the file to your Template VM’s desktop and extract the file.
  • Right click on “.exe“ file.
  • Once you have started the Windows Enabler application you will notice a new icon in the system tray
  • Make sure you click on it once to enable the application.
  • In the ‘Run’ prompt type cpl and hit Enter
  • Navigate to ‘Advanced’ tab -> User profiles -> Settings
  • Click on the desired profile and you will notice that ‘Copy To‘button is disabled.
  • Now, click on the disable button and it will become enabled thanks to ‘Win Enabler’ application.
  • Now copy the profile (in our case, it would be the user which we are using for configuration in most case it is administrator) to “Default users”(C:/Documents and Settings-/Default Users) profile.

15-Finalizing

  • Enable Swap files
  • Server manager-> change system properties->Advance -> Performance -> Settings… ->
    • Advanced -> virtual memory->change
  • Check “Automatically manage paging file size for all drives”
  • Place 2k8-ServicesSetting.txt on “C” Drive, Rename with “2k8-ServicesSetting.cmd”.
  • Join Domain (optional), it’s optional because customization wizard will join domain for you in every machine.
  • Register Windows
  • cmd: ipconfig /release
  • Clear Event Logs

16-Create Snapshot

  • Create snapshot for safe side in case anything goes wrong in later configuration
  • Snapshot name->(Win_2k8_Snap03_Date and Time) and add description(Fully Configured except Antivirus)

17-Install Antivirus (optional)

  • It is the time to install an antivirus security. It’s optional, if you may want to install one.

18-Sysprep the Windows in Generalized mode

Running a SYSPREP allows the PC to be generalized with new unique IDs so that you get an “Out of the Box” experience (OOBE) on the next boot.  The next boot will bring you to the Windows Welcome Screen, where you’ll be prompted to accept the EULA (End User License Agreement) and enter an Administrator password (if running Windows Server).

To SYSPREP a Windows 7/8 PC or Windows Server 2008/2012 from Command Line:

  • Open an Administrative Command Prompt.
  • Type the following then press <Enter>: CD \Windows\System32\Sysprep
  • Type the following then press <Enter>: SYSPREP /generalize /shutdown

19-Convert VM to Template

Use the VMware Customization Wizard to create a re-usable script for cloning the template.

Domain Setting Syntax in Customization Wizard.

  • Username: administrator@example.com
  • Domain: example.com

Add below setting in Run Once in Customization wizard (this step is optional. you may configure it according to you environment)

Run Once:

  • c:\2k8-ServicesSetting.cmd (which downloaded from this post at start)

Now’s a good time to test that your template will create a usable clone and make sure while creating a production VM from template choose “disk provision” method from “thin provision” to “thick provision”.

vmtemplate-xp01

Advertisements

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s