VirtualBox : Cloning a virtual hard disk

If you’ve got a VirtualBox VM already installed and you wish to clone/copy it, follow the steps below :

  1. Clone the disk image with a similar command line (you will have to adjust your paths) :
    kattoo@roadrunner /files/toSave/home/kattoo $ VBoxManage clonehd /files/vservers/{VM1/disk1.vdi,VM2/disk2.vdi}
    VirtualBox Command Line Management Interface Version 3.0.10
    (C) 2005-2009 Sun Microsystems, Inc.
    All rights reserved.
    Clone hard disk created in format 'VDI'. UUID: 84956ae4-6c85-41cf-aa23-a265029d99a8
    kattoo@roadrunner /files/toSave/home/kattoo $ 
  2. Setup a new virtual machine through the virtualbox GUI or otherwise, with the same parameters as the original one and attach this new disk

Note : This command doesn’t take care of potential snapshots you could have on the source disk image. It will only clone the base image, so you might have to merge the snapshots into the base image before cloning if you want those to be integrated in the copy.

References :