Search This Blog

Sunday, April 25, 2010

Cloning / Copying Virtual Hard Drives


I have a base virtual hard drive (VHD) which I use to create new virtual machines (VM) as needed. The base VHD has an operating system (OS) loaded with all latest updates, so when I need a new VM I just make a copy of my base VHD; create new VM with copied VHD. I’ve been using Sun Virtual Box to run my VM’s, it’s got a small memory foot print on the host machine and memory management is better so the precious megabytes on your demo / development pc can be used for fast running VM’s without having to kill each running server on you host machine and it’s free here.

But when cloning / copying VHD’s you sure will be running in to this error:

'Failed to open the hard disk J:\ISO\VPC\RTBase\Base_c.vdi, Cannot register the hard disk ‘J:\ISO\VPC\RTBase\Base_c.vdi’ with  UUID {d6dd48d6-5999-455a-8498-f6f1359ab971} because a hard disk ‘J:\ISO\VPC\RTBase\Base_c.vdi’ with  UUID {d6dd48d6-5999-455a-8498-f6f1359ab971} already exists in the media registry … ' bla-bla-bla

To fix this, Sun Virtual box has a cool command line tool include in its install folder [C:\Program Files\Sun\VirtualBox], VBoxManager. Executing the following command will change / assign a new UUID to the cloned / copied VHD.

Command line:
VBoxManage internalcommands sethduuid J:\ISO\VPC\SMDMOSSServer_c.vdi


Result:

No comments: