<

HOW TO: Clone or Copy a virtual machine in VMware vSphere Hypervisor ESX/ESXi 4.x or ESXi 5.0

Published on
143,321 Points
61,621 Views
47 Endorsements
Last Modified:
Andrew Hancock (VMware vExpert / EE MVE^2)
MVE^2, Expert of the Year 2016-2011, Scribe 2016-2012, Author of the Year 2016,2013-2012 VMware vExpert 2016-2011 27 years of experience.
This Tutorial covers a very basic and common question asked on Experts Exchange, "How Do I Clone or Copy a virtual machine in VMware vSphere Hypervisor ESX/ESXi 4.x, ESXi 5.0?"

Using the following method, no third party tools are required or need to be installed, other than the VMware vSphere Client.. The VMware vSphere Client is used to manage a VMware vSphere Hypervisor ESX/ESXi 4.x, ESXi 5.0 host server. This procedure can be used when connected directly to the host server or VMware vSphere vCenter Management Server.

1. Connect to the VMware vSphere Hypervisor Server


Using the VMware vSphere Client, login and connect to the ESX/ESXi server, using the IP address or hostname of the ESX/ESXi server, using the root username and password credentials. If you have a VMware vSphere vCenter server, you could also specify IP address or hostname of the vCenter server which manages your ESX/ESXi servers.

Using the VMware vSphere Client, login and connect to the VMware ESX/ESXi server

2. Select and browse the datastore


Once connected to the server, the VMware vSphere Client will display the following inventory of the VMware vSphere ESX/ESXi server.

Connected to VMware ESX/ESXi server
The datastore properties are shown on the right hand side

Datastore Properties
Select the datastore, if you've not rename the datastore, the datastore default name is datastore1.

Right Click the datastore datastore1 and select Browse datastore. All VMware virtual machine files are stored in the datastore.

Browse Datastore

3. Select the correct virtual machine folder


The Datastore Browser will open and show the contents of the datastore. The virtual machines are stored in folders.

Datastore Browser - datastore contents
Double click the virtual machine folder you need to clone or copy.


4. Create a destination virtual machine folder for the virtual machine clone or copy


Select the root (/) of the datastore, and click the New Folder icon to create a new destination folder for the new virtual machine clon or copy..

Create folder
Enter a name for the folder name followed by OK.

 Enter folder name
The folder will be created in the root of the datastore

Folder Created in root of the datastore

5. Select and Copy Virtual Machine files


Before you can CLONE/COPY the virtual machine files the Virtual Machine needs to be POWERED-OFF.

Double click the virtual machine folder you need to clone/copy.

VM Folder
Select ALL the files in the VM folder to be cloned/copied.

 Select all the VM files
Once all the files have been selected, Right Click and Select Copy.

Right Click and Select Copy
Select and open the folder created in Step 4.

 Folder Created in root of the datastore
the folder will be empty

 Empry Folder
Right click the empty folder space and Right Click and Select Paste

 Right click the empty folder space and Right Click and Select Paste[
The Copy Progress bar will be displayed, indicating a time to completion.

The Copy Progress bar will be displayed
Contents of the new folder, with the cloned/copied virtual machine files.

 Contents of the new folder, with copy or clone of the virtual machine.

6. Register the cloned/copied virtual machine with the Inventory


Select and Right Click the virtual machine VMX file.

 Add to Inventory
Follow the Add to Inventory Wizard, make sure the name is different and unique, it must be different to the original virtual machine name. This is just a friendly name for the inventory, it does not change the name of the name of the virtual machine OS.

Enter a Inventory Name followed by Next

 Add name
Select the host, that you want to add this virtual machine to, followed by Next

 Add VM to host
Review the details and Click Finish to add the VM to the Host Machines Inventory. The Virtual Machine will be added to the inventory.

Review and Finish
You have successfully cloned or copied a virtual machine.

 vSphere Client Inventory with Cloned, Copied Virtual Machine
*******************************************************************************************************************************************
Thank you for reading my article, please leave valuable feedback. If you liked my VMware article and would like to see more VMware Articles from me, please click the Yes button near the: Was this article helpful? at the Top of this article to the right of the Article title. Thank You.
*******************************************************************************************************************************************
47
Comment
  • 7
  • 2
  • 2
  • +4
16 Comments
 

Expert Comment

by:sndmnsix
Using this method, couldn't you potentially be able to just fire up the cloned/copied server and leave the 'powered-off' one off until you've verified that the cloned copy comes up properly?  

On the second to last screen-shot, it says 'creation of the virtual machine does not include automatic installation of the guest operating system.'  I would think that if we're cloning, the OS would be there to boot up correct?
0
 
LVL 119

Author Comment

by:Andrew Hancock (VMware vExpert / EE MVE^2)
Yes, you could do that! It depends on what you are trying to achieve!

that's not cloning process, that's adding to the Inventory! it's just a reminder, you need to have an OS in the VM to Boot!!!
0
 

Expert Comment

by:sndmnsix
Sweet.  I have been studying a little more as to how to move a VM to another datastore.  This seems like a very basic and easy way of making it happen.  Thanks again.
0
NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

 
LVL 119

Author Comment

by:Andrew Hancock (VMware vExpert / EE MVE^2)
if you find the article helpful please Vote Yes, if you have not already done so! Which is now At the End of the Article! Thanks
0
 

Expert Comment

by:ITSupport444
really good article it helped me a lot.

thanks
0
 
LVL 119

Author Comment

by:Andrew Hancock (VMware vExpert / EE MVE^2)
@IT,...

Thanks for your comments.

Andy
0
 

Expert Comment

by:Vince Janisse
Will this work with SBS 2011? I have tried this with SBS 2011 but I just copied  VMX and the vmdk file only not all the files, do I need them all.

It didn't work, the NIC driver got a code 1 error, Active directory was blank, exchange services were stuck on stopping?
0
 
LVL 119

Author Comment

by:Andrew Hancock (VMware vExpert / EE MVE^2)
Yes, it will work, I've answered your question with other suggestions as well.
0
 

Expert Comment

by:Go-Bruins
HI - a couple of questions...

1. Will this work in ESXi 5.5?
2. Will it retain all the snapshots?

Thanks in advance.
0
 
LVL 119

Author Comment

by:Andrew Hancock (VMware vExpert / EE MVE^2)
@Go-Bruins -

1. Yes VALID for ALL ESXi 4.x - 6.5 versions.

2. Yes if you copy them!
0
 

Expert Comment

by:Go-Bruins
Thanks for the reply.

Will this method also work to move a VM from one Datastore to another? Even if the physical disks are different (platter vs. SSD)?

If so, this would be a great way to migrate a VM from a conventional drive to an SSD drive.
0
 
LVL 119

Author Comment

by:Andrew Hancock (VMware vExpert / EE MVE^2)
@Go-Bruins

Yes.
0
 

Expert Comment

by:dennis dennis
I get an error when I copy while the VM is running. I have to turn the VM off. Is there any way to make a copy of a live running VM?
0
 

Expert Comment

by:dennis dennis
Oh nevermind.. I just use the clone function under Vsphere and it copies without having to shutdown the VM.
0
 
LVL 119

Author Comment

by:Andrew Hancock (VMware vExpert / EE MVE^2)
I get an error when I copy while the VM is running. I have to turn the VM off. Is there any way to make a copy of a live running VM?

Correct observation. VM must be off.

Oh nevermind.. I just use the clone function under Vsphere and it copies without having to shutdown the VM.

if you have the luxury of vCenter Serer that's the correct method - CLONE function.
0
 

Expert Comment

by:bill villers
Does it need to be "root" username?  Or, can it be an administrator?
0

Featured Post

Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

Join & Write a Comment

Teach the user how to delpoy the vCenter Server Appliance and how to configure its network settings Deploy OVF: Open VM console and configure networking:
Teach the user how to rename, unmount, delete and upgrade VMFS datastores. Open vSphere Web Client: Rename VMFS and NFS datastores: Upgrade VMFS-3 volume to VMFS-5: Unmount VMFS datastore: Delete a VMFS datastore:

Keep in touch with Experts Exchange

Tech news and trends delivered to your inbox every month