Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Vagrant Basics

Vagrant Basics

A vagrant presentation

Krishna Halaharvi

January 23, 2014

More Decks by Krishna Halaharvi

Other Decks in Programming


  1. Vagrant

  2. A person without a settled home or regular work who

    wanders from place to place and lives by begging. Definition
  3. Why Vagrant? -Prior to vagrant -Install and configure all the

    software locally on your development machine -Set it and forget it PHP and mySQL -Easy to configure -Reproducible -Portable
  4. Today -A lot of moving parts -Options for underlying technologies

    -Javascript, Python, Ruby -Web Servers: Apache, Nginx, Unicorn, Thin, RabbitMQ, Solr
  5. None
  6. Runs on top of -VirtualBox -VMware -AWS -Others through the

    plugin system
  7. Commands Vagrant init Vagrant up Vagrant ssh

  8. One Command Many Benefits -Create a VM of an OS

    of your choice -Modify physical properties of this VM -Establish network interfaces -Set shared folders -Boot up the VM to set it to run -Set the hostname of VM -Provision software on VM -Performs host and guest specific tweaking.
  9. Set up the Machine

  10. SSH Into the machine Halt

  11. Destroy the machine

  12. The Vagrantfile -Vagrant is configured per project

  13. Boxes -Building a VM from scratch is resource- intensive and

    time consuming -Vagrant uses a base image clones it to rapidly create a usable machine -Boxes are added to vagrant by running -$vagrant box add “name” “location”
  14. http://www.vagrantbox.es/

  15. Provisioning and Networking Simply add this to the vagrantfile and

    set up the shell script to install your webserver: config.vm.provision :shell, :path => “bootstrap.sh” Port forwarding: config.vm.network :forwarded_port, host: 3000, guest: 80
  16. Multi-Machine -Vagrant can control multiple guest machines per vagrantfile -Seperate

    a web and database server -Model a distributed system -Disaster case testing
  17. None
  18. URLs http://www.vagrantup.com/ http://www.vagrantbox.es/ https://www.virtualbox.org/

  19. Questions?