Vagrant Commands

Complete Vagrant commands reference — 29 commands across 1 categories. Quick reference cheat sheet for Cross-platform.

Vagrant has a small command set and one file, the Vagrantfile, that defines the machine; the commands below are the whole lifecycle. The descriptions are HashiCorp's own, and the notes pick out the order you actually run them in and the two commands people forget exist.

CLI Commands (29)

ShortcutAction
vagrant boxManage "vagrant box add", "vagrant box remove", and other box-related commands such as
vagrant cloudTaking actions against Vagrant Cloud like searching or uploading a Vagrant Box
vagrant connectCompliments the "vagrant share" command to allow a user to remotely connect to your Vagrant
vagrant destroyStop the running virtual machine and terminate use of all resources that were in use
vagrant global-statusDetermine the state of all active Vagrant environments on the system for the currently logged
vagrant haltShut down the virtual machine that Vagrant is currently managing
vagrant initInitialize the current directory to be a Vagrant environment by creating an initial Vagrantfile
vagrant loginAuthenticate Vagrant with HashiCorp's Vagrant Cloud service to use features like private boxes
vagrant machine-readableAlmost all commands in Vagrant accept a --machine-readable flag to enable machine-readable
vagrant non-primaryIn addition to the commands listed in the sidebar and shown in "vagrant -h", Vagrant comes
vagrant packagePackage a currently-running VirtualBox or Hyper-V vagrant environment into a reusable Vagrant
vagrant pluginManage Vagrant plugins including installing, uninstalling, and license management
vagrant portDisplay the full list of guest ports mapped to the host machine ports
vagrant powershellOpen a PowerShell prompt running inside the guest machine
vagrant provisionRun any provisioners configured for the guest machine, such as Puppet, Chef, Ansible, Salt
vagrant rdpStart an RDP client for a remote desktop session with the guest machine
vagrant reloadIs the equivalent of running "vagrant halt" followed by "vagrant up"
vagrant resumeBring a machine back into the "up" state, perhaps if it was previously suspended via "vagrant
vagrant shareInitializes a new Vagrant share session, which allows you to share your virtual machine
vagrant snapshotManage snapshots of the guest machine
vagrant sshEstablish an SSH session into a running virtual machine to give you shell access
vagrant ssh-configOutput a valid SSH configuration file capable of SSHing into the guest machine directly
vagrant statusTell you the status of the virtual machines in the current Vagrant environment
vagrant suspendSuspend the guest machine Vagrant is currently managing
vagrant upCreate, configuration, and provision a guest machine according to your Vagrantfile
vagrant uploadUpload files from the host to a guest machine
vagrant validateValidate your Vagrantfile
vagrant versionOutput the version of Vagrant currently installed on the system
vagrant winrmExecute commands on the remote machine via WinRM
📄 View Printable Cheat Sheet — Download as PDF or print · 🧩 Combine with other tools

Related Shortcut Pages

Docker Kubernetes (kubectl) Proxmox VE VMware ESXi Terraform Ansible

Search 18,500+ shortcuts across 268 platforms

Explore All Platforms Practice Shortcuts

The lifecycle

vagrant init writes a starter Vagrantfile in the current directory; edit it to pick a box and a provider, then vagrant up downloads the box if needed, creates the VM and runs provisioners. vagrant ssh logs in. vagrant halt shuts the VM down cleanly and vagrant suspend saves its state to disk so vagrant resume brings it back in seconds. vagrant destroy deletes the VM and its disk; the box file stays, so the next up is fast.

Changing the machine

Edits to the Vagrantfile take effect with vagrant reload, which is halt followed by up and re-reads the configuration. Provisioners run only on first up by default; vagrant provision re-runs them on a running machine, and vagrant reload --provision does both. vagrant port lists which guest ports are forwarded to which host ports, which answers most "why can't I reach the app" questions.

The two people forget

vagrant global-status lists every Vagrant environment on the machine, including ones in directories you have forgotten, with their IDs — and any command accepts that ID, so vagrant destroy <id> cleans up a VM from anywhere. vagrant box manages downloaded box images (list, update, prune), which is where the disk space goes. vagrant package turns a configured VM into a reusable box for the rest of a team.

Frequently asked questions

What is the difference between halt, suspend and destroy?

halt shuts the VM down; suspend saves its memory state for a fast resume; destroy deletes the VM entirely, keeping only the box image.

My Vagrantfile change is not applied — why?

Run vagrant reload. A running machine does not re-read the Vagrantfile until it is restarted.

How do I find VMs I created in other folders?

vagrant global-status lists them all with IDs you can pass to any command.

How do I re-run provisioning?

vagrant provision on a running machine, or vagrant up --provision / vagrant reload --provision.

🤖 Ask AI about Vagrant shortcuts

Open your assistant with this page preloaded as the source — great for follow-up questions like "which of these work in other apps?"

ChatGPT Claude Perplexity Gemini Grok
📜 Every shortcut on this page is taken from the official Vagrant documentation — developer.hashicorp.com
🔧 Spotted an error or a missing shortcut? Suggest an edit on GitHub — every accepted fix goes live on this page, the API and the CLI.