Removing a VHD from Virtual Box list.

Today (2025.Jan.21), I was messing around Virtual Box, organizing some VMs.

I moved and renamed some VHD files around, but Virtual Box didn't like it very much. In the Media Manager list, the affected files were listed as “inaccessible” and could not be removed.

Searching around the Net for a solution, I found this post, which detailed a solution.

I'm copying it here, just in case.

Of course, all credit goes to Ingmar, who wrote the original post.


Purge deleted hard disks from Virtual Box

When you remove a virtual hard disk drive from within Virtual Box, the file itself is not removed. Even worse, deleting the file manually and then trying to add a new virtual disk with the same file name in the same path will just yield an error. Virtual Box complains about the file name already being associated with a specific UUID.

All your virtual hard disk drives are stored in the global Virtual Box configuration. You can retrieve a full list using the following command:

vboxmanage list hdds

This will give you the file names and UUIDs to each virtual disk. In order to remove an entry from the list and make the file name available again, simply execute the following command:

vboxmanage closemedium disk <uuid> --delete

After that, both the file and the UUID entry in the configuration should be be purged from the list and you can create a new virtual hard disk drive with the same file name again.

VBoxManage.exe is usually located at %ProgramFiles%\Oracle\VirtualBox.

Comments