Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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

like image 454
Matthew Flaschen Avatar asked Dec 07 '12 19:12

Matthew Flaschen


3 Answers

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

like image 53
jonathan Avatar answered Nov 16 '22 02:11

jonathan


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"
like image 37
kenorb Avatar answered Nov 16 '22 03:11

kenorb


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.

like image 10
Will Glass Avatar answered Nov 16 '22 03:11

Will Glass