Computer >> Computer tutorials >  >> Troubleshooting >> computer maintenance

FIX: VirtualBox Failed to open Hard Disk file. Cannot register virtual hard disk because a disk with the same UUID already exists.(Solved)

This tutorial contains instructions to fix the following error when trying to add an existing virtual hard drive in VirtualBox: "Failed to open the hard disk file <VirtualHardDiskFilename.vdi>, because a hard disk with the same UUID already exists". 

The "Failed to open the disk Image File – Cannot Register Hard Disk" error in VirtualBox appears because the VM Disk Image File that you try to open has the same UUID with another Virtual Disk Image file. At that case, Virtualbox cannot register the disk image file (VDI, VHD, VMDK, etc.) and displays the following error:

FIX: VirtualBox Failed to open Hard Disk file. Cannot register virtual hard disk because a disk with the same UUID already exists.(Solved)

 

"Cannot register the hard disk 'C:\Users\%Username%\VirtualBox VMs\%VirtualDiskName1%.vdi' {%Virtual-Disk-UUID%} because a hard disk 'C:\Users\%Username%\VirtualBox VMs\VirtualDiskName2%.vdi' with UUID {%Virtual-Disk-UUID%} already exists.

Result Code:
E_INVALIDARG (0x80070057)
Component:
VirtualBox
Interface:
IVirtualBox {fafa4e17-1ee2-4905-a10e-fe7c18bf5554}
Callee RC:
VBOX_E_OBJECT_NOT_FOUND (0x80BB0001)"

How to resolve VirtualBox error: Failed to open virtual hard disk file (.VDI) because hard disk already exits.

Method 1. Remove the Missed Virtual Disk file from VirtualBox.
Method 2. Clone Disk Image with Virtual Media Manager.
Method 3. Change the Virtual Disk's UUID.

 

Method 1. Remove Missed Virtual Disks from VirtualBox.

The above error can appear if you have moved the virtual hard disk to another location (e.g. volume) and then you try to re-add the virtual hard disk (from the new location) to a new or to an existing virtual machine, without having previously removed the missed disk from VirtualBox. At this case, you have to release the missing virtual disk file using the VirtualBox Media Manager. To do that:

1. From VirtualBox File menu, open the Virtual Media Manager.

FIX: VirtualBox Failed to open Hard Disk file. Cannot register virtual hard disk because a disk with the same UUID already exists.(Solved)

 

2. Highlight the missed Virtual Disk (the one with the error sign)* and click Release. (When asked, press the Release button to release the missing hard drive.)

* Note: If you don't see any missed disks here, continue to method-2.

FIX: VirtualBox Failed to open Hard Disk file. Cannot register virtual hard disk because a disk with the same UUID already exists.(Solved)

 

3. Then, click Remove (and then press the Remove button) to remove the missing virtual hard disk.

FIX: VirtualBox Failed to open Hard Disk file. Cannot register virtual hard disk because a disk with the same UUID already exists.(Solved)

 

4. Close Virtual Media manager.
5. Highlight the VM where you want to add the Virtual Hard Drive file (.VDI) and click Settings.

FIX: VirtualBox Failed to open Hard Disk file. Cannot register virtual hard disk because a disk with the same UUID already exists.(Solved)

 

6. Select Storage at the left pane and then click the 'Add hard disk' icon at the right.

FIX: VirtualBox Failed to open Hard Disk file. Cannot register virtual hard disk because a disk with the same UUID already exists.(Solved)

 

7. Click Choose existing disk.

FIX: VirtualBox Failed to open Hard Disk file. Cannot register virtual hard disk because a disk with the same UUID already exists.(Solved)

 

8. Select the virtual hard disk file that you want to add and click Open.

FIX: VirtualBox Failed to open Hard Disk file. Cannot register virtual hard disk because a disk with the same UUID already exists.(Solved)

 

9. Click OK to close Virtual Machine settings.

FIX: VirtualBox Failed to open Hard Disk file. Cannot register virtual hard disk because a disk with the same UUID already exists.(Solved)

 

10. Start the Virtual Machine.

 

Method 2. Clone Virtual Disk with Virtual Media Manager.

To avoid the "Failed to open the disk Image File, Cannot Register the Hard Disk" error from happening,  is to clone Virtual Disk image files (VDI, VHD, etc.), by using the VirtualBox Media Manager,* instead of using the host's OS Copy/Paste functions. To do that:

* Note: The proper way to successfully clone an existing virtual hard disk image file (VDI, VHD, VMDK, etc.), is to use the Copy function in VirtualBox Media Manager.

1. From Virtualbox's File menu select Virtual Media Manager.

FIX: VirtualBox Failed to open Hard Disk file. Cannot register virtual hard disk because a disk with the same UUID already exists.(Solved)

 

 

2. Select the Virtual Hard disk, that you want to clone and click Copy.

FIX: VirtualBox Failed to open Hard Disk file. Cannot register virtual hard disk because a disk with the same UUID already exists.(Solved)

 

3. At the next screen, make your choices about the "Disk Image File Type" & "Size" (or leave the default settings) and finally give a name for the new disk image.
4. When done, click Copy and wait until the new disk image creation completed.

FIX: VirtualBox Failed to open Hard Disk file. Cannot register virtual hard disk because a disk with the same UUID already exists.(Solved)

 

5. When the copy done, use the copied disk image to create a new virtual machine in Virtualbox.

 

Method 3. Change the Virtual Disk's UUID.

The final method to resolve the "Cannot Register Virtual Hard Disk" problem, is to reset the UUID of the Virtual Disk file (VDI) mentioned in the VirtualBox's error. To do that:

1. Close VirtualBox application.

2. Open Command Prompt as Administrator. To do that:

a. In the Search box type: cmd (or command prompt).
b. Right click on the command prompt (result) and select Run as Administrator.

FIX: VirtualBox Failed to open Hard Disk file. Cannot register virtual hard disk because a disk with the same UUID already exists.(Solved)

 

3. Copy & Paste in command prompt the following command in command prompt window and press Enter:

  • cd C:\Program Files\Oracle\VirtualBox

FIX: VirtualBox Failed to open Hard Disk file. Cannot register virtual hard disk because a disk with the same UUID already exists.(Solved)

 

4. Now type the following command and press Enter: *

  • vboxmanage internalcommands sethduuid "%Full_Path_To_VHD_File%"

* Note: At the above command change the %Full_Path_To_VHD_File% value according your case. For example: If you want to reset the UUID of the virtual disk image file "Windows7.vdi" which located at "C:\Users\Admin\VirtualBox VMs\Windows7VM" folder, the command should be:

  • vboxmanage internalcommands sethduuid "C:\Users\Admin\VirtualBox VMs\Windows7VM\Windows7.vdi"

FIX: VirtualBox Failed to open Hard Disk file. Cannot register virtual hard disk because a disk with the same UUID already exists.(Solved)

 

5. If everything goes fine, then you should informed that the UUID has changed.

FIX: VirtualBox Failed to open Hard Disk file. Cannot register virtual hard disk because a disk with the same UUID already exists.(Solved)

 

6. Close command prompt and now try to attach the virtual hard disk to a new Virtual machine.

That’s all folks! Did it work for you?
Please leave a comment in the comment section below or even better: like and share this blog post in the social networks to help spread the word about this solution.