Cloning a Virtual Machine

Most of us have heard of “Virtual Servers” even though we may not really know (or care) what that means.  If you do a search on Google or Bing (or whatever search engine you use) you will find lots of results, most of which reference VM Ware or Virtual PC.

With easy to use, and often free, tools you can create a “virtual” system of servers, work stations, or whatever you want. In this post we will talk specifically about how to clone an existing Virtual Machine so that you can create new VM’s with little effort. It is assumed that you have already installed VMWare Server and that you have also created a Virtual Machine that you wish to copy. In this example we have installed Windows Server 2003 R2 on a new VM, along with all the security updates, and we want to copy this to avoid having to go through the hours of pain it takes to get a new OS installed and ready to go.

If you have not done so already go to http://www.vmware.com/products/server/  and download VMWare Server. It’s important to note that this is the Free Server product they have. They offer a TON of other stuff, but VMWare Server is where you want to start. In addition if you do not have an MSDN account, or legal copies of an operating system that you want to install on your Virtual Machines, than you may qualify for one of the programs offered by Microsoft which will get you access to the software you need.

Need Legal OS Sorftware:

You’re a Web Developer? Get involved with Website Spark:http://www.microsoft.com/web/websitespark/

You own your own business and develop software as a service to your clients? BizSpark is what you want: http://www.microsoft.com/bizspark/

Are you a student and learning software development? DreamSpark is what you want:https://www.dreamspark.com/default.aspx

Once you have the tools and the software then follow the steps to create a new Virtual Machine in VMWare. Install the OS and get all the updates installed. Once you are completely finished then follow these instructions to “clone” that Virtual Machine.

Follow these instructions

 

Step 1:

In the VMWare Console select the Virtual Machine you wish to clone. In the Commands section click the link that says “Power Off”.

Using Windows Explorer navigate to the location of your Virtual Machines (often referred to as the “Inventory Location”), in my case this was located on a Share Drive in a folder called Virtual Machines.

Locate the VM you wish to clone, copy the folder and all of its contents into a new folder. Make sure that this is also located within the same folder as your other VMs (a.k.a. it needs to be within the Inventory Location).

Step 2:

Open the VMWare console, on the right hand side under the section labeled Commands click the link that says “Add Virtual Machine to Inventory”

Expand the nodes under the inventory column until you find the folder of the copied VM, select the folder, and under the Contents section select the file that has the .vmx extension (you should only see this one file). Click OK.

Step 3:

Look back as the Inventory section of the console, you will notice that the copied VM appears in the list and has the same name as the original. Select the copied VM (the 2nd one in the list, newer appears below the older). From the right hand side of the console, under the Command section, select the link that says “Configure VM”

The VM Configuration window appears. Confirm that you have selected the correct VM by looking at the Working Directory; it should be the path to the copied files.

In the Virtual Machine Name textbox enter a new name, click the OK button.

Step 4:

If the new Virtual Machine is not running then, under the Commands section, click the link that says “Power On”

Select the tab labeled “Console”, click anywhere in the console window to open the command window in order to remote into the machine

We need to change the name of this new machine so that we don’t have duplicates on the network. Enter the same username and password that you used to access the original machine and log into the server. Using Windows Explore right click on “My Computer” and select Properties

Select the “Computer Name” tab, click on the button labeled “Change”, enter a new name for this computer and click the OK button. You will be prompted to restart the computer, click OK.

Step 5:

In the Inventory section of the console select the original Virtual Machine (the one you cloned), under the Commands section select the link that says “Power On”.

Select the Console tab and remote into the server, ensure that all is well.

Congratulations, you have successfully cloned your Virtual Machine

Leave a Reply

Your email address will not be published. Required fields are marked *

10 + fourteen =