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

Last updated on December 2nd, 2018

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:

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


"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)
IVirtualBox {fafa4e17-1ee2-4905-a10e-fe7c18bf5554}
Callee RC:

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 cannot open Virtual Hard Disk file VDI - file wth same uuid already exists.


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.

virtual cannot open virtual hard disk file - fix


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

remove missing virtual hard disk .vdi


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

fix cannot register virtual hard disk virtualbox


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



7. Click Choose existing disk.



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



9. Click OK to close Virtual Machine settings.



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 Cannot register the hard disk virtualbox



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

fix Cannot open disk image vdi vhd etc.


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.

cannot open vdi image virtualbox


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.

run command prompt as administrator


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

  • cd C:\Program Files\Oracle\VirtualBox

change uuid virtual disk


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"

reset uuid virtual disk


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

reset uuid virtual disk virtualbox


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.

If this article was useful for you, please consider supporting us by making a donation. Even $1 can a make a huge difference for us in our effort to continue to help others while keeping this site free: