Wednesday, July 7, 2010

Cloning a VirtualBox hard disk (.vdi)

I was trying to clone a virtual hard disk, and didn't realize that making a backup of a VirtualBox Machine (.vdi) is more complex than just copying the file.

The UUID of the duplicated (clone) vdi file was identical to the original, and VirtualBox will not allow the adding of the duplicate.

In doing that, I found a link hidden deep in the bottom of a forum page that allowed me to modify the UUID without having to redo the entire process.

VBoxManage internalcommands setvdiuuid vid_filename.vdi
(You may have to add the full path for the VBoxManage command if it's not in your path.)

Btw, the proper way to backup your VirtualBox Machine is by using the clonehd subcommand.

VBoxManage clonehd original_file.vdi clone_file.vdi.

No comments: