Sunday, March 16, 2008

Cloning Virtualbox VM in OS X

It seems cloning a virtual machine is not as simple as copying the .vdi (virtual disk). Once I had an OS installed, I wanted to create duplicate VMs without actually having to install the OS again. Virtualbox specifies a unique identifier to each virtual disk so you have to use their command line cloning tool to create a clone.

Go to the directory where you virtual disk resides. In my case it was $HOME/Library/VirtualBox/VDI.
Once their you can clone the vdi by issuing the command VBoxManage clonevdi original.vdi clone.vdi. You should see output similar to this:

[ 12:18 PM Sun Mar 16 ] [Session: ttys001 VDI]
==> VBoxManage clonevdi Vista.vdi Vista-Clone-1.vdi
VirtualBox Command Line Management Interface Version 1.5.51
(C) 2005-2008 innotek GmbH
All rights reserved.

0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%

Once the disk clone is made, create a new virtual machine, and assign it the cloned image.