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 (‎)
  • 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:\Windows\$directory$
    • C:\Users\Administrator\AppData\Local\Temp
  • Release IP address of server (Set to DHCP)
  • Shutdown VM
  • Convert VM to template
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;


  1. Nice post!

    Correct me if I'm wrong here...but did you forget the part about setting the correct video driver? SVGA II for older Windows and WVGA for newer Windows boxes. I bring this up because I've never had these video drivers installed automatically with the VM Tools. They're found in the Common Files directory for VMware if I'm not mistaken.

    Just a thought :)

    1. Thank you for the comment. I have never personally had this problem but I cannot see why it shouldn't be part of the image. The following link from VMware has the walkthrough to make this happen;‎