Show Menu

Vagrant Cheat Sheet (DRAFT) by

Vagrant Setup | Useful Commands

This is a draft cheat sheet. It is a work in progress and is not finished yet.

Connecting to Vagrant Box

vagrant ssh
| connects to box in your path
vagrant ssh config
| displays ssh config
run from path, prior to login
vagrant rdp
| I have not tested this yet
**if more than one machine in configured within the Vagran­tfile, use machine name for SSH i.e. vagrant ssh web

Vagrant Box Mainte­nance

see adjacent screen shots
vagrant box list
|lists all available vagrant boxes on this endpoint
vagrant box add <na­me> or <ur­l>
| downloads box image to your end point
vagrgant box remove <na­me>
| deletes box from end point
vagrant box prune
| status of all boxes; dropping invalid entries
vagrant status
| displays status for box in current directory
vagrant box outdated
| checks if box is up to date
above must run from a box path
vagrant global­-status
| displays status for all local boxes
vagrant package
| packages a running enviro­nment in a reusable box

Vagrant Box Management

vagrant --version
vagrant suspend
vagrant resume
| resumes the vagrant box
vagrant halt
| stops the vagrant box
vagrant reload
| restarts box w/ new config­uration
vagrant destroy
| destroys current endpoint not the base box
vagrant validate
run from box path
vagrant vbguest
run from box path
| installs VirtualBox Guest Editions

Vagrant Plugins

vagrant plugin
| manages all plugins
[expunge, install, license, list, repair, uninstall, update]
vagrant plugin install [plugin name]
vbguest, vbinfo, hostma­nager, vagran­t-w­innfsd, vagran­t-n­etinfo, vagran­t-env, vagran­t-git
Additional vagrant plugins to consid­er/­res­earch
vagran­t-node, vagran­t-web, vagran­t-p­ers­ist­ent­-st­orage, vagran­t-h­ost­sup­dater, vagran­t-dns

Customize the Vagran­tfile


Notes / Alerts

By default ./ on your computer is shared as /vagrant on the vm
vagrant cannot run simult­ane­ously with
ctrl d | exits the vagrant box
If a PC goes to sleep, vagrant boxes will be forcibly shutdown but no data should be lost

Vagrant Box List

Vagrant Box Status

Vagrant Global­-Status

Vagrant Box Outdated [run from box path]

Vagrant Box Add [i.e.] hashic­orp­/pr­ecise64

Vagrant Quick Set-Up

Vagrant installs at c:\has­­hi­c­o­rp­­\va­­grant
c:\>cd hashic­orp­\va­grant
Make a directory for each separate vm
c:\>mkdir precise64
c:\>cd hashic­orp­\va­gra­nt­\pre­cise64
vagrant init hashic­orp­/pr­­ec­ise64
 initia­lizes a new vagran­tfile
vagrant up [
starts the box

Vagrant Box Sites [working as of 01/2023]