I’ve totally moved from using VMware to VirtualBox for my desktop virtualization needs. I like it because it’s opensource software and is available for all major platforms with features are growing fast.

When I install Windows or Linux on a VirtualBox virtual disk I like to backup it up in order to “freeze” it or have an “snapshot” with the basic install I can use as the basis for other VMs. The problem is just copying the disks and renaming them won’t do the trick because the UUIDs get duplicated and the program complaints about it.

So the proper way to do this is not just copy the disk but use the VBoxManage command that comes with VirtualBox for this task like this:

VBoxManage clonehd origin.vdi destination.vdi

The output of the command goes like this:

VirtualBox Command Line Management Interface Version 3.0.10
(C) 2005-2009 Sun Microsystems, Inc.
All rights reserved.

0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%
Clone hard disk created in format 'VDI'. UUID: ae7ff94b-a7e6-402f-82c7-5d3d7f38a
020

If you have trouble with this command try removing the disk from the Virtual Media Manager and then cloning. Look for the cloned disk image in the ~/.Virtualbox/HardDisks/ directory.

Now If you’ve already copied the disk from some other computer and you can’t clone from the original this other command can save your day:

VBoxManage internalcommands sethduuid copied.vdi

So at this point the derived VDI file has it’s own UUID and VirtualBox won’t complaint. Just add it to the list in the Virtual Media Manager and use it with a VM.