Vagrant CLI — Complete Reference
Vagrant is controlled entirely through its command-line interface. All commands follow the pattern vagrant [command] [options] and are run from the directory containing your Vagrantfile.
VM Lifecycle Commands
BASH — VM Lifecycle
# Start VM (create if first time)
vagrant up
# Start with specific provider
vagrant up --provider=virtualbox
vagrant up --provider=parallels
# Start a specific machine (multi-machine setup)
vagrant up db-master
# Stop VM gracefully (saves state)
vagrant halt
# Stop specific machine
vagrant halt db-master
# Force stop (like pulling power)
vagrant halt --force
# Restart VM
vagrant reload
# Reload and re-run provisioning
vagrant reload --provision
# Destroy VM completely (deletes all VM files)
vagrant destroy
# Destroy without confirmation prompt
vagrant destroy --force
# Destroy specific machine
vagrant destroy db-replica --force
Status and Info Commands
BASH — Status Commands
# Show status of VMs in current directory
vagrant status
# Show status of ALL Vagrant VMs on your machine
vagrant global-status
# Show global status with pruned dead entries
vagrant global-status --prune
# Show SSH config for the VM
vagrant ssh-config
# Show SSH config for specific machine
vagrant ssh-config db-master
SSH Commands
BASH — SSH Commands
# SSH into the VM
vagrant ssh
# SSH into specific machine
vagrant ssh db-master
# Run a command inside VM without interactive shell
vagrant ssh -c "sudo systemctl status mysqld"
# SSH into VM using specific SSH key
vagrant ssh -- -i ~/.ssh/custom_key
Box Commands
BASH — Box Commands
# List all downloaded boxes
vagrant box list
# Add a box from Vagrant Cloud
vagrant box add generic/oracle8
# Add a box with specific provider
vagrant box add generic/oracle8 --provider virtualbox
vagrant box add generic/oracle8 --provider parallels
# Add a local box file
vagrant box add myoel8 /path/to/package.box
# Add with metadata (for parallels — correct way)
vagrant box add myoel8 /path/to/metadata.json
# Remove a box
vagrant box remove generic/oracle8
# Remove specific version
vagrant box remove generic/oracle8 --box-version 1.0.0
# Update a box to latest version
vagrant box update
# Update specific box
vagrant box update --box generic/oracle8
# Check for outdated boxes
vagrant box outdated
# Repackage an existing VM into a box
vagrant package --output mybox.box
# Prune old box versions
vagrant box prune
Snapshot Commands
BASH — Snapshot Commands
# Take a snapshot
vagrant snapshot save clean-install
# List all snapshots
vagrant snapshot list
# Restore a snapshot
vagrant snapshot restore clean-install
# Delete a snapshot
vagrant snapshot delete clean-install
# Push snapshot (unnamed — stack based)
vagrant snapshot push
# Pop snapshot (restore last unnamed)
vagrant snapshot pop
Plugin Commands
BASH — Plugin Commands
# List installed plugins
vagrant plugin list
# Install a plugin
vagrant plugin install vagrant-vbguest
vagrant plugin install vagrant-parallels
vagrant plugin install vagrant-disksize
# Update a plugin
vagrant plugin update vagrant-vbguest
# Update all plugins
vagrant plugin update
# Uninstall a plugin
vagrant plugin uninstall vagrant-vbguest
# Repair plugins
vagrant plugin repair
Provisioning Commands
BASH — Provisioning
# Run provisioners on running VM
vagrant provision
# Run provisioners on specific machine
vagrant provision db-master
# Run specific provisioner by name
vagrant provision --provision-with shell
# Start VM and force provisioning
vagrant up --provision
# Start VM without running provisioners
vagrant up --no-provision
Port and Network Commands
BASH — Network Commands
# Show forwarded ports
vagrant port
# Show ports for specific machine
vagrant port db-master
Quick Reference
| Command | What it does |
|---|---|
| vagrant up | Create and start VM |
| vagrant halt | Stop VM gracefully |
| vagrant reload | Restart VM |
| vagrant destroy | Delete VM completely |
| vagrant ssh | Connect to VM via SSH |
| vagrant status | Show VM status |
| vagrant provision | Run provisioners again |
| vagrant snapshot save NAME | Save VM snapshot |
| vagrant snapshot restore NAME | Restore VM snapshot |
| vagrant box list | List downloaded boxes |
| vagrant box add NAME | Download/add a box |
| vagrant plugin install NAME | Install plugin |
| vagrant global-status | All VMs on machine |