Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I remove a Vagrant box from global-status, after deleting that box from the filesystem?

I deleted a folder containing a running Vagrant box before realising it was still running.

How can I delete it from Vagrant (global-status) now?

I already removed the Virtualbox VM.

like image 332
mettjus Avatar asked Jul 07 '14 13:07

mettjus


People also ask

How do I get rid of global status on vagrant?

First you use vagrant global-status to list all the vagrant machines and their status and ids . after that if you run vagrant global-status again you will find that the id you have specified in the vagrant destroy -f command has been removed from the list.

What is the command to destroy a vagrant box?

Command: vagrant destroy [name|id] This command stops the running machine Vagrant is managing and destroys all resources that were created during the machine creation process. After running this command, your computer should be left at a clean state, as if you never created the guest machine in the first place.


2 Answers

To discard old boxes listed in vagrant global-status (eg. you deleted the folder containing the .vagrant dir from the filesystem) you just need to run:

vagrant global-status --prune 

You might need to remove the Virtual Machine directly from your provider (VMWare, Virtualbox, ..) control interface.

like image 79
Jon Dowdle Avatar answered Oct 13 '22 04:10

Jon Dowdle


I believe that the new filename of the global data is ~/.vagrant.d.

So you can run rm -r ~/.vagrant.d to delete all user data for a fresh start.

like image 20
Alex Phelps Avatar answered Oct 13 '22 05:10

Alex Phelps