How To Build An Effective Virtual Machine Template
How To Build An Effective Virtual Machine Template
By Mark Gabryjelski
published: Friday, March 24 2006





By Mark Gabryjelski of Expert Server Group

 

For the next generation tutorial, click here .
 
Summary

Many people have been asking for some tips on how to build a VMware Workstation Virtual Machine. The following guide has been written with the assumption that this will be the first Virtual Machine you will be configuring, and that you will be creating this as a ‘template’ Virtual Machine.

A ‘template Virtual Machine, will be a Virtual Machine, configured by you, which will be prepared for rapid deployment of additional Virtual Machines. ‘Rapid Deployment’ means being able to deploy a new pre-configured virtual machine in 10 to 15 minutes.

An assumption will be made that you have the current version of VMware Workstation (as of this writing, version 5.5.1 build 19175) installed on your workstation. It will also be assumed that you understand how to install and configure Windows XP Professional, as this will be the operating system configured as the ‘template.’

You will step through the process of:

  • Creating the first Virtual Machine
  • Making changes to the configuration file relating to that Virtual Machine
  • Installation of the operating system
  • Installation of VMware Tools
  • Patching the operating system
  • Cleanup of the Virtual Machine’s hard drive
  • Use of the Microsoft Sysprep Utility
  • Additional cleanup of the Virtual Machine’s configuration
  • Cleanup of the directory where the Virtual Machine’s files exist
  • Creating an archive/zip file of the Virtual Machine
  • Creating a Virtual Machine from the archive

Pardon the length of the document. Screenshots make up the bulk of this document, just so that there are no questions about the steps detailed here.

The tutorial is split into three sections:
Initial Virtual Machine Configuration | Making Changes to the VMX file | Install the Operating System

Initial Virtual Machine Configuration


Start by using the pull down menu, and go to ‘File > New’
Click ‘Next’ to continue.




Select ‘Custom’ as it provides you with more choices for the installation.
Click ‘Next’ to continue.




The first choice, ‘New –Workstation 5’ is a configuration of the most up to date VMware Workstation Virtual Machine.
Click ‘Next’ to continue.




For your first Virtual Machine, you will be creating a Microsoft Windows XP Professional Virtual Machine. Make the appropriate selection.
Click ‘Next’ to continue.




Here, change the default names. The template Virtual Machine will have a generic computer name of ‘winxpprosp2’. Note that you’ll use this name in a few places. Make the change for the ‘Virtual Machine Name’ and the entry in the ‘Location’ (which will actually be a directory holding all files relating to this Virtual Machine.
Click ‘Next’ to continue.




Here you allow the Virtual Machine to use 1 of the physical processors that exists in the physical workstation. Remember, when building a ‘template’, less is more! Choose ‘One’.
Click ‘Next’ to continue.




Here you allocate RAM to the Virtual Machine. Remember, when building a ‘template’, less is more! I use 256 MB but you can allocate more or less depending on your host system.
Click ‘Next’ to continue.




Next, determine the Virtual Machine’s network connectivity. For the ‘template’, let’s keep it simple. Choose ‘Use Bridged Networking’.
Click ‘Next’ to continue.




Here you can choose the type of ‘Virtual SCSI I/O Adapter’ for our Virtual Machine. Windows XP works with the ‘BusLogic’ SCSI adapter.
Click ‘Next’ to continue.




Now you must create a ‘Virtual Hard Disk’ for the Virtual Machine. Choose ‘Create A New Virtual Disk’.
Click ‘Next’ to continue.




Since you are putting effort into your ‘template’, let’s give the Virtual Machine a SCSI drive.
Click ‘Next’ to continue.




How big should you make the drive? Should you allocate all the disk space now? Should you split it into files less that 2-GB in size? All good questions, although there are no correct answers.

NOTE: What works well for me (when building a template for VMware Workstation, NOT VMware ESX Server), is some over-allocation (25-GB), but I do NOT allocate the space right away, nor do I split this into files less than 2-GB in size.
Click ‘Next’ to continue.




Now you must name the file that will be the Virtual Machine’s SCSI hard disk.
Use the SAME name as before:
‘winxpprosp2’.

This is for consistency (good stuff once you have many Virtual Machines going, and need to make sense of your directory structures and files).
Click ‘Finish’ to continue.




You are now provided with a summary of your Virtual Machine.
No…you’re not done. You’ll make some changes to the Virtual Machine’s configuration prior to installing an operating system.
Note the location of the ‘Configuration File’. You’ll be going into that directory and viewing the files contained, and editing the VMX file in the next section.


Next you will need to Boot the Virtual Machine by pressing the “play button”. This will create the initial entries in the VMX file. Ignore SCSI errors and wait for it to display a error message about not being able to find an OS. At this point press the “stop button” to power down the Virtual Machine.

Continue to: Making Changes to the VMX file