Useful Vagrant Commands

27th November 2013

Warning: This post is over a year old. I don't always update old posts with new information, so some of this information may be out of date.

Vagrant is a tool for managing virtual machines within VirtualBox from the command line. Here are some useful commands to know when using Vagrant.

Command Description
vagrant init {box} Initialise a new VM in the current working directory. Specify a box name, or "base" will be used by default.
vagrant status Shows the status of the Vagrant box(es) within the current working directory tree.
vagrant up (--provision) Boots the Vagrant box. Including "–provision" also runs the "vagrant provision" command.
vagrant reload (--provision) Reloads the Vagrant box. Including "--provision" also runs the "vagrant provision" command.
vagrant provision Provision the Vagrant box using Puppet.
vagrant suspend Suspend the Vagrant box. Use "vagrant up" to start the box again.
vagrant halt (-f) Halt the Vagrant box. Use -f to forcefully shut down the box without prompting for confirmation.
vagrant destroy (-f) Destroys a Vagrant box. Use -f to forcefully shut down the box without prompting for confirmation.

The full Vagrant documentation can be found at http://docs.vagrantup.com/v2/.

Questions? Comments? I’m @opdavies on Twitter.

Tags

About the Author

Picture of Oliver

Oliver Davies is a full-stack Web Developer and System Administrator based in the UK. He is a Senior Developer at Microserve and a part-time freelancer specialising in Drupal, Symfony and Laravel development and Linux systems administration.