Skip to content

Latest commit

 

History

History

Vagrant

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 

Welcome to our comprehensive collection of learning resources for Vagrant! Here, you'll discover a curated list of the best learning materials we've assembled just for you.

Take a moment to explore these valuable resources, handpicked to enhance your understanding of Vagrant. We strive to provide the most up-to-date and informative content available.

Official resources

  • Vagrant site - installation instruction, official manuals and docs.
  • GitHub repo - source code, issues discussion and collaboration.

Boxes

Where to find OS boxes ?

  • Vagrantbox.es - the biggest list of all available boxes, maintained by community via GitHub pull requests.
  • Vagrant Cloud - config share, boxes distribution and discovery (also premium features of private collaboration and sharing).
  • Cloud Images Ubuntu.com - "clean" official Ubuntu cloud images.
  • Baseboxes from Opscode - CentOS, Fedora, Debian, FreeBSD, Ubuntu.
  • Puppet Labs Vagrant Boxes - these boxes are provided to be used by various Puppet projects.
  • Cloudsmith - A fully managed package management SaaS with support for Vagrant repositories (and many others).

Provisioning

Commands

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!

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. 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 suspend -- suspends a virtual machine (remembers state)

Cleaning Up a VM

  • vagrant destroy -- stops and deletes all traces of the vagrant machine
  • 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 box 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 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 provision --debug -- use the debug flag to increase the verbosity of the output
  • vagrant push -- yes, vagrant can be configured to deploy code!
  • vagrant up --provision | tee provision.log -- Runs vagrant up, forces provisioning and logs all output to a file

Plugins

  • vagrant-hostsupdater : $ vagrant plugin install vagrant-hostsupdater to update your /etc/hosts file automatically each time you start/stop your vagrant box.

Notable plugins

You can install these modules by this command vagrant plugin install MODULE-NAME

Helpers / Tools

  • Packer - a tool for creating identical machine images for multiple platforms from a single source configuration. For fast infrastructure deployment with multi-provider portability.
  • T.A.D.S. boilerplate - boilerplate to create, develop and deploy a Docker Swarm environment, using Vagrant to reproduce production environment locally.
  • Veewee - a tool for easily (and repeatedly) building custom Vagrant base boxes, KVMs, and virtual machine images.
  • Vagrant plugin for ZSH shell - auto-complete for commands, task names, box names and built-in documentation.
  • CLI Vagrant Manager - simple command-line tool to manage multiple vagrant boxes

Desktop tools

Web services

To generate Vagrantfile with automated provisioning scripts.

  • Phansible - provides an easy to use interface that helps you generate Ansible Playbooks for PHP based projects.
  • PuPHPet - a simple GUI to set up virtual machines for PHP Web development.
  • Protobox - PuPHPet analog, but uses own installer with YAML configuration format to control everything that is installed on the virtual machine.
  • Rove - a service that allows you to pregenerate typical Vagrant builds.

Proxy services

To proxy your local web server and make it publicly available over the internet.

  • Vagrant share - allows you to share your Vagrant environment with anyone in the world.
  • nip.io - a magic domain name that provides wildcard DNS for any IP address.
  • ngrok - tool to create secure tunnels to expose a local server behind a NAT or firewall to the internet.
  • serveo - expose local servers to the internet, without installing any client!
  • proxylocal.com - proxy your local web-server and make it publicly available over the internet.
  • localtunnel.me - assign you a unique publicly accessible url that will proxy all requests to your locally running webserver.
  • portmap.io - OpenVPN based free port forwarding solution.

Tutorials

Books

Popular readymade environments

  • Vagrantpress - development environment for creating and modifying WordPress sites.
  • Varying Vagrant Vagrants - An open source Vagrant configuration focused on WordPress development.
  • Joomla-Vagrant.
  • VDD - Vagrant Drupal Development.
  • Drupal VM - A VM for local Drupal development, built with Vagrant + Ansible
  • Try Yii2 - try Yii2 with Vagrant VM + Ansible provisioning = Complete readymade virtual server playground.
  • Laravel4-Vagrant - run Laravel 4 inside a Ubuntu 12.04 Vagrant Virtual Machine w/PHP 5.5.
  • OpenStack on Ansible with Vagrant.
  • Laravel Homestead - Official Vagrant Box for Laravel development, based on Ubuntu 16.04 LTS, PHP 7, Nginx, and multiple database platforms.
  • Scotch Box - Simple Vagrant Box with LAMP stack, plus some useful extras, based on Ubuntu 14.04 LTS.

If you have any additional resources or links that you believe would benefit others, please feel free to contribute. Our goal is to create a repository of the best learning materials, ensuring everyone has access to top-notch content.

We appreciate your visit to this repository. If you find our initiatives valuable, kindly star this repository to show your support.

Thank you once again, and happy learning!