Sun 8 Apr 2007
Today I was doing some pre-release testing of our software and to test it I was needed three separate servers running MySQL. After some thinking I decided to use my “old” workstation (actually it is pretty powerful Sempron with 2Gb of RAM, but now I use my macbook as a primary workstation) and start 3 separate virtual servers there. Of course, as all admins, I’m little bit lazy and installing Debian on all three machines was not appropriate solution ;-). So, I’ve created one machine, installed brand-new Debian Etch there and then begun to look for solution to clone this machine to run it in three copies. After all these operations were done, I’ve decided to spend time I’ve saved with this simple trick to describe here how to clone VmWare Server virtual machine without any pain.
First of all, we need to find where all our virtual machines are in our system. After small search I’ve found vmware files in /var/lib/vmware/Virtual Machines. There are some set of directories each corresponds to some of your already created virtual machines. In my case I was interested in cloning virtual machine with name db1 to new machine db2 and then to db3.
I’ve copied entire db1 directory to new one:
Next step was to rename virtual machine’s disk image (maybe it is not necessary but I decided that it would be better to perform this operation). To manage vmware disk images you could use vmware-diskmanager tool which resides in vmware’s binary directory (/vmware/bin in my case):
Next (and, actually, last) step was to rename virtual machine config and change disk image name in this config file:
scoundrel@scoundrel-desktop:/var/lib/vmware/Virtual Machines/db2$ sed -i 's/db1.vmdk/db2.vmdk/' db2
That’s it! Now we can start this new machine with VMware server console, it would ask as to change machine’s UUID (which is machines MAC address) and after uuid change this machine will get new IP address from dhcp server (in my case - wifi router). As always it was easy and funny. Stay tuned and I’ll say you why you should not use MySQL’s config file (my.cnf) to setup replication (this hint is for my next post).
- How to run GUI-programs on a server without any monitor
- Small Tip: How to set up two interface Xen machine
- Linux User in Solaris 10 Survival Guide
- Berkeley lectures as podcasts
- Typical Configurations Overview For Nginx HTTP(S) Reverse Proxy/Web Server

2007-04-11 at 10.48 am
[...] Как клонировать виртуальную машину при использовании VmWare Server - Алексей Ковырин делится личным опытом [...]
2007-08-29 at 6.37 pm
[...] Continue reading about virtual machines cloning with Vmware Server… [...]
2007-09-11 at 5.25 am
[...] Continue reading about virtual machines cloning with Vmware Server… [...]
2007-11-23 at 4.42 pm
I can confirm it is not mandatory to rename vm disk.
So cloning VMs could be even faster!!
2008-01-26 at 11.22 pm
[...] http://blog.kovyrin.net/2007/04/08/how-to-clone-virtual-machine-with-vmware-server/trackback/ [...]
2008-03-03 at 7.36 pm
I am using vmware-server-1.0.4-56528 on Ubuntu 7.10 and I cannot find the vmware-diskmanager utility. In fact, there is no /vmware/bin on my system. I built vmware-server and vmware-mui from sources, is there another package I should have downloaded?
2008-04-18 at 1.01 pm
Would-be Cloner:
find / | grep vmware-diskmanager
2008-05-08 at 9.44 pm
I appreciate this-you got me started on fixing my issue. Keep on!
2008-07-10 at 1.48 pm
[...] per scontato il punto 1), eseguiamo la procedura del punto 2) secondo quanto scritto in questo link e aggiungiamo la nuova virtual machine al server vmware (punto [...]