VMware Cloud Community
hmp_khauff_85
Contributor
Contributor

How can i clone a virtual machine?

How can i clone a virtual machine? I someone remember it can be possible in virtual server 2005 with differencing disk option. using a machine that acts as Parent where is configured the sysprep.

So how can i do it in Vmware? making a Parent VM and then clone VMs from it.

0 Kudos
5 Replies
jayolsen
Expert
Expert

Which VMware producte are you using?

0 Kudos
nitinsahi
Enthusiast
Enthusiast

Are you want to do on ESX Box , v2v motion will help you to do so.

0 Kudos
bpalleschi
Contributor
Contributor

It's pretty simple if you are doing it through VirtualCenter. You right-click on the VM and hit "clone", but there are a couple of things you want to do to prepare and be aware of.

1) Realize the source VM has to be turned off first in order to clone.

2) When cloning, remember it will change the name inside the VMFS partition directory only (assuming VI3) when it asks for the new name (otherwise it will just be "clone of xxxx"). You will need to change the server name later.

3) The SID will be the same. I use NewSID off of Microsoft's website to rename and change the SID at the same time. The command is "newsid /a \[newname]".

Hope that helps.

bp

0 Kudos
MarkNorman
Contributor
Contributor

If you are using ESX then you can just copy and paste the VM disk file. The source VM needs to be turned off.

You can then create a new virtual machine, and point to the copied disk file.

Remember to regenerate the SID's with sysprep

0 Kudos
wbliss
Contributor
Contributor

It's actually as easy as copying a folder using your operating system's file management tools. Your entire virtual machine is contained in a single folder in your C:\Virtual Machines directory, one folder to a machine.

My experience is with VMware server and I clone machines daily for my QA work. I have a Windows server VM, for example, that I copy from a directory of "seeds", as I call them, to my c:\Virtual machines folder.

To create a seed, I create my new vm machine, install the OS I want, and any other basic software I want to have as my starting point. then I shut down that machine. I then copy that VM folder to my "seed" folder for safe keeping. Any time the VM is in off mode, you can rename that folder to anything you like (within a 15 character limit), So I might use win2003-seed as the folder name to make it self-identifying.

Now, when I want to install a new product build on a clean server, I copy that entire win2003-seed folder to my Virtual machines location; this takes me about 8 minutes. Then I'll rename it to, perhaps, win2003-build123. Once done, inside my vmware server console, on the home tab, I click on open existing virtual machine and browse for the folder I just created. Inside that folder is the *.vmx file that is needed to open the machine. This adds the machine to your console in a new tab. Before you start your clone you might want to change the settings including the virtual machine name (which changes the name on the tab).

As your clone starts up the first time, the config file (can't remember the name off hand) is, naturally, out of date and a complex dialog offers options but all you want to do is agree to build a new one. After this, you are ready to go.

If you are networked, on first startup of your clone, you may need to (on Windows) open the settings>control panel>system utility and rename the machine so there is no conflict of two machines with the same name, and if your vm seed had a hard-coded IP address, you might need to give your new copy a different hard-coded IP address if there is a chance of more than one of your clones being on line at the same time. If you are set to automatically get an ip address from dns, then it is done for you.

One variation on this theme is if I am cloning a VM in the same folder, Windows doesn't have a "copy a folder as" function, so just create a new folder with whatever name you like, then copy the entire contents of your source folder to your target folder (don't drag! - on the same drive, drag moves rather than copies files).

Hope this helps

Bill

0 Kudos