SlideShare a Scribd company logo
Vagrant for Virtualized
Development
By:
Adam Culp
Twitter: @adamculp
https://joind.in/10538
2
Vagrant for Virtualized Development
●
About me
– PHP 5.3 Certified
– Consultant at Zend Technologies
– Organizer SoFloPHP (South Florida)
– Organized SunshinePHP (Miami)
– Long distance (ulramarathon) runner
– Judo Black Belt Instructor
3
Vagrant for Virtualized Development
● Shortfalls of development environments
– Does not mirror “testing” or “production” setup.
– Each developer has a different one.
● Easily out of sync with standards
● Many versions of (php, mysql, apache, etc.)
– Long ramp-up/training for new developers
– It works for me!
4
Vagrant for Virtualized Development
● Vagrant - http://vagrantup.com
– Virtualized development environments made easy
●
Command line tool
●
Lowers setup time
● Fully control entire environments and versions
● Eliminates “works on my machine” excuse
● Uses:
– VirtualBox
– VMWare
– AWS
– Others....
● Can use Puppet or Chef
● FREE and open source
5
Vagrant for Virtualized Development
●
Benefits of Using Vagrant
– Solo Developers
●
Maintain consistency across multiple projects.
●
Can run multiple environments on a single host machine.
(Dev., Test, Staging)
●
Easily tear down and rebuild.
– Teams
●
Identical development environments.
●
Consistent and portable.
– Companies
●
Easier onboarding of new talent.
●
Build once and distribute to teams.
6
Vagrant for Virtualized Development
● Vagrant minimum requirements
– VirtualBox and Hyper-V supported out of the box
– Ruby
– Vagrant
● Installers for MAC, Windows, various Linux
● Talks to VirtualBox and builds virtual machine based on a “base box”.
– Chef or Puppet
● These require separate installation
● Enables setup and configuration of advanced services you may need in your
environment.
7
Vagrant for Virtualized Development
● Vagrant Basic “How To”
– Navigate (via terminal) to your project.
– Find a base box: http://vagrantbox.es
– Execute two simple commands:
● vagrant init
● vagrant up
8
Vagrant for Virtualized Development
9
Vagrant for Virtualized Development
● Vagrant Base Box Commands
– Many base boxes available over the Internet, or
you can create your own.
● Creation convention should be followed.
– A base box must be added via local file or HTTP.
10
Vagrant for Virtualized Development
● Vagrant Base Box Commands
– You can list current “installed” base boxes.
11
Vagrant for Virtualized Development
● Vagrant Base Box Commands
– Or you can remove current base boxes.
● Remember to include provider.
12
Vagrant for Virtualized Development
● Vagrant Configuration File (Vagrantfile)
– Simple Ruby code which typically contains a Vagrant
configuration block.
– First thing loaded by Vagrant.
– Basic file created when 'init' is called from within a
directory.
– Add more options for more configuration.
13
Vagrant for Virtualized Development
● Sample Vagrantfile
14
Vagrant for Virtualized Development
● Suspend / Halt / Destroy
– To shut down we can:
● “suspend” to save the current state of the
machine. (does not return disk space, about
1GB)
● “halt” which is a graceful shutdown.
●
“destroy” everything. (requires re-provision)
– If we “suspended” to shut down last time you can
use “vagrant resume” or “vagrant up” when
returning, otherwise we use “vagrant up”.
15
Vagrant for Virtualized Development
●
SSH
– Vagrant makes SSH to the virtual machine easy
from within the project directory.
– Project files are available in the VM at '/vagrant' by
default, but can be changed.
– The VM has both read and write access to the
shared folder.
– Gain root (su) access use “sudo”.
16
Vagrant for Virtualized Development
● Port Forwarding
– By default your host machine should be able to
access the virtual machine by IP address. However,
we need to activate port forwarding for services.
– For HTTP:
– Then we simply reload Vagrant.
$ vagrant reload
17
Vagrant for Virtualized Development
● Provisioning
– We can set up some provisioning automation in
Vagrant by including a shell script.
– Link to a shell script in the Vagrantfile.
18
Vagrant for Virtualized Development
● Sample Shell Script
19
Vagrant for Virtualized Development
●
Packaging Your Own
– Start with a Base Box
●
Customize it as needed, unless relying solely on
provisioning with Chef or Puppet.
●
Run command to package
$ vagrant package –vagrantfile Vagrantfile.pkg
●
Creates 'package.box' in same directory.
●
Distribute via raw file or via HTTP, for others.
●
Other users can now use:
$ vagrant box add my_box /path/to/the/package.box
$ vagrant init my_box
$ vagrant up
20
Vagrant for Virtualized Development
● Packaging Your Own (from scratch)
– Simple enough to do.
– Follow Vagrant standards, especially if you plan to
share it.
● Set sizes of partition and RAM.(40GB/360MB)
● Set Domain and Hostname
●
Create Vagrant user, and password.
● Create some groups
● Ruby, RubyGems, Puppet, Chef, SSH with public keys
● Set sudo permissions
● Create /vagrant directory
21
Vagrant for Virtualized Development
● Provisioning
– Using Chef or Puppet we can create a script to alter
the VM.
●
Install apps
●
Edit config files
●
Many tasks needed to go from Base Box to desired
environment.
– Manifests (or recipe for Chef)
●
Manifests sub-directory within project.
●
Default.pp is the default file loaded.
22
Vagrant for Virtualized Development
● Advanced Capabilities of Vagrant
– Many advanced topics available under
Documentation on the Vagrant site.
●
Modules within Manifests to encapsulate Puppet
files.
●
Create your own Base Boxes
●
Multi-VM Environment
●
Plugins
●
NFS Shared Folders
23
Vagrant for Virtualized Development
● Puppet is:
– Automation software
● Help system admins manage infrastructure.
– Automates provisioning and configuration
– Automate repetitive tasks
– Ensure stability through consistency
– Open source and commercial versions
24
Vagrant for Virtualized Development
● Puppet Supported Operating Systems:
– RHEL
– CentOS
– Ubuntu
– Debian
– Scientific Linux
– Oracle Linux
– SUSE
– Solaris
– Windows
25
Vagrant for Virtualized Development
● Pieces
– Modules for popular
configurations
– Compose application
stack needed
– Rollout to the node
26
Vagrant for Virtualized Development
● Puppet Training
– Materials available on PuppetLabs site for FREE download.
●
Learning Puppet Tutorial
●
Learn Puppet VM to train on (VMWare or VirtualBox)
● Module cheatsheet
● Core types cheatsheet
● Users Guide
● Dashboard Manual
27
Vagrant for Virtualized Development
●
New tool PuPHPet
– Complex Vagrant setups made easy GUI.
●
Puppet manifest creation
●
Host (local, Digital Ocean, Rackspace).
●
Ubuntu version.
●
Set VM options.
● HTTP server. (Apache, Nginx)
●
PHP version. (5.5, 5.4, 5.3)
●
Or HHVM
●
Debugger (Xdebug).
●
Profiler (XHProf).
●
Drush
●
Database. (MySQL, PostgreSQL, MariaDB, MongoDB, Redis)
● Beantalkd or RabitMQ
●
Elastic Search
●
Create!
28
Vagrant for Virtualized Development
● New tool Rove.io
– Complex Vagrant setups made easy GUI.
●
Chef recipe creation
●
Database. (various)
● Language. (Node.js, PHP, Python, Ruby)
● SCM (Git, Mercurial, Subversion)
● HTTP server (Apache, Nginx)
● Generate!
29
Vagrant for Virtualized Development
● Resources
– http://vagrantup.com
– http://puppetlabs.com
– http://opscode.com/chef/
– http://virtualbox.org
– http://puPHPet.com
– http://getcomposer.org
– http://github.com
View details, slides, and rate at https://joind.in/10538
● Thank you
Adam Culp
http://www.geekyboy.com
http://github.com/adamculp
Twitter @adamculp
View details, slides, and rate at https://joind.in/10538

More Related Content

What's hot (19)

PDF
Multi-provider Vagrant and Chef: AWS, VMware, and more
Chef Software, Inc.
 
ODP
It Works On My Machine: Vagrant for Software Development
Carlos Perez
 
PPTX
Vagrant 101 Workshop
Liora Milbaum
 
PDF
Create your very own Development Environment with Vagrant and Packer
frastel
 
PDF
Vagrant for real
Michele Orselli
 
PPTX
Vagrant to-aws-flow
Kimberly Macias
 
ODP
Building (localized) Vagrant boxes with Packer
Cristovao G. Verstraeten
 
PPTX
Vagrant step-by-step guide for Beginners
Sagar Acharya
 
PDF
Vagrant + Ansible + Docker
Vijay Selvaraj
 
PPTX
Node.js, Vagrant, Chef, and Mathoid @ Benetech
Christopher Bumgardner
 
PDF
體驗 Hhvm
Chen Cheng-Wei
 
PPTX
Vagrant hands on workshop for beginners
Liora Milbaum
 
PPTX
Vagrant
ProfessionalVMware
 
PDF
Drupal VM for Drupal 8 Dev - MidCamp 2017
Jeff Geerling
 
PDF
Automated Infrastructure and Application Management
Clark Everetts
 
PPTX
6 Years of Docker: The Good, the Bad and Python Packaging at PyCon.DE&PyData ...
Sebastian Neubauer
 
PDF
Vagrant - Version control your dev environment
bocribbz
 
PDF
VCCW - Vagrant based WordPress development environment
Takayuki Miyauchi
 
PPTX
Using vagrant
Cuong Huynh
 
Multi-provider Vagrant and Chef: AWS, VMware, and more
Chef Software, Inc.
 
It Works On My Machine: Vagrant for Software Development
Carlos Perez
 
Vagrant 101 Workshop
Liora Milbaum
 
Create your very own Development Environment with Vagrant and Packer
frastel
 
Vagrant for real
Michele Orselli
 
Vagrant to-aws-flow
Kimberly Macias
 
Building (localized) Vagrant boxes with Packer
Cristovao G. Verstraeten
 
Vagrant step-by-step guide for Beginners
Sagar Acharya
 
Vagrant + Ansible + Docker
Vijay Selvaraj
 
Node.js, Vagrant, Chef, and Mathoid @ Benetech
Christopher Bumgardner
 
體驗 Hhvm
Chen Cheng-Wei
 
Vagrant hands on workshop for beginners
Liora Milbaum
 
Drupal VM for Drupal 8 Dev - MidCamp 2017
Jeff Geerling
 
Automated Infrastructure and Application Management
Clark Everetts
 
6 Years of Docker: The Good, the Bad and Python Packaging at PyCon.DE&PyData ...
Sebastian Neubauer
 
Vagrant - Version control your dev environment
bocribbz
 
VCCW - Vagrant based WordPress development environment
Takayuki Miyauchi
 
Using vagrant
Cuong Huynh
 

Viewers also liked (20)

PDF
Vagrant For DevOps
Lalatendu Mohanty
 
PDF
Vagrant + Docker provider [+Puppet]
Nicolas Poggi
 
PDF
Dockerizing development workflow
Orest Ivasiv
 
PDF
Vagrant or docker for java dev environment
Orest Ivasiv
 
PDF
Vagrant for real codemotion (moar tips! ;-))
Michele Orselli
 
PPTX
Automate your Development Environment with Vagrant & Chef
Michael Lihs
 
PDF
Vagrant, como usar para desenvolvimento PHP
Renan Martins Pimentel
 
PDF
Minicurso de Vagrant
Leandro Nunes
 
PDF
Virtualization with Vagrant (ua.pycon 2011)
Dmitry Guyvoronsky
 
PDF
Vagrant - ambiente de desenvolvimento virtualizado
Vinícius Krolow
 
PPTX
Software Containerization
Roshan Deniyage
 
PDF
Vagrant and docker
DuckDuckGo
 
PDF
Vagrant for real (codemotion rome 2016)
Michele Orselli
 
PPTX
Vagrant + Docker
David Giordano
 
PPTX
Vagrant vs Docker
jchase50
 
PDF
Intro to containerization
Balint Pato
 
PPTX
Vagrant
Denys Haryachyy
 
PDF
A brief introduction to Vagrant – 原來 VirtualBox 可以這樣玩
Wen-Tien Chang
 
PDF
Containerization is more than the new Virtualization: enabling separation of ...
Jérôme Petazzoni
 
PDF
Infrastructure testing with Jenkins, Puppet and Vagrant - Agile Testing Days ...
Carlos Sanchez
 
Vagrant For DevOps
Lalatendu Mohanty
 
Vagrant + Docker provider [+Puppet]
Nicolas Poggi
 
Dockerizing development workflow
Orest Ivasiv
 
Vagrant or docker for java dev environment
Orest Ivasiv
 
Vagrant for real codemotion (moar tips! ;-))
Michele Orselli
 
Automate your Development Environment with Vagrant & Chef
Michael Lihs
 
Vagrant, como usar para desenvolvimento PHP
Renan Martins Pimentel
 
Minicurso de Vagrant
Leandro Nunes
 
Virtualization with Vagrant (ua.pycon 2011)
Dmitry Guyvoronsky
 
Vagrant - ambiente de desenvolvimento virtualizado
Vinícius Krolow
 
Software Containerization
Roshan Deniyage
 
Vagrant and docker
DuckDuckGo
 
Vagrant for real (codemotion rome 2016)
Michele Orselli
 
Vagrant + Docker
David Giordano
 
Vagrant vs Docker
jchase50
 
Intro to containerization
Balint Pato
 
A brief introduction to Vagrant – 原來 VirtualBox 可以這樣玩
Wen-Tien Chang
 
Containerization is more than the new Virtualization: enabling separation of ...
Jérôme Petazzoni
 
Infrastructure testing with Jenkins, Puppet and Vagrant - Agile Testing Days ...
Carlos Sanchez
 
Ad

Similar to Vagrant for Virtualized Development (20)

PPTX
Virtualization for Developers
John Coggeshall
 
PPTX
Virtualization for Developers
John Coggeshall
 
PPTX
Virtualization for Developers
John Coggeshall
 
PDF
Keep calm and vagrant up
Daniel Carvalhinho
 
PDF
Powering Development and Testing Environments with Vagrant
Coen Jacobs
 
PPTX
Development with Vagrant
John Coggeshall
 
PDF
Local development environment through virtualisation
Radu Barbu
 
PDF
DevOps Series: Defining and Sharing Testable Machine Configurations with vagrant
Felipe
 
PDF
Vagrant for local and team WordPress Development
Anthony Alvarez
 
PDF
Take Home Your Very Own Free Vagrant CFML Dev Environment
ColdFusionConference
 
PDF
Take home your very own free Vagrant CFML Dev Environment - Presented at dev....
Gavin Pickin
 
PDF
Vagrant workshop 2015
Haifa Ftirich
 
PDF
Puppet and Vagrant in development
Adam Culp
 
PDF
Create Disposable Test Environments with Vagrant and Puppet
Coveros, Inc.
 
PDF
Create Disposable Test Environments with Vagrant and Puppet
Gene Gotimer
 
PDF
Improved development workflows using vagrant
Makis Asimidis
 
PDF
Vagrant - Team Development made easy
Marco Silva
 
PDF
Vagrant for Development
Jacky Chan
 
PPT
Vagrant
Nathan Howard
 
ODP
Vagrant and puppet: Deployment made easy
Geronimo Orozco
 
Virtualization for Developers
John Coggeshall
 
Virtualization for Developers
John Coggeshall
 
Virtualization for Developers
John Coggeshall
 
Keep calm and vagrant up
Daniel Carvalhinho
 
Powering Development and Testing Environments with Vagrant
Coen Jacobs
 
Development with Vagrant
John Coggeshall
 
Local development environment through virtualisation
Radu Barbu
 
DevOps Series: Defining and Sharing Testable Machine Configurations with vagrant
Felipe
 
Vagrant for local and team WordPress Development
Anthony Alvarez
 
Take Home Your Very Own Free Vagrant CFML Dev Environment
ColdFusionConference
 
Take home your very own free Vagrant CFML Dev Environment - Presented at dev....
Gavin Pickin
 
Vagrant workshop 2015
Haifa Ftirich
 
Puppet and Vagrant in development
Adam Culp
 
Create Disposable Test Environments with Vagrant and Puppet
Coveros, Inc.
 
Create Disposable Test Environments with Vagrant and Puppet
Gene Gotimer
 
Improved development workflows using vagrant
Makis Asimidis
 
Vagrant - Team Development made easy
Marco Silva
 
Vagrant for Development
Jacky Chan
 
Vagrant
Nathan Howard
 
Vagrant and puppet: Deployment made easy
Geronimo Orozco
 
Ad

More from Adam Culp (20)

PDF
Hypermedia
Adam Culp
 
PDF
Putting legacy to REST with middleware
Adam Culp
 
PDF
php-1701-a
Adam Culp
 
PDF
Release your refactoring superpower
Adam Culp
 
PDF
Managing Technical Debt
Adam Culp
 
PDF
Developing PHP Applications Faster
Adam Culp
 
PDF
Containing Quality
Adam Culp
 
PDF
Debugging elephpants
Adam Culp
 
PDF
Zend expressive workshop
Adam Culp
 
PDF
Expressive Microservice Framework Blastoff
Adam Culp
 
PDF
Foundations of Zend Framework
Adam Culp
 
PDF
Accidental professional
Adam Culp
 
PDF
Build great products
Adam Culp
 
PDF
Does Your Code Measure Up?
Adam Culp
 
PDF
Practical PHP Deployment with Jenkins
Adam Culp
 
PDF
Virtualizing Development
Adam Culp
 
PDF
Refactoring Legacy Code
Adam Culp
 
PDF
Deprecated: Foundations of Zend Framework 2
Adam Culp
 
PDF
Clean application development tutorial
Adam Culp
 
PDF
Refactoring 101
Adam Culp
 
Hypermedia
Adam Culp
 
Putting legacy to REST with middleware
Adam Culp
 
php-1701-a
Adam Culp
 
Release your refactoring superpower
Adam Culp
 
Managing Technical Debt
Adam Culp
 
Developing PHP Applications Faster
Adam Culp
 
Containing Quality
Adam Culp
 
Debugging elephpants
Adam Culp
 
Zend expressive workshop
Adam Culp
 
Expressive Microservice Framework Blastoff
Adam Culp
 
Foundations of Zend Framework
Adam Culp
 
Accidental professional
Adam Culp
 
Build great products
Adam Culp
 
Does Your Code Measure Up?
Adam Culp
 
Practical PHP Deployment with Jenkins
Adam Culp
 
Virtualizing Development
Adam Culp
 
Refactoring Legacy Code
Adam Culp
 
Deprecated: Foundations of Zend Framework 2
Adam Culp
 
Clean application development tutorial
Adam Culp
 
Refactoring 101
Adam Culp
 

Recently uploaded (20)

PPTX
"Autonomy of LLM Agents: Current State and Future Prospects", Oles` Petriv
Fwdays
 
PPTX
AUTOMATION AND ROBOTICS IN PHARMA INDUSTRY.pptx
sameeraaabegumm
 
PDF
IoT-Powered Industrial Transformation – Smart Manufacturing to Connected Heal...
Rejig Digital
 
PPTX
WooCommerce Workshop: Bring Your Laptop
Laura Hartwig
 
PDF
Agentic AI lifecycle for Enterprise Hyper-Automation
Debmalya Biswas
 
PDF
[Newgen] NewgenONE Marvin Brochure 1.pdf
darshakparmar
 
PDF
Transforming Utility Networks: Large-scale Data Migrations with FME
Safe Software
 
PDF
"Beyond English: Navigating the Challenges of Building a Ukrainian-language R...
Fwdays
 
PDF
Bitcoin for Millennials podcast with Bram, Power Laws of Bitcoin
Stephen Perrenod
 
PPTX
AI Penetration Testing Essentials: A Cybersecurity Guide for 2025
defencerabbit Team
 
PPTX
Webinar: Introduction to LF Energy EVerest
DanBrown980551
 
PDF
Reverse Engineering of Security Products: Developing an Advanced Microsoft De...
nwbxhhcyjv
 
DOCX
Python coding for beginners !! Start now!#
Rajni Bhardwaj Grover
 
PDF
Transcript: New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
PDF
Jak MŚP w Europie Środkowo-Wschodniej odnajdują się w świecie AI
dominikamizerska1
 
PDF
How Startups Are Growing Faster with App Developers in Australia.pdf
India App Developer
 
PPTX
OpenID AuthZEN - Analyst Briefing July 2025
David Brossard
 
PPTX
COMPARISON OF RASTER ANALYSIS TOOLS OF QGIS AND ARCGIS
Sharanya Sarkar
 
PPTX
The Project Compass - GDG on Campus MSIT
dscmsitkol
 
PDF
Staying Human in a Machine- Accelerated World
Catalin Jora
 
"Autonomy of LLM Agents: Current State and Future Prospects", Oles` Petriv
Fwdays
 
AUTOMATION AND ROBOTICS IN PHARMA INDUSTRY.pptx
sameeraaabegumm
 
IoT-Powered Industrial Transformation – Smart Manufacturing to Connected Heal...
Rejig Digital
 
WooCommerce Workshop: Bring Your Laptop
Laura Hartwig
 
Agentic AI lifecycle for Enterprise Hyper-Automation
Debmalya Biswas
 
[Newgen] NewgenONE Marvin Brochure 1.pdf
darshakparmar
 
Transforming Utility Networks: Large-scale Data Migrations with FME
Safe Software
 
"Beyond English: Navigating the Challenges of Building a Ukrainian-language R...
Fwdays
 
Bitcoin for Millennials podcast with Bram, Power Laws of Bitcoin
Stephen Perrenod
 
AI Penetration Testing Essentials: A Cybersecurity Guide for 2025
defencerabbit Team
 
Webinar: Introduction to LF Energy EVerest
DanBrown980551
 
Reverse Engineering of Security Products: Developing an Advanced Microsoft De...
nwbxhhcyjv
 
Python coding for beginners !! Start now!#
Rajni Bhardwaj Grover
 
Transcript: New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
Jak MŚP w Europie Środkowo-Wschodniej odnajdują się w świecie AI
dominikamizerska1
 
How Startups Are Growing Faster with App Developers in Australia.pdf
India App Developer
 
OpenID AuthZEN - Analyst Briefing July 2025
David Brossard
 
COMPARISON OF RASTER ANALYSIS TOOLS OF QGIS AND ARCGIS
Sharanya Sarkar
 
The Project Compass - GDG on Campus MSIT
dscmsitkol
 
Staying Human in a Machine- Accelerated World
Catalin Jora
 

Vagrant for Virtualized Development

  • 1. Vagrant for Virtualized Development By: Adam Culp Twitter: @adamculp https://joind.in/10538
  • 2. 2 Vagrant for Virtualized Development ● About me – PHP 5.3 Certified – Consultant at Zend Technologies – Organizer SoFloPHP (South Florida) – Organized SunshinePHP (Miami) – Long distance (ulramarathon) runner – Judo Black Belt Instructor
  • 3. 3 Vagrant for Virtualized Development ● Shortfalls of development environments – Does not mirror “testing” or “production” setup. – Each developer has a different one. ● Easily out of sync with standards ● Many versions of (php, mysql, apache, etc.) – Long ramp-up/training for new developers – It works for me!
  • 4. 4 Vagrant for Virtualized Development ● Vagrant - http://vagrantup.com – Virtualized development environments made easy ● Command line tool ● Lowers setup time ● Fully control entire environments and versions ● Eliminates “works on my machine” excuse ● Uses: – VirtualBox – VMWare – AWS – Others.... ● Can use Puppet or Chef ● FREE and open source
  • 5. 5 Vagrant for Virtualized Development ● Benefits of Using Vagrant – Solo Developers ● Maintain consistency across multiple projects. ● Can run multiple environments on a single host machine. (Dev., Test, Staging) ● Easily tear down and rebuild. – Teams ● Identical development environments. ● Consistent and portable. – Companies ● Easier onboarding of new talent. ● Build once and distribute to teams.
  • 6. 6 Vagrant for Virtualized Development ● Vagrant minimum requirements – VirtualBox and Hyper-V supported out of the box – Ruby – Vagrant ● Installers for MAC, Windows, various Linux ● Talks to VirtualBox and builds virtual machine based on a “base box”. – Chef or Puppet ● These require separate installation ● Enables setup and configuration of advanced services you may need in your environment.
  • 7. 7 Vagrant for Virtualized Development ● Vagrant Basic “How To” – Navigate (via terminal) to your project. – Find a base box: http://vagrantbox.es – Execute two simple commands: ● vagrant init ● vagrant up
  • 9. 9 Vagrant for Virtualized Development ● Vagrant Base Box Commands – Many base boxes available over the Internet, or you can create your own. ● Creation convention should be followed. – A base box must be added via local file or HTTP.
  • 10. 10 Vagrant for Virtualized Development ● Vagrant Base Box Commands – You can list current “installed” base boxes.
  • 11. 11 Vagrant for Virtualized Development ● Vagrant Base Box Commands – Or you can remove current base boxes. ● Remember to include provider.
  • 12. 12 Vagrant for Virtualized Development ● Vagrant Configuration File (Vagrantfile) – Simple Ruby code which typically contains a Vagrant configuration block. – First thing loaded by Vagrant. – Basic file created when 'init' is called from within a directory. – Add more options for more configuration.
  • 13. 13 Vagrant for Virtualized Development ● Sample Vagrantfile
  • 14. 14 Vagrant for Virtualized Development ● Suspend / Halt / Destroy – To shut down we can: ● “suspend” to save the current state of the machine. (does not return disk space, about 1GB) ● “halt” which is a graceful shutdown. ● “destroy” everything. (requires re-provision) – If we “suspended” to shut down last time you can use “vagrant resume” or “vagrant up” when returning, otherwise we use “vagrant up”.
  • 15. 15 Vagrant for Virtualized Development ● SSH – Vagrant makes SSH to the virtual machine easy from within the project directory. – Project files are available in the VM at '/vagrant' by default, but can be changed. – The VM has both read and write access to the shared folder. – Gain root (su) access use “sudo”.
  • 16. 16 Vagrant for Virtualized Development ● Port Forwarding – By default your host machine should be able to access the virtual machine by IP address. However, we need to activate port forwarding for services. – For HTTP: – Then we simply reload Vagrant. $ vagrant reload
  • 17. 17 Vagrant for Virtualized Development ● Provisioning – We can set up some provisioning automation in Vagrant by including a shell script. – Link to a shell script in the Vagrantfile.
  • 18. 18 Vagrant for Virtualized Development ● Sample Shell Script
  • 19. 19 Vagrant for Virtualized Development ● Packaging Your Own – Start with a Base Box ● Customize it as needed, unless relying solely on provisioning with Chef or Puppet. ● Run command to package $ vagrant package –vagrantfile Vagrantfile.pkg ● Creates 'package.box' in same directory. ● Distribute via raw file or via HTTP, for others. ● Other users can now use: $ vagrant box add my_box /path/to/the/package.box $ vagrant init my_box $ vagrant up
  • 20. 20 Vagrant for Virtualized Development ● Packaging Your Own (from scratch) – Simple enough to do. – Follow Vagrant standards, especially if you plan to share it. ● Set sizes of partition and RAM.(40GB/360MB) ● Set Domain and Hostname ● Create Vagrant user, and password. ● Create some groups ● Ruby, RubyGems, Puppet, Chef, SSH with public keys ● Set sudo permissions ● Create /vagrant directory
  • 21. 21 Vagrant for Virtualized Development ● Provisioning – Using Chef or Puppet we can create a script to alter the VM. ● Install apps ● Edit config files ● Many tasks needed to go from Base Box to desired environment. – Manifests (or recipe for Chef) ● Manifests sub-directory within project. ● Default.pp is the default file loaded.
  • 22. 22 Vagrant for Virtualized Development ● Advanced Capabilities of Vagrant – Many advanced topics available under Documentation on the Vagrant site. ● Modules within Manifests to encapsulate Puppet files. ● Create your own Base Boxes ● Multi-VM Environment ● Plugins ● NFS Shared Folders
  • 23. 23 Vagrant for Virtualized Development ● Puppet is: – Automation software ● Help system admins manage infrastructure. – Automates provisioning and configuration – Automate repetitive tasks – Ensure stability through consistency – Open source and commercial versions
  • 24. 24 Vagrant for Virtualized Development ● Puppet Supported Operating Systems: – RHEL – CentOS – Ubuntu – Debian – Scientific Linux – Oracle Linux – SUSE – Solaris – Windows
  • 25. 25 Vagrant for Virtualized Development ● Pieces – Modules for popular configurations – Compose application stack needed – Rollout to the node
  • 26. 26 Vagrant for Virtualized Development ● Puppet Training – Materials available on PuppetLabs site for FREE download. ● Learning Puppet Tutorial ● Learn Puppet VM to train on (VMWare or VirtualBox) ● Module cheatsheet ● Core types cheatsheet ● Users Guide ● Dashboard Manual
  • 27. 27 Vagrant for Virtualized Development ● New tool PuPHPet – Complex Vagrant setups made easy GUI. ● Puppet manifest creation ● Host (local, Digital Ocean, Rackspace). ● Ubuntu version. ● Set VM options. ● HTTP server. (Apache, Nginx) ● PHP version. (5.5, 5.4, 5.3) ● Or HHVM ● Debugger (Xdebug). ● Profiler (XHProf). ● Drush ● Database. (MySQL, PostgreSQL, MariaDB, MongoDB, Redis) ● Beantalkd or RabitMQ ● Elastic Search ● Create!
  • 28. 28 Vagrant for Virtualized Development ● New tool Rove.io – Complex Vagrant setups made easy GUI. ● Chef recipe creation ● Database. (various) ● Language. (Node.js, PHP, Python, Ruby) ● SCM (Git, Mercurial, Subversion) ● HTTP server (Apache, Nginx) ● Generate!
  • 29. 29 Vagrant for Virtualized Development ● Resources – http://vagrantup.com – http://puppetlabs.com – http://opscode.com/chef/ – http://virtualbox.org – http://puPHPet.com – http://getcomposer.org – http://github.com View details, slides, and rate at https://joind.in/10538
  • 30. ● Thank you Adam Culp http://www.geekyboy.com http://github.com/adamculp Twitter @adamculp View details, slides, and rate at https://joind.in/10538