In this tutorial, I guide using useful Vagrant commands line for Virtual Machine such as: Starting and Stopping a VM so forth. Vagrant the essential for DevOps Roles.
Useful vagrant commands line
Vagrant commands for Virtual Machine
Initialize Vagrant with a Vagrantfile
# vagrant init
Initialize vagrant with a specific box. To find a box, https://app.vagrantup.com/boxes/search
Vagrant commands for starting a Virtual Machine
To run the first vagrant up a Virtual Machine, to starts vagrant environment
# vagrant up
To resume a Virtual Machine
# vagrant resume
Restarting a Virtual Machine
# vagrant reload
Vagrant commands for stopping a Virtual Machine
To stops a Virtual Machine
# vagrant halt
To suspends a Virtual Machine
# vagrant suspend
Vagrant commands cleaning up a Virtual Machine
To stops and deletes all traces of the Virtual Machine
# vagrant destroy
Vagrant commands for Boxes
To list all installed boxes on your computer
# vagrant box list
To download a box image to your computer
# vagrant box add
Checking for updates vagrant box update
# vagrant box outdated
To delete a box from the machine
# vagrant boxes remove
The packages a running Virtualbox environment in a reusable box
# vagrant package
To snapshot a Virtual Machine
The VM-name often defaults. To rollback at a later time.
# vagrant snapshot save [options] [vm-name]
The useful vagrant commands
To get the vagrant version
# vagrant -v
The output status of the vagrant machine
# vagrant status
The output status of all vagrant machines
# vagrant global-status
The same as above, but prunes invalid entries
# vagrant global-status --prune
To use the debug flag to increase the verbosity of the output
# vagrant provision --debug
Vagrant can be configured to deploy code!
# vagrant push
To Runs vagrant up, forces provisioning and logs all output to a file
# vagrant up --provision | tee provision_2017.log
Conclusion
Thought the article, you can use Useful vagrant commands line as above. I hope will this your helpful. Thank you for reading the DevopsRoles page!