Cleaning up an “Inaccessible” VirtualBox Machine

I had a really difficult time coming up with a title for this post, but essentially what I’m trying to convey is:

  1. You created a VirtualBox machine
  2. You deleted/removed/transferred the VM files on your HDD
  3. VirtualBox will no longer let you manage that machine – indicates “inaccessible” – can’t even remove it.

I found myself in this predicament earlier this evening. All I wanted to do was remove the VM from the list of machines in VirtualBox, but it wouldn’t let me because it couldn’t find any of the files in the given location. After a few hacks, I found a solution. Hopefully, this might help someone.

Given a VirtualBox machine – let’s call him “Test Machine”, that resides on your host machine’s file system
TheSetup
TheSetup2
You, accidentally or purposefully, delete the folder containing the VM
FolderRemoved
Suddenly, you can no longer access the VM from within the VirtualBox Manager
MachineNowInvalid
And, any attempts to remove it are futile
CannotRemove
If you can deal with the ‘clutter’ of an orphaned VM, yay. If not, like me, we gotta get rid of that thing.
Here’s how I did it.

  1. Shut down all VMs, and close VirtualBox Manager
  2. Navigate to your personal VirtualBox settings file (Mine is in my Users folder – C:\Users\Calvin\.VirtualBox\VirtualBox.xml)
  3. Edit the file in Notepad/Notepad2/Notepad++/WhateverEtcPad++2
  4. Find the MachineRegistry section, and remove the MachineEntry for the offending machine
    VirtualBox-Configuration
  5. Save the file, close, and reopen VirtualBox Manager. If all successful, you should no longer see the machine.
    InvalidMachineGone

That’s it! Hope it helps someone!

You may also like...