Monday, April 8, 2013

Building a VMware Virtual Machine Template - Walkthrough Guide

**** Updated 06-12-2013 **** Spelling corrections, updates to notes and included OS video card update information.

There are quite a few posts already on building a VM template but I found that I was having to reference a several blog posts in order to get the complete picture. So I'm finally getting around to writing my own for future reference.

I'll list some great links to other VM Template guides at the end of the post.

  • Create a new VM with the required specifications.
    • Disk
    • CPU - Make the default use CPUs not Cores
    • RAM
    • NIC - VMXNET3
    • SCSI0 - LSI Logic SAS for Windows 2008
    • Floppy - Remove
    • OS - Make sure to select the correct OS
  • Build a standard for the template name to cover different OS versions and editions for example;
    • W2K8R2SP1ENTx64 - Windows 2008 R2 Service Pack 1 Enterprise 64bit
    • W2K3SP2STDx32 - Windows 2003 Service Pack 2 Standard 32bit
    • RHEL61x64 - Red Hat Enterprise Linux 6.1 64bit
  • Install the OS inside the VM (typically from CD ISO)
    • Choose a default Administrator username and password
    • Set time zone
    • Set regional options
    • Set language packs
    • Set keyboard layout
  • Upgrade VM hardware version to the latest level available
  • Modify VM settings
    • Disable VM Logging
    • Set CD/DVD to 'Client Device'
    • NIC - Select default build VLAN/Portgroup
    • Video Memory - For one monitor @ 1024x768 use 3MB
    • Set description of the template within the Notes section
  • BIOS Settings
    • Disable serial ports
    • Disable parallel ports
    • Set HDD as primary boot device
    • Disable floppy disk drives
  • Install VMware Tools - Choose custom install
    • Unselect vShield Drivers
    • Unselect Shared Folders
    • Unselect Virtual Printing
    • Unselect Wise Multimedia Support
  • Update video card driver to WDDM driver (kb.vmware.com/kb/2004145‎)
  • Anti-Virus client install - Agentless is preferred if that is available
  • Backup client install - Agentless is preferred if that is available
  • Set VM name within the OS to match the template name
  • Activate OS - Microsoft KMS if available
  • Enable Remote Desktop
  • Create folders on C:\ partition
    • C:\Temp
    • C:\Scripts
    • C:\Source
    • C:\Tools
    • C:\BGInfo
  • Configure BGInfo application
    • Create a shortcut with the following syntax; C:\BGInfo\Bginfo.exe "C:\BGInfo\BGinfo_Win2K8.bgi" /SILENT /TIMER:0 /NOLICPROMPT
    • For Windows 2008 put the shortcut in: C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Startup
    • For Windows 2003 put the shortcut in: C:\Documents and Settings\All Users\Start Menu\Programs\Startup
  • Install Windows Updates
  • Install Windows Features but do not install the following options by default;
    • Microsoft .Net Framework
    • Silverlight
    • IE Compatibility
    • Best Practices Analyzer
  • Set Power Plan to High Performance
  • Set Turn off the display to Never
  • Set Put the computer to sleep to Never
  • Firewall - Set on or off depending on your organization policies and practices
  • Disable UAC
  • Set screen resolution to 1024x768
  • Purge Temporary Folders;
    • C:\Windows\Temp
    • C:\RECYCLED
    • C:\Windows\SOFTWAREDISTRIBUTION\DOWNLOADS
    • C:\Windows\$directory$
    • C:\Users\Administrator\AppData\Local\Temp
  • Release IP address of server (Set to DHCP)
  • Shutdown VM
  • Convert VM to template
Notes:
The CD-ROM drive will be set as D: drive by default. I always change this to Z: drive, but this cannot be part of the template. There are smarter ways to do this, like scripts that run post deployment.

Once every couple of months we need to convert this template back to a VM, power it on and then patch it up to the latest version. Then redo the steps from Purging Temporary Folders onwards.


Comprehensive guide and walk through on building VM Templates;
Comprehensive guide and walk through on building VM Templates;
List of Sysprep files required for various operating system customization's;