Skip to content

Instantly share code, notes, and snippets.

@todun
Forked from wpscholar/vagrant-cheat-sheet.md
Created February 16, 2020 10:33
Show Gist options
  • Save todun/594de33534a37d70e29d682e4848d71d to your computer and use it in GitHub Desktop.
Save todun/594de33534a37d70e29d682e4848d71d to your computer and use it in GitHub Desktop.

Revisions

  1. @wpscholar wpscholar revised this gist Jun 12, 2019. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion vagrant-cheat-sheet.md
    Original file line number Diff line number Diff line change
    @@ -23,7 +23,7 @@ Be sure that you are in the same directory as the Vagrantfile when running these

    # Cleaning Up a VM
    - `vagrant destroy` -- stops and deletes all traces of the vagrant machine
    - `vagrant destroy -f -- same as above, without confirmation
    - `vagrant destroy -f` -- same as above, without confirmation

    # Boxes
    - `vagrant box list` -- see a list of all installed boxes on your computer
  2. @wpscholar wpscholar revised this gist Sep 21, 2017. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion vagrant-cheat-sheet.md
    Original file line number Diff line number Diff line change
    @@ -45,7 +45,7 @@ Be sure that you are in the same directory as the Vagrantfile when running these
    - `vagrant up --provision | tee provision.log` -- Runs `vagrant up`, forces provisioning and logs all output to a file

    # Plugins
    - [hostsupdater](https://github.com/cogitatio/vagrant-hostsupdater) : `$ vagrant plugin install vagrant-hostsupdater` to update your `/etc/hosts` file automatically each time you start/stop your vagrant box.
    - [vagrant-hostsupdater](https://github.com/cogitatio/vagrant-hostsupdater) : `$ vagrant plugin install vagrant-hostsupdater` to update your `/etc/hosts` file automatically each time you start/stop your vagrant box.

    # Notes
    - If you are using [VVV](https://github.com/varying-vagrant-vagrants/vvv/), you can enable xdebug by running `vagrant ssh` and then `xdebug_on` from the virtual machine's CLI.
  3. @wpscholar wpscholar revised this gist Sep 21, 2017. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion vagrant-cheat-sheet.md
    Original file line number Diff line number Diff line change
    @@ -45,7 +45,7 @@ Be sure that you are in the same directory as the Vagrantfile when running these
    - `vagrant up --provision | tee provision.log` -- Runs `vagrant up`, forces provisioning and logs all output to a file

    # Plugins
    - [vagrant plugin hostsupdater](https://github.com/cogitatio/vagrant-hostsupdater) : `$ vagrant plugin install vagrant-hostsupdater` to update your `/etc/hosts` file automatically each time you start/stop your vagrant box.
    - [hostsupdater](https://github.com/cogitatio/vagrant-hostsupdater) : `$ vagrant plugin install vagrant-hostsupdater` to update your `/etc/hosts` file automatically each time you start/stop your vagrant box.

    # Notes
    - If you are using [VVV](https://github.com/varying-vagrant-vagrants/vvv/), you can enable xdebug by running `vagrant ssh` and then `xdebug_on` from the virtual machine's CLI.
  4. @wpscholar wpscholar revised this gist Sep 21, 2017. 1 changed file with 37 additions and 13 deletions.
    50 changes: 37 additions & 13 deletions vagrant-cheat-sheet.md
    Original file line number Diff line number Diff line change
    @@ -2,26 +2,50 @@ Typing `vagrant` from the command line will display a list of all available comm

    Be sure that you are in the same directory as the Vagrantfile when running these commands!

    # Common Vagrant Commands
    - `vagrant up` -- starts vagrant environment (also provisions only on the FIRST vagrant up)
    - `vagrant status` -- outputs status of the vagrant machine
    # Creating a VM
    - `vagrant init` -- Initialize Vagrant with a Vagrantfile and ./.vagrant directory, using no specified base image. Before you can do vagrant up, you'll need to specify a base image in the Vagrantfile.
    - `vagrant init <boxpath>` -- Initialize Vagrant with a specific box. To find a box, go to the [public Vagrant box catalog](https://app.vagrantup.com/boxes/search). When you find one you like, just replace it's name with boxpath. For example, `vagrant init ubuntu/trusty64`.

    # Starting a VM
    - `vagrant up` -- starts vagrant environment (also provisions only on the FIRST vagrant up)
    - `vagrant resume` -- resume a suspended machine (vagrant up works just fine for this as well)
    - `vagrant provision` -- forces reprovisioning of the vagrant machine
    - `vagrant reload` -- restarts vagrant machine, loads new Vagrantfile configuration
    - `vagrant reload --provision` -- restart the virtual machine and force provisioning

    # Getting into a VM
    - `vagrant ssh` -- connects to machine via SSH
    - `vagrant ssh <boxname>` -- If you give your box a name in your Vagrantfile, you can ssh into it with boxname. Works from any directory.

    # Stopping a VM
    - `vagrant halt` -- stops the vagrant machine
    - `vagrant reload` -- restarts vagrant machine, loads new Vagrantfile configuration
    - `vagrant provision` -- forces reprovisioning of the vagrant machine
    - `vagrant ssh` -- connects to machine via SSH
    - `vagrant suspend` -- suspends a virtual machine (remembers state)

    # Cleaning Up a VM
    - `vagrant destroy` -- stops and deletes all traces of the vagrant machine
    - `vagrant package` -- packages a running virtualbox env in a reusable box
    - `vagrant destroy -f -- same as above, without confirmation

    # Boxes
    - `vagrant box list` -- see a list of all installed boxes on your computer
    - `vagrant box add <name> <url>` -- download a box image to your computer
    - `vagrant box outdated` -- check for updates vagrant box update
    - `vagrant boxes remove <name>` -- deletes a box from the machine
    - `vagrant package` -- packages a running virtualbox env in a reusable box

    # Saving Progress
    -`vagrant snapshot save [options] [vm-name] <name>` -- vm-name is often `default`. Allows us to save so that we can rollback at a later time

    # Tips
    - `vagrant -v` -- Get the vagrant version
    - `vagrant -v` -- get the vagrant version
    - `vagrant status` -- outputs status of the vagrant machine
    - `vagrant global-status` -- outputs status of all vagrant machines
    - `vagrant global-status --prune` -- same as above, but prunes invalid entries
    - `vagrant suspend` -- Suspends a virtual machine (remembers state)
    - `vagrant resume` -- Resume a suspended machine (vagrant up works just fine for this as well)
    - `vagrant reload --provision` -- Restart the virtual machine and force provisioning
    - `vagrant provision --debug` -- Use the debug flag to increase the verbosity of the output
    - `vagrant push` -- Yes, vagrant can be configured to [deploy code](http://docs.vagrantup.com/v2/push/index.html)!
    - `vagrant provision --debug` -- use the debug flag to increase the verbosity of the output
    - `vagrant push` -- yes, vagrant can be configured to [deploy code](http://docs.vagrantup.com/v2/push/index.html)!
    - `vagrant up --provision | tee provision.log` -- Runs `vagrant up`, forces provisioning and logs all output to a file

    # Plugins
    - [vagrant plugin hostsupdater](https://github.com/cogitatio/vagrant-hostsupdater) : `$ vagrant plugin install vagrant-hostsupdater` to update your `/etc/hosts` file automatically each time you start/stop your vagrant box.

    # Notes
    - If you are using [VVV](https://github.com/varying-vagrant-vagrants/vvv/), you can enable xdebug by running `vagrant ssh` and then `xdebug_on` from the virtual machine's CLI.
  5. @wpscholar wpscholar revised this gist Sep 21, 2017. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions vagrant-cheat-sheet.md
    Original file line number Diff line number Diff line change
    @@ -10,6 +10,7 @@ Be sure that you are in the same directory as the Vagrantfile when running these
    - `vagrant provision` -- forces reprovisioning of the vagrant machine
    - `vagrant ssh` -- connects to machine via SSH
    - `vagrant destroy` -- stops and deletes all traces of the vagrant machine
    - `vagrant package` -- packages a running virtualbox env in a reusable box

    # Tips
    - `vagrant -v` -- Get the vagrant version
  6. @wpscholar wpscholar revised this gist Jan 19, 2016. 1 changed file with 8 additions and 7 deletions.
    15 changes: 8 additions & 7 deletions vagrant-cheat-sheet.md
    Original file line number Diff line number Diff line change
    @@ -12,13 +12,14 @@ Be sure that you are in the same directory as the Vagrantfile when running these
    - `vagrant destroy` -- stops and deletes all traces of the vagrant machine

    # Tips
    - `vagrant -v` -- Get the vagrant version
    - `vagrant global-status` -- outputs status of all vagrant machines
    - `vagrant suspend` -- Suspends a virtual machine (remembers state)
    - `vagrant resume` -- Resume a suspended machine (vagrant up works just fine for this as well)
    - `vagrant reload --provision` -- Restart the virtual machine and force provisioning
    - `vagrant provision --debug` -- Use the debug flag to increase the verbosity of the output
    - `vagrant push` -- Yes, vagrant can be configured to [deploy code](http://docs.vagrantup.com/v2/push/index.html)!
    - `vagrant -v` -- Get the vagrant version
    - `vagrant global-status` -- outputs status of all vagrant machines
    - `vagrant global-status --prune` -- same as above, but prunes invalid entries
    - `vagrant suspend` -- Suspends a virtual machine (remembers state)
    - `vagrant resume` -- Resume a suspended machine (vagrant up works just fine for this as well)
    - `vagrant reload --provision` -- Restart the virtual machine and force provisioning
    - `vagrant provision --debug` -- Use the debug flag to increase the verbosity of the output
    - `vagrant push` -- Yes, vagrant can be configured to [deploy code](http://docs.vagrantup.com/v2/push/index.html)!
    - `vagrant up --provision | tee provision.log` -- Runs `vagrant up`, forces provisioning and logs all output to a file

    # Notes
  7. @wpscholar wpscholar revised this gist Jul 28, 2015. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions vagrant-cheat-sheet.md
    Original file line number Diff line number Diff line change
    @@ -17,6 +17,7 @@ Be sure that you are in the same directory as the Vagrantfile when running these
    - `vagrant suspend` -- Suspends a virtual machine (remembers state)
    - `vagrant resume` -- Resume a suspended machine (vagrant up works just fine for this as well)
    - `vagrant reload --provision` -- Restart the virtual machine and force provisioning
    - `vagrant provision --debug` -- Use the debug flag to increase the verbosity of the output
    - `vagrant push` -- Yes, vagrant can be configured to [deploy code](http://docs.vagrantup.com/v2/push/index.html)!
    - `vagrant up --provision | tee provision.log` -- Runs `vagrant up`, forces provisioning and logs all output to a file

  8. @wpscholar wpscholar revised this gist May 28, 2015. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions vagrant-cheat-sheet.md
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,7 @@
    Typing `vagrant` from the command line will display a list of all available commands.

    Be sure that you are in the same directory as the Vagrantfile when running these commands!

    # Common Vagrant Commands
    - `vagrant up` -- starts vagrant environment (also provisions only on the FIRST vagrant up)
    - `vagrant status` -- outputs status of the vagrant machine
  9. @wpscholar wpscholar revised this gist May 28, 2015. 1 changed file with 12 additions and 9 deletions.
    21 changes: 12 additions & 9 deletions vagrant-cheat-sheet.md
    Original file line number Diff line number Diff line change
    @@ -1,19 +1,22 @@
    Typing `vagrant` from the command line will display a list of all available commands.

    # Common Vagrant Commands
    - `vagrant up` -- starts vagrant environment (also provisions only on the FIRST vagrant up)
    - `vagrant status` -- outputs status of the vagrant machine
    - `vagrant global-status` -- outputs status of all vagrant machines
    - `vagrant halt` -- stops the vagrant machine
    - `vagrant reload` -- restarts vagrant machine, loads new Vagrantfile configuration
    - `vagrant provision` -- forces reprovisioning of the vagrant machine
    - `vagrant ssh` -- connects to machine via SSH
    - `vagrant destroy` -- stops and deletes all traces of the vagrant machine
    - `vagrant up` -- starts vagrant environment (also provisions only on the FIRST vagrant up)
    - `vagrant status` -- outputs status of the vagrant machine
    - `vagrant halt` -- stops the vagrant machine
    - `vagrant reload` -- restarts vagrant machine, loads new Vagrantfile configuration
    - `vagrant provision` -- forces reprovisioning of the vagrant machine
    - `vagrant ssh` -- connects to machine via SSH
    - `vagrant destroy` -- stops and deletes all traces of the vagrant machine

    # Tips
    - `vagrant -v` -- Get the vagrant version
    - `vagrant global-status` -- outputs status of all vagrant machines
    - `vagrant suspend` -- Suspends a virtual machine (remembers state)
    - `vagrant resume` -- Resume a suspended machine (vagrant up works just fine for this as well)
    - `vagrant reload --provision` -- Restart the virtual machine and force provisioning
    - `vagrant push` -- Yes, vagrant can be configured to [deploy code](http://docs.vagrantup.com/v2/push/index.html)!
    - `vagrant up --provision | tee provision.log` -- Runs `vagrant up`, forces provisioning and logs all output to a file
    - `vagrant up --provision | tee provision.log` -- Runs `vagrant up`, forces provisioning and logs all output to a file

    # Notes
    - If you are using [VVV](https://github.com/varying-vagrant-vagrants/vvv/), you can enable xdebug by running `vagrant ssh` and then `xdebug_on` from the virtual machine's CLI.
  10. @wpscholar wpscholar revised this gist May 28, 2015. 1 changed file with 14 additions and 14 deletions.
    28 changes: 14 additions & 14 deletions vagrant-cheat-sheet.md
    Original file line number Diff line number Diff line change
    @@ -1,19 +1,19 @@
    Typing `vagrant` from the command line will display a list of all available commands.

    # Common Vagrant Commands
    - `vagrant up` starts vagrant environment (also provisions only on the FIRST vagrant up)
    - `vagrant status` outputs status of the vagrant machine
    - `vagrant global-status` outputs status of all vagrant machines
    - `vagrant halt` stops the vagrant machine
    - `vagrant reload` restarts vagrant machine, loads new Vagrantfile configuration
    - `vagrant provision` forces reprovisioning of the vagrant machine
    - `vagrant ssh` connects to machine via SSH
    - `vagrant destroy` stops and deletes all traces of the vagrant machine
    - `vagrant up` -- starts vagrant environment (also provisions only on the FIRST vagrant up)
    - `vagrant status` -- outputs status of the vagrant machine
    - `vagrant global-status` -- outputs status of all vagrant machines
    - `vagrant halt` -- stops the vagrant machine
    - `vagrant reload` -- restarts vagrant machine, loads new Vagrantfile configuration
    - `vagrant provision` -- forces reprovisioning of the vagrant machine
    - `vagrant ssh` -- connects to machine via SSH
    - `vagrant destroy` -- stops and deletes all traces of the vagrant machine

    # Tips
    - `vagrant -v` Get the vagrant version
    - `vagrant suspend` Suspends a virtual machine (remembers state)
    - `vagrant resume` Resume a suspended machine (vagrant up works just fine for this as well)
    - `vagrant reload --provision` Restart the virtual machine and force provisioning
    - `vagrant push` Vagrant can be configured to [deploy code](http://docs.vagrantup.com/v2/push/index.html)!
    - `vagrant up --provision | tee provision.log` Runs `vagrant up`, forces provisioning and logs all output to a file
    - `vagrant -v` -- Get the vagrant version
    - `vagrant suspend` -- Suspends a virtual machine (remembers state)
    - `vagrant resume` -- Resume a suspended machine (vagrant up works just fine for this as well)
    - `vagrant reload --provision` -- Restart the virtual machine and force provisioning
    - `vagrant push` -- Yes, vagrant can be configured to [deploy code](http://docs.vagrantup.com/v2/push/index.html)!
    - `vagrant up --provision | tee provision.log` -- Runs `vagrant up`, forces provisioning and logs all output to a file
  11. @wpscholar wpscholar revised this gist May 28, 2015. 2 changed files with 19 additions and 11 deletions.
    19 changes: 19 additions & 0 deletions vagrant-cheat-sheet.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,19 @@
    Typing `vagrant` from the command line will display a list of all available commands.

    # Common Vagrant Commands
    - `vagrant up` starts vagrant environment (also provisions only on the FIRST vagrant up)
    - `vagrant status` outputs status of the vagrant machine
    - `vagrant global-status` outputs status of all vagrant machines
    - `vagrant halt` stops the vagrant machine
    - `vagrant reload` restarts vagrant machine, loads new Vagrantfile configuration
    - `vagrant provision` forces reprovisioning of the vagrant machine
    - `vagrant ssh` connects to machine via SSH
    - `vagrant destroy` stops and deletes all traces of the vagrant machine

    # Tips
    - `vagrant -v` Get the vagrant version
    - `vagrant suspend` Suspends a virtual machine (remembers state)
    - `vagrant resume` Resume a suspended machine (vagrant up works just fine for this as well)
    - `vagrant reload --provision` Restart the virtual machine and force provisioning
    - `vagrant push` Vagrant can be configured to [deploy code](http://docs.vagrantup.com/v2/push/index.html)!
    - `vagrant up --provision | tee provision.log` Runs `vagrant up`, forces provisioning and logs all output to a file
    11 changes: 0 additions & 11 deletions vagrant-commands-cheat-sheet.txt
    Original file line number Diff line number Diff line change
    @@ -1,11 +0,0 @@
    Typing `vagrant` from the command line will display a list of all available commands.

    # Common Vagrant Commands
    vagrant up starts vagrant environment (also provisions only on the FIRST vagrant up)
    vagrant status outputs status of the vagrant machine
    vagrant global-status outputs status of all vagrant machines
    vagrant halt stops the vagrant machine
    vagrant reload restarts vagrant machine, loads new Vagrantfile configuration
    vagrant provision forces reprovisioning of the vagrant machine
    vagrant ssh connects to machine via SSH
    vagrant destroy stops and deletes all traces of the vagrant machine
  12. @wpscholar wpscholar created this gist May 28, 2015.
    11 changes: 11 additions & 0 deletions vagrant-commands-cheat-sheet.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,11 @@
    Typing `vagrant` from the command line will display a list of all available commands.

    # Common Vagrant Commands
    vagrant up starts vagrant environment (also provisions only on the FIRST vagrant up)
    vagrant status outputs status of the vagrant machine
    vagrant global-status outputs status of all vagrant machines
    vagrant halt stops the vagrant machine
    vagrant reload restarts vagrant machine, loads new Vagrantfile configuration
    vagrant provision forces reprovisioning of the vagrant machine
    vagrant ssh connects to machine via SSH
    vagrant destroy stops and deletes all traces of the vagrant machine