Tags

, ,

PreStep 1: Have a functional VM you wish to close

I have a functional VM and want to clone it.

Step 1: turn off or at least pause the virtual machine

Step 2: go to the location its disc is stored in memory. For me it was /var/lib/libvirt/images/

Step 3: copy that image to make a new one, the clone.

cp cluster-1.img cluster-2.img

if you want you can background this by typing control+d, then “bg” and enter. Or you can just wait a minute

Step 4: dump the xml configruation

virsh dumpxml cluster-1.img > foo

Step 5: now edit the file

nedit foo

Step 6: in the file remove the line containing the uuid, dont worry virsh will give it a new one, change all machine names to cluster-2.img from cluster-1.img, and change the MAC address.

step 7: save and exit nedit

step 8: define the new virtual machine

virsh define foo