How do I delete a virtualbox machine in the GURU_MEDITATION error state?
Asked Answered
E

12

73

How do I delete a VirtualBox machine in the GURU_MEDITATION error state? Is it enough just to delete the directory while VirtualBox is not running?

EDIT: After posting, I deleted the entire directory that "Show in File Manager" navigates to.

It looks like:

Screenshot of Virtualbox Guru Meditation

Note that there is no power off, and even remove is greyed out. I believe this is the exact same as it looked even before I deleted the directory.

EDIT 2: I tried the command line poweroff after deleting the files. It hangs:

vboxmanage controlvm wmf-vagrant_1354733432 poweroff 0%...10%...20%...

EDIT 3: It also fails to unregister it from the command-line:

VBoxManage unregistervm wmf-vagrant_1354733432 --delete VBoxManage: error: Cannot unregister the machine 'wmf-vagrant_1354733432' while it is locked VBoxManage: error: Details: code VBOX_E_INVALID_OBJECT_STATE (0x80bb0007), component Machine, interface IMachine, callee nsISupports Context: "Unregister(fDelete ? (CleanupMode_T)CleanupMode_DetachAllReturnHardDisksOnly : (CleanupMode_T)CleanupMode_DetachAllReturnNone, ComSafeArrayAsOutParam(aMedia))" at line 160 of file VBoxManageMisc.cpp

Extinguisher answered 7/12, 2012 at 19:32 Comment(5)
If you want to move it, specify SuperUser please.Extinguisher
However, I think this is programming-related, since I'm using it with vagrant, a tool specifically for developers.Extinguisher
Ok, it seems that I was badly mistaken. Do you have access to command line? Can you try VBoxManage controlvm <vm> poweroff? VBoxManage list vms gives you list of existing virtual machines.Gallimaufry
Please reopen. if you want to migrate, migrate to Superuser.Extinguisher
By killing the VBoxHeadless process (on OSX) I was able to run vagrant destroy successfully and get out of this lock. I used ps aux | grep -i virtualbox to find it.Amphiprostyle
T
146

Kill the VBoxHeadless process and run "vagrant destroy"

Destroying vagrant and sending the kill signal with the "killall" command looks like:

killall -9 VBoxHeadless && vagrant destroy

Taratarabar answered 2/3, 2013 at 14:36 Comment(7)
+1 Using the API or VBoxManage will often fail with lock exceptions etc. This is (unfortunately) the only 100% reliable way that I've found of terminating VBox VMs.Snack
If you're running multiple machines, you only need to kill the one process associated with the machine you wish to destroy.Gisele
how to kill it? Which port is it running?Beholden
To kill it on OS X: ps aux | grep -i virtualbox then kill -9 <PID> and after that run vagrant destroyBeholden
on osx killall -9 VBoxHeadless then vagrant destroy worked nicely for meEighty
As @Eighty pointed out. killall worked fine for me as well!Prothalamion
you are the bestInquire
H
17

If you can't power off the machine from VirtualBox GUI, then try from the command line using vboxmanage command (VBoxManage on OS X), e.g.:

vboxmanage controlvm NAMEOFVM poweroff

Change NAMEOFVM with the name from vboxmanage list vms command.

then unregister and delete the VM:

vboxmanage unregistervm NAMEOFVM --delete

Or delete it manually:

rm -fr ~/"VirtualBox VMs/NAMEOFVM"
Hickok answered 17/3, 2016 at 15:24 Comment(1)
(+1) on linux you have also vboxmanage (lowercase) so, I use: vboxmanage unregistervm --delete <vm-name> (a little bit of cosmetics)Ineligible
T
10

I hit this problem. Eveything I read recommend that you should always manage the boxes via Virtual Box, not directly access files. But when I had an invalid box, the unregistervm command refused to delete it and vagrant destroy did not work. In the end the following process worked.

  1. Kill all running VBox* processes
  2. Delete the folder "boxname" from the folder "VirtualBox VMs"
  3. Edit the file "VirtualBox.xml" and remove the tag corresponding to the invalid box.

I then ran this command the verify the box was gone.

VBoxManage list vms

After that I was able to create a new vm with the same name.

Theodore answered 26/9, 2014 at 0:48 Comment(0)
K
5

I had a VM that got in a similar state

$ vagrant up

Bringing machine 'tempu' up with 'virtualbox' provider...
==> mms: Checking if box 'hashicorp/precise64' is up to date...
==> mms: Resuming suspended VM...
==> mms: Booting VM...
There was an error while executing `VBoxManage`, a CLI used by Vagrant
for controlling VirtualBox. The command and stderr is shown below.

Command: ["startvm", "9fcf2203-d4b3-47a1-a307-61bfa580bd28", "--type", "headless"]

Stderr: VBoxManage: error: The machine 'temp-ubuntu' is already locked by a session (or being locked or unlocked)
VBoxManage: error: Details: code VBOX_E_INVALID_OBJECT_STATE (0x80bb0007), component Machine, interface IMachine, callee nsISupports
VBoxManage: error: Context: "LaunchVMProcess(a->session, sessionType.raw(), env.raw(), progress.asOutParam())" at line 592 of file VBoxManageMisc.cpp

I looked for a process called VBoxHeadless, but it wasn't running.

I then ran ps and found this process with the same vm id:

$ ps aux | grep -i virtualbox
user      63466   0.0  0.1  2523608   8396   ??  S     9:36am   0:02.67 /Applications/VirtualBox.app/Contents/MacOS/VBoxManage showvminfo 9fcf2203-d4b3-47a1-a307-61bfa580bd28 --machinereadable

Killing that process fixed the problem and VM started correctly after running vagrant up

Kaolin answered 16/3, 2015 at 16:38 Comment(0)
L
3

This is a script I use when I get desperate. It wipes as much trace of any VM from the machine as I can find:

VBoxManage list runningvms | awk '{print $2}'  | xargs --no-run-if-empty -t -n1 -IXXX VBoxManage controlvm XXX poweroff                                                           
VBoxManage list vms | awk '{print $2}'  | xargs --no-run-if-empty -t -n1 VBoxManage unregistervm                                                                                  
killall -9 VBoxHeadless                                                                                                                                                           
rm -rf ~/Virtualbox\ VMs/* 
Loden answered 1/11, 2016 at 8:38 Comment(0)
E
1

I am using Debian Wheezy on a 64-bit multiple-processor host. I was able to solve it eventually by removing all VirtualBox data (though you did not need to delete the Vagrant base box):

  1. Close Virtualbox if running
  2. sudo apt-get remove --purge virtualbox
  3. Move or delete ~/.VirtualBox and ~/VirtualBox\ VMs/. If you're not sure, back them up to a safe place.
  4. Restart.
  5. Reinstall virtualbox.
  6. Use virtualbox/vagrant as normal.

There may be a less disruptive way (e.g. removing only parts of these directories). In my case, fortunately I was using only one VM at the time.

Extinguisher answered 8/12, 2012 at 23:4 Comment(0)
T
1

In my case, I wanted to delete ALL Vagrant boxes I currently have on my system by a command line, I did that by:

$ vagrant box list | cut -f 1 -d ' ' | xargs -L 1 vagrant box remove -f --all

Of course, after making sure no further process is attached any more:

killall -9 VBoxHeadless && vagrant destroy
No matching processes belonging to you were found
Tarbes answered 23/10, 2018 at 11:52 Comment(0)
W
0

On windows 10, i solved this problem setting Default firewall configurations back.

Hope it helps...

Welterweight answered 16/2, 2016 at 23:45 Comment(0)
H
0

I've been struggling with frozen Virtual Box instances created earlier using Vagrant. Luckily found a solution mentioned in similar ticket

so, to recap, if your getting Timeout error or Vagrant complaining it can't provision or any other kind of related issue with Virtual Box try:

  1. List virtual box instances first: VmboxManage list vms
  2. Stop the virtual box instances using id|names of previous command: VBoxManage startvm VMNAME/id --type emergencystop
  3. List vagrant boxes with vagrant box list
  4. Remove one or more causing issues vagrant boxes: vagrant remove box ${box-name}
  5. Afterwards, try vagrant up again and hopefully you will be back to business.

Good luck!

Hazelton answered 13/10, 2020 at 9:34 Comment(0)
P
0

Open the task manager or system monitor and hover with the mouse over the VBoxHeadless to see the name of the VM and kill the process. Now you can remove the VM with the VirtualBox Manager GUI.

enter image description here

Practice answered 22/10, 2020 at 13:2 Comment(0)
P
0
  1. Run vagrant global-status
  2. Identify the vm id
  3. Run vagrant destroy [vm id]
Psychophysics answered 13/12, 2022 at 16:39 Comment(0)
O
-1

You can use below command to delete VM from vritual box-

vagrant destroy

And use below command to create VM and start again-

vagrant up
Occupy answered 20/1, 2016 at 18:33 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.