7.9. VBoxManage clonevm

The VBoxManage clonevm command creates a clone of an existing virtual machine (VM). The clone can be a full copy of the VM or a linked copy of a VM.

VBoxManage clonevm vm [ --basefolder basefolder ]
[ --group group, ... ] [ --mode machine | machinechildren | all ]
[ --name name ] [ --options link | keepallmacs | keepnatmacs | keepdisknames | keephwuuids ]
[ --register ] [ --snapshot vm ] [ --uuid uuid ]

In addition to specifying the name of the VM to clone, which is required, you can specify any of the following options:

  • --basefolder basefolder specifies the name of the folder in which to save the configuration for the new VM.

  • --groups group, ... assigns the clone to the specified group or groups. If you specify more than one group, separate each group name with a comma.

    Note that each group is identified by a group ID that starts with a slash character (/) so that groups can be nested. By default, a clone is always assigned membership to the / group.

  • --mode machine|machineandchildren|all specifies which of the following cloning modes to use:

    • machine mode clones the current state of the existing VM without any snapshots. This is the default mode.

    • machineandchildren mode clones the snapshot specified by by the --snapshot option and all child snapshots.

    • all mode clones all snapshots and the current state of the existing VM.

  • --name name specifies a new name for the new VM. The default value is "name Clone", where name is the original name of the VM.

  • --options specifies how to create a new clone.

    • --options link creates a linked clone, which can be cloned only from a snapshot.

    • --options keepallmacs specifies that the new clone reuses the MAC addresses of each virtual network card from the existing VM.

      If you do not specify this option or the --options keepnatmacs option, the default behavior is to reinitialize the MAC addresses of each virtual network card.

    • --options keepnatmacs specifies that the new clone reuses the MAC addresses of each virtual network card from the existing VM when the network type is NAT.

      If you do not specify this option or the --options keepallmacs option, the default behavior is to reinitialize the MAC addresses of each virtual network card.

    • --option keepdisknames specifies that the new clone reuses the disk image names from the existing VM. By default, disk images are renamed. You can preserve source hardware IDs by adding keephwuuids.

    • --option keephwuuids specifies that the new clone reuses the hardware IDs from the existing VM. By default, new UUIDs are used.

  • --register automatically registers the new clone in this Oracle VM VirtualBox installation. You can manually register the new VM later by using the VBoxManage registervm command. See Section 7.6, “VBoxManage registervm/unregistervm”.

  • --snapshot vm specifies the snapshot on which to base the new VM. By default, the clone is created from the current state of the specified VM.

  • --uuid uuid specifies the UUID for the new VM. Ensure that this ID is unique for the Oracle VM VirtualBox instance if you decide to register this new VM. By default, Oracle VM VirtualBox provides a new UUID.