VMWare Server – Cloning a Microsoft Windows-Based Virtual Machine


WHY WOULD I WANT TO CLONE A VIRTUAL MACHINE? Good question. One could make a clone copy of a Virtual Machine (VM) for the purpose of creating a back-up; however, more commonly, the cloning of a frequently-used “base” machine build makes the creation of a complex virtual environment much easier.

Consider this. To build a Virtual Machine from scratch, one would launch the VMWare Server Console, choose File | New | Virtual Machine… and then begin the process of specifying the intended guest Operating System (OS) and hardware components for the virtual machine. After Specing out a virtual hardware platform and creating the virtual disk, one would start the virtual machine and only then be able to begin installing the guest OS. After completing a base installation and a rudimentary configuration (generally including a bridged, DHCP-enabled virtual NIC) of the operating system, it would then be a prudent practice to download and apply any patches or critical updates desired by the OS in the virtual machine.

As you can see, apart from the virtual hardware configuration, the process of building a virtual machine mimics the process of building any physical machine. A reasonable expectation would be 4 hours to build and patch a typical OS installation. If you are building one machine, this cost is relatively fixed .. but what if you want to build a more elaborate Active Directory domain or forest? What if you are building a test Active Directory domain where you wish to have a Domain Controller, an Exchange Server, a WSUS Server, and a two member MS-SQL 2005 cluster?

Similar to the idea of Ghosting or RISing-up an image, we can use copy and paste functionality to clone a virtual machine image. Instead of building 5 separate virtual machines (potentially consuming 20 Hrs just to build the operating systems on each) we can build one base install and copy it for each machine to be brought-up in the environment.

Now this paper does not cover building a Master machine image, and our builds were taking place on VMWare Server v1.0.1. For the following process, we are assuming that the person following this instruction set will have familiarity with the Windows environment and file/folder manipulation through Windows Explorer.

CAUTION: For the purpose of this paper, we will negate software licensing concerns by assuming that evaluation software packages have procured for the purpose of building a test environment.

Steps to Create a Clone

Start VMWare Server

Choose Host | Settings

On the General Tab, the default location (your working directory) for your Virtual Machines will be shown

Note the location

Click OK

Stop the instance of the Virtual Machine you wish to clone

Through Windows Explorer, browse to the folder containing the Virtual Machine files

Right click on the VM you wish to clone

Choose Copy

Right click in the open space under the folder list

Choose Paste

The Copy process will begin .. depending upon the size of the Virtual Machine’s disk file/s this may take some time

Right click on the folder that was created by the copy process

Choose Rename

Change the folder name

Tip: I typically use folder names descriptive of the VM guest OS and the intended server function

Start VMWare Server

Choose File | Open

Click Browse

Move up one folder level

Drill down into the folder of the intended clone VM

Select the .vmx file

Click Open

The VM will be added to the Inventory pane

Right click the virtual machine

Choose Rename

Rename it to avoid confusion

Tip: I usually indicate the guest OS, function, and intended IP address for running on my virtual network

Click Start the virtual machine

On the first startup of a cloned VM, you will receive a prompt regarding your desired action for the UUID of the virtual machine

Choose Create

Click OK

And the VM startup process will begin

Login into the virtual machine

Download or copy a program to change the computer’s SID.

Tip: Save the program to the Windows Desktop

Tip: I use NewSID which can be downloaded from http://www.microsoft.com/technet/sysinternals/Security/NewSid.mspx

Right click on the ZIP file

Choose Extract All

The Extraction Wizard will begin

Click Next

Select a Destination for the decompressed files

Tip: Accept the default location

Click Next

Extraction Complete

Click Finish

Double click newsid.exe

End User License Agreement

Click Agree

Choose Random SID

Click Next

A SID will be generated

Tip: Remember to computers with the same hostname will cause a network conflict

Check the checkbox to perform a rename

Rename the Computer

Click Next

Check the checkbox to allow an automatic reboot

Click Next

The new SID and computer name will be applied to the computer and then the virtual machine instance will be rebooted


Conclusion: Attack of the Clones!

As environments have become increasingly complex, especially in large organizations, companies are trying to reduce their IT footprint while squeezing more performance out of their systems. Factors such as AC power, HVAC requirements, and the annual costs of maintaining physical servers are becoming more closely scrutinized. Conversely, the adoption of expandable infrastructure such as high-density core switches and scalable storage systems is moving down across the markets and filtering into the small-to-medium sized business markets.

Server virtualization is a common practice in both production and test environments because it facilitates a lower Total Cost of Ownership (TCO). The more skill and finesse we have with manipulating and leveraging technologies such as VMWare Server, the more efficient, agile, and cost-effective our IT operations can become.