I'm not looking for this answer, because my question is different.
When I type vagrant global-status
I get a list of vms, but some of those directories and VMs have been deleted along with the Vagrantfiles.
But when i type vagrant destroy [machineid]
, I get the following error, which I am looking to resolve. Please advise.
The working directory for Vagrant doesn't exist! This is the specified working directory: /Users/steven/projects/php/vagrant-laravel
AFAIK, vagrant box remove just remove the boxes you downloaded or created using package command, to delete the VM, you should use `vagrant destroy` at the folder where Vagrantfile is. vagrant destroy will only delete the VM, so you still need to manually delete Vagrantfile and any other files in that folder.
Command: vagrant destroy [name|id] For linux-based guests, Vagrant uses the shutdown command to gracefully terminate the machine.
Command: vagrant box remove NAME If a box has multiple versions, you can select what versions to delete with the --box-version flag or remove all versions with the --all flag.
You should use the following command to remove invalid entries from the global index:
vagrant global-status --prune
I had this issue as well. I was able to fix it by modifying the contents of ~/.vagrant.d/data/machine-index/index
. It's in JSON format so I just removed the data related to instances that no longer existed.
I only removed the data that pertained to instances that no longer exist. I wouldn't modify any data that relates to an instance that exists in the file system.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With