Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Vagrant: destroy not working

Tags:

How should I use the command vagrant destroy?

In my VagrantFile I used vm.config.name = 'websvr' and when I open Virtualbox I can see websvr on the list of Vm's.

But whenever I use vagrant destroy websvr it returns:

The machine with the name 'websvr' was not found configured for this Vagrant environment.

How does vagrant destroy work?

like image 309
n0minal Avatar asked Apr 26 '14 05:04

n0minal


People also ask

How do I force destroy vagrant?

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.

How do I delete a vagrant file?

You can remove the Vagrantfile by typing rm Vagrantfile at the command line, but it is not clear what you are trying to achieve. The vagrant init command will initialise a new virtual box by creating a default Vagrantfile. Since you already have one, it looks like you may already have run the vagrant init command.

How do I remove all vagrant boxes?

This command does the following: vagrant box list : Prints out a list of all installed vagrant boxes (with two columns—box name or path, and meta info) cut -f 1 -d ' ' : Cuts the list and takes out just the first column (using spaces to delimit the columns)

How do I know if vagrant is working?

Command: vagrant status [name|id] This will tell you the state of the machines Vagrant is managing. It is quite easy, especially once you get comfortable with Vagrant, to forget whether your Vagrant machine is running, suspended, not created, etc. This command tells you the state of the underlying guest machine.


1 Answers

It seems the item does not exist, but it appears in the list because it is present in the cache. Use vagrant global-status --prune to get rid of it.

See vagrant global-status documentation for more details.

like image 102
Michel Bilodeau Avatar answered Sep 27 '22 19:09

Michel Bilodeau