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?
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.
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.
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)
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.
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.
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