vagrant icon indicating copy to clipboard operation
vagrant copied to clipboard

Cannot destroy a zombie box

Open vitaut opened this issue 12 years ago • 5 comments

I can't destroy the box after deleting the content of a (test) project including Vagrantfile. vagrant global-status reports the box as running:

$ vagrant global-status
id       name    provider   state   directory                           
------------------------------------------------------------------------
3898812  default virtualbox running /home/viz/test  

but vagrant destroy has no effect:

$ vagrant destroy 3898812
==> default: VM not created. Moving on...

I've tried using VBoxManage to poweroff and unregister the VM as suggested in http://stackoverflow.com/a/15410190/471164, but vagrant still reports it as running.

I'm using Vagrant 1.6.3.dev.

vitaut avatar Jun 04 '14 18:06 vitaut

This is working as intended. As the docs say (or they should, if not, I need to add), global-status shows a cached view of the world, and global control allows remote control of Vagrant environments. If the Vagrantfile doesn't exist anymore, the Vagrant environment is a zombie as its always been and you must clean it up manually.

mitchellh avatar Jun 04 '14 20:06 mitchellh

Thanks for clarification, the docs indeed say that and I should have read more carefully. Running vagrant global-status --prune removed the zombie box. Sorry for the noise.

vitaut avatar Jun 04 '14 21:06 vitaut

Thanks, that was helpful. I realized I had a box on the global-status list that no longer existed, but couldn't figure out how to remove it.

tschet avatar May 15 '15 15:05 tschet

Mh.. Why exactly is global-status showing a cached view?

eMPee584 avatar Jun 27 '18 14:06 eMPee584

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

ghost avatar Apr 01 '20 02:04 ghost