| VIRT-CLONE(1) | Virtual Machine Manager | VIRT-CLONE(1) |
virt-clone - clone existing virtual machine images
virt-clone [OPTION]...
virt-clone is a command line tool for cloning existing virtual machine images using the "libvirt" hypervisor management library. It will copy the disk images of any existing virtual machine, and define a new guest with an identical virtual hardware configuration. Elements which require uniqueness will be updated to avoid a clash between old and new guests.
By default, virt-clone will show an error if the necessary information to clone the guest is not provided. The --auto-clone option will generate all needed input, aside from the source guest to clone.
Please note, virt-clone does not change anything _inside_ the guest OS, it only duplicates disks and does host side changes. So things like changing passwords, changing static IP address, etc are outside the scope of this tool. For these types of changes, please see virt-sysprep.
Most options are not required. Minimum requirements are --original or --original-xml (to specify the guest to clone), --name, and appropriate storage options via -file.
An example or possible generated output:
Original name : MyVM
Generated clone name : MyVM-clone
Original disk path : /home/user/foobar.img
Generated disk path : /home/user/foobar-clone.img
If generated names collide with existing VMs or storage, a number is appended, such as foobar-clone-1.img, or MyVM-clone-3.
Clone the guest called "demo" on the default connection, auto generating a new name and disk clone path.
# virt-clone \
--original demo \
--auto-clone
Clone the guest called "demo" which has a single disk to copy
# virt-clone \
--original demo \
--name newdemo \
--file /var/lib/xen/images/newdemo.img
Clone a QEMU guest with multiple disks
# virt-clone \
--connect qemu:///system \
--original demo \
--name newdemo \
--file /var/lib/xen/images/newdemo.img \
--file /var/lib/xen/images/newdata.img
Clone a guest to a physical device which is at least as big as the original guests disks. If the destination device is bigger, the new guest can do a filesystem resize when it boots.
# virt-clone \
--connect qemu:///system \
--original demo \
--name newdemo \
--file /dev/HostVG/DemoVM \
--mac 52:54:00:34:11:54
Please see https://virt-manager.org/page/BugReporting
Copyright (C) Fujitsu Limited, Copyright (C) Red Hat, Inc, and various contributors. This is free software. You may redistribute copies of it under the terms of the GNU General Public License "https://www.gnu.org/licenses/gpl.html". There is NO WARRANTY, to the extent permitted by law.
"virt-sysprep(1)", virsh(1), "virt-install(1)", "virt-manager(1)", the project website "https://virt-manager.org"
| 2019-01-19 | 2.0.0 |