Useful vagrant commands line

In this tutorial, I guide using Vagrant commands for Virtual Machine such as: Starting and Stopping a VM so forth. Vagrant the essential for DevOps Roles.

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.

, ,

About HuuPV

My name is Huu. I love technology and especially Devops Skill such as Docker, vagrant, git so forth. I likes open-sources. so I created DevopsRoles.com site to share the knowledge that I have learned. My Job: IT system administrator. Hobbies: summoners war game, gossip.
View all posts by HuuPV →

Leave a Reply

Your email address will not be published. Required fields are marked *

Comment moderation is enabled. Your comment may take some time to appear.

This site uses Akismet to reduce spam. Learn how your comment data is processed.