Tuesday, June 28, 2011

Cloning your virtual box in Windows

So you have discovered VirtualBox (or the more exotic Portable-VirtualBox), created a wonderful little virtual Windows or Linux--and now you would like to copy it onto a friends computer, or save a backup copy. If only it were as simple as a "copy paste" on your .vdi file. You have tried this, but stumbled upon the dreaded "duplicate UUID" error message.

VirtualBox CAN clone your virtual.vdi file, but you need to resort to the command prompt in order to utilize it. Cloning is really not as hard as many techies have lead you to believe. Simply open a command prompt and navigate until you are in the VirtualBox file (Remember cd .. takes you up a directory and ls shows everything in it). Most installs of VirtualBox are in the path C:\Program Files\Oracle\VirtualBox. In the following line of code, I have already migrated there. The ">" is the prompt. From there, type VBoxManage.exe clonehd "path to vdi\file.vdi" "path you want the copy in\name of the copy.vdi" and hit enter.

Here is an example:

C:\Program Files\Oracle\VirtualBox>VBoxManage.exe clonehd "C:\Windows_XP_Pro_XAM
PP.vdi" "C:\Windows_XAMPP.vdi"
0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%
Clone hard disk created in format 'VDI'. UUID: 1bd8d200-d6d3-4ea6-914b-3664146b3
4e9