Tuesday, 2 October 2012

VirtualBox – Cannot Register the Hard Drive Because a Hard Drive with UUID Already Exists

Ok so you're trying to create another virtual machine using an existing hard disk file and you get the below error... What do you do? Follow the below guaranteed steps.





Failed to open the hard disk <FilePath>.
Cannot register the hard disk <FilePath><GUID> becuase a hard disk <DifferentFilePath> with UUID <GUID> already exists.
  1. Open the Command Prompt
  2. Change the directory to where VirtualBox is installed (Default: C:\Program Files\Oracle\VirtualBox) (see below on how to change the command prompt directory to another location)
  3. Type the following VBOXMANAGE.EXE internalcommands sethduuid <PathOfNewVHD>
Note that internalcommands and sethduuid need to be lowercase.
Below is the output of me changing the ID of the VHD located at C:\Users\bschacht\VirtualBox VMs\Windows XP (VPN) Copy.vhd





TO CHANGE THE COMMAND PROMPT DIRECTORY DEFAULT PATH:

Type "cd\program files\" etc and then press enter (in the command prompt)
i.e. cd\path and then press enter.

2 comments:

  1. Cheers. This occurs if you also move your .vdi to a new storage path. virtualbox complains that the UUID is already in use, so this enables the .vdi to be relocated to the new path. No idea why they don't bring up a pop up box in the gui to prompt you to do this when it complains.

    my setup was on ubuntu so its a common issue with the product.

    ReplyDelete