How to delete inaccessible VirtualBox VMs from the command line

How to delete inaccessible VirtualBox VMs from the command line

If VirtualBox has develop into unresponsive, possibilities are superior you have an inaccessible VM. Locate out how to consider treatment of this dilemma with two basic commands.

Graphic: Jack Wallen

VirtualBox is an exceptional device for little firms to hire virtual equipment (VMs) from the facts centre. With the two a GUI and headless possibility, just about any IT admin, of any skill degree, can make use of this technology. 

Whilst VirtualBox is a really trusted resource for the position, each so usually matters happen. For occasion, choose a the latest incident I expert whereby a solitary corrupt/inaccessible digital device prevented me from accessing all of my VMs. Reported virtual machines had been not able to operate headless or through the GUI.

So I dug in and, with the help of a number of commands, solved the dilemma.

Enable me demonstrate you how to consider care of this difficulty.

SEE: 10 matters organizations are trying to keep in their very own information centers (TechRepublic download)

What you can want

In buy to make this function, you may have to have VirtualBox installed and a couple of VMs. The VMs in dilemma you should not have to be inaccessible in purchase to comply with these ways. In actuality, it’s excellent to exercise this course of action, so you can take treatment of the concern when it occurs.

What is an inaccessible VM?

To put it in most straightforward phrases, an inaccessible VM can happen when a host OS has crashed, leaving the VM in an unsaved point out. Since my host OS is Linux, that is a scarce occasion. But, it does take place. When you uncover you in that situation, a single inaccessible VM will result in the full of VirtualBox to not reply.

How to find inaccessible VMs

The initial stage is to track down the offending VM. In get to do that, we’ll make use of the VBoxManage command. To do this, very first shut the VirtualBox GUI (if it is really open). After the GUI closes, open a terminal window and difficulty the command:

VBoxManage list vms

You should really see a listing of all of your virtual devices (Figure A).

Figure A


A partial listing of my digital devices.

In that listing, you may well see a virtual device tagged as “.” If you discover 1 with said tag, that is the offending VM. Along with that tag, you’ll also see an ID (a long string of random characters, this kind of as a7a80921-7a9c-45dc-b312-121660f10a73). It can be that ID you will use to repair the challenge.

You may possibly assume you could basically delete the inaccessible VM. That’s not the case. Instead, you unregister the VM. To unregister an inaccessible VM, you would challenge the command:

VBoxManage unregistervm ID

Wherever ID is the string of characters denoting the VM in query. 

For instance, if my “CHEF Consumer” VM had been tagged as inaccessible, I might difficulty the command:

VBoxManage unregister 6f05799a-118e-458c-b98a-e9d2b96733f2

After the VM has been unregistered, VirtualBox must then get the job done as expected. Open up the GUI and begin a guest. All ought to be wonderful. If not, possibilities are you have more than a single inaccessible VM and you will have to go again, list the VMs and unregister the offending equipment.

And that is all there is to getting rid of inaccessible VirtualBox VMs. If you ever uncover the VirtualBox GUI, or your headless VMs unresponsive, probabilities are fairly great you have inaccessible equipment that ought to be unregistered.

Now you know how to choose treatment of that.

Also see

Supply hyperlink