How to resolve VirtualBox error: Failed to open virtual hard disk file (.VDI) because hard disk already exits.
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.
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 .
3. Then, click Remove (and then press the Remove button) to remove the missing virtual hard disk.
4. Close Virtual Media manager.5. Highlight the VM where you want to add the Virtual Hard Drive file (.VDI) and click Settings.
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.
2. Select the Virtual Hard disk, that you want to clone and click Copy.
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.
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:
3. Copy & Paste in command prompt the following command in command prompt window and press Enter:
cd C:\Program Files\Oracle\VirtualBox
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»
5. If everything goes fine, then you should informed that the UUID has changed.
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:
We’re looking for part-time or full-time technical writers to join our team! It’s about a remote position that qualified tech writers from anywhere in the world can apply. Click here for more details.
If you want to stay constantly protected from malware threats, existing and future ones, we recommend that you install Malwarebytes Anti-Malware PRO by clicking below (we
do earn a commision from sales generated from this link, but at no additional cost to you. We have experience with this software and we recommend it because it is helpful and useful):