SlideShare a Scribd company logo
1 of 35
It Works on My Machine:It Works on My Machine:
Vagrant for Software DevelopmentVagrant for Software Development
Colorado Springs Open Source Software MeetupColorado Springs Open Source Software Meetup
1/20/20161/20/2016
Carlos PerezCarlos Perez
perez@doorstep.comperez@doorstep.com
January 20, 2016 Overview of Vagrant 2
Traditional Dev. EnvironmentTraditional Dev. Environment
SCM / CI
Dev. 1 w/ app stack
Mac OS X
Test / Stage /Prod
Dev. 2 w/ app stack
Linux Ubuntu
Dev. 3 w/ app stack
MS Windows
Dev. 4 w/ app stack
Everyone has their own application stack
and machine dependencies. This is known
as the 'works on my machine' problem.
January 20, 2016 Overview of Vagrant 3
Source: TIOBE Index for January 2016
http://www.tiobe.com/index.php/content/paperinfo/tpci/index.html
TIOBE Index of Popular Programming Languages
January 20, 2016 Overview of Vagrant 4
Why Use Vagrant?Why Use Vagrant?
●
SOLUTION: Have everyone work on the 'sameSOLUTION: Have everyone work on the 'same
machine' bymachine' by declaratively specifying thedeclaratively specifying the
configuration for a VM instanceconfiguration for a VM instance
●
Based on virtual machines you already knowBased on virtual machines you already know
(VirtualBox, VMWare, Hyper-V, etc.)(VirtualBox, VMWare, Hyper-V, etc.)
●
Easy to configure, reproducible, portableEasy to configure, reproducible, portable
●
SCM friendly files (git, tfvc)SCM friendly files (git, tfvc)
●
DevOps friendly: write and test provisioningDevOps friendly: write and test provisioning
'scripts' (Chef, Puppet, Ansible, etc.)'scripts' (Chef, Puppet, Ansible, etc.)
January 20, 2016 Overview of Vagrant 5
Vagrant ArchitectureVagrant Architecture
VM
Host OS
Guest OS: CentOS
/home/user1/projects/web1 => /vagrant
Web Browser
IDE / Editor
git
Apache
PHP
MySQL
port 2222 => 22; port 8000 => 80
Virtualbox
port forwards
synced folders
January 20, 2016 Overview of Vagrant 6
Basic DemoBasic Demo
January 20, 2016 Overview of Vagrant 7
VagrantVagrant
●
Open source, started in 2010 by MitchellOpen source, started in 2010 by Mitchell
HashimotoHashimoto
●
MIT LicenseMIT License
●
Website:Website: https://www.vagrantup.comhttps://www.vagrantup.com
●
Docs:Docs: https://docs.vagrantup.com/v2/https://docs.vagrantup.com/v2/
●
Installation:Installation:
●
Vagrant (apt-get, .deb, .dmg, .msi)Vagrant (apt-get, .deb, .dmg, .msi)
●
VM (VM (https://www.virtualbox.orghttps://www.virtualbox.org))
●
Windows: PuTTY, PuTTYgenWindows: PuTTY, PuTTYgen
January 20, 2016 Overview of Vagrant 8
TerminologyTerminology
●
BoxBox: VM base image for: VM base image for guestguest (a.k.a.(a.k.a. templatetemplate))
●
ProviderProvider: virtualization layer on: virtualization layer on hosthost
(VirtualBox, VMWare, etc.)(VirtualBox, VMWare, etc.)
●
ProvisionerProvisioner: system for automating software: system for automating software
installations (shell, chef, etc.)installations (shell, chef, etc.)
●
ProjectProject: directory containing Vagrantfile and: directory containing Vagrantfile and
typically the root of the 'synced folder'typically the root of the 'synced folder'
January 20, 2016 Overview of Vagrant 9
Basic CommandsBasic Commands
● vagrant –helpvagrant –help
● vagrant global-statusvagrant global-status: show: show
environmentsenvironments
● vagrant statusvagrant status: show project status: show project status
● vagrant box listvagrant box list: show installed boxes: show installed boxes
January 20, 2016 Overview of Vagrant 10
Vagrant Up FlowVagrant Up Flow
A
Box repository
download
B
Local box
directory
C
VM instance
directory
import
1) vagrant up
2) If box does not exist, download from 'A' and add to 'B'
3) If VM does not exist, import from local box directory 'B' and copy to 'C'
4) Start VM, networking, port forwards, import SSH keys
5) Mount shared folders
6) Provision VM
7) vagrant ssh
https://atlas.hashicorp.com/ubuntu/boxes/trusty32/versions/20151218.0.1/
provider/virtualbox.box
~/.vagrant.d/boxes/ubuntu-VAGRANTSLASH-trusty32
~/VirtualBox VMs/trusty32_default_1452718546328_49107
January 20, 2016 Overview of Vagrant 11
Where to Find Boxes?Where to Find Boxes?
●
Hashicorp Atlas (Hashicorp Atlas (https://atlas.hashicorp.com/https://atlas.hashicorp.com/))
●
Cataloged using theCataloged using the vendor/boxnamevendor/boxname notationnotation
●
Public catalogs (Public catalogs (http://www.vagrantbox.es/http://www.vagrantbox.es/))
●
Think craigslist-- boxes may not be secureThink craigslist-- boxes may not be secure
● Build your own usingBuild your own using packerpacker oror vagrantvagrant
packagepackage
●
Installation ISO + packer + JSON config = your boxInstallation ISO + packer + JSON config = your box
●
Host on your own web serverHost on your own web server
January 20, 2016 Overview of Vagrant 12
Vagrant Lifecycle CommandsVagrant Lifecycle Commands
● vagrant upvagrant up
instantiate, provision,instantiate, provision,
start VMstart VM
● vagrant haltvagrant halt: stop: stop
/ poweroff VM/ poweroff VM
● vagrant destoryvagrant destory::
stop / delete VMstop / delete VM
● vagrant suspendvagrant suspend //
vagrant resumevagrant resume
running
powered
off
suspended
non-
existent
resumesuspend
up
halt
destroy up
January 20, 2016 Overview of Vagrant 13
Vagrant SnapshotVagrant Snapshot
●
Vagrant supports VMVagrant supports VM
snapshotssnapshots
● vagrant snapshot pushvagrant snapshot push
// poppop
● vagrant snapshot savevagrant snapshot save
// restorerestore
● vagrant snapshot listvagrant snapshot list
● vagrant snapshotvagrant snapshot
deletedelete
●
Note: do not mixNote: do not mix
push/pop andpush/pop and
save/restoresave/restore
snapshots
VM
instance
push pop
January 20, 2016 Overview of Vagrant 14
The VagrantfileThe Vagrantfile
●
Vagrantfile in project controls 'up' processVagrantfile in project controls 'up' process
●
Ruby languageRuby language
●
Located in project directory and checked into SCMLocated in project directory and checked into SCM
● vagrant upvagrant up creates .vagrant directory (add tocreates .vagrant directory (add to
.gitignore).gitignore)
●
Other Vagrantfiles are consulted duringOther Vagrantfiles are consulted during
vagrant upvagrant up (process called 'merging')(process called 'merging')
●
~/.vagrant.d/boxes/.../Vagrantfile, include/_Vagrantfile~/.vagrant.d/boxes/.../Vagrantfile, include/_Vagrantfile
●
~/.vagrant.d~/.vagrant.d
●
Vagrantfile in the project hierarchyVagrantfile in the project hierarchy
January 20, 2016 Overview of Vagrant 15
Initializing a ProjectInitializing a Project
$ cd ~/project1
$ vagrant init ubuntu/trusty32
$ vagrant up
January 20, 2016 Overview of Vagrant 16
ProvisioningProvisioning
●
ProvisioningProvisioning occursoccurs
after aafter a boxbox isis
importedimported into a VMinto a VM
●
Provisioning usuallyProvisioning usually
occurs once, but canoccurs once, but can
be run againbe run again
● vagrant provisionvagrant provision
●
Vagrantfile config.vm.provisionVagrantfile config.vm.provision
run: 'always', etc.run: 'always', etc.
...
config.vm.provision "shell",
inline: <<-SHELL
sudo apt-get update
sudo apt-get install -y
apache2
SHELL
...
January 20, 2016 Overview of Vagrant 17
Types of ProvisionersTypes of Provisioners
Name Description
file The file provisioner allows you to upload a file or directory from the host
machine to the guest machine.
shell The shell provisioner allows you to upload and execute a script within the
guest machine.
ansible,
ansible_local
The Ansible provisioner allows you to provision the guest using Ansible
playbooks by executing ansible-playbook from the Vagrant host; ansible_local
is executed on the guest machine.
cfengine The CFEngine provisioner allows you to provision the guest using CFEngine.
chef_solo,
chef_zero,
chef_client,
chef_apply
Provision with Chef 'cookbooks' and 'recipes' using a Chef Server. chef_solo
doesn't need a server and is easy to setup.
docker The docker provisioner can automatically install Docker, pull Docker
containers, and configure certain containers to run on boot.
puppet,
puppet_server
The Puppet provisioner, 'puppet' does not require a Puppet Master.
salt The salt Provisioner allows you to provision the guest using Salt states.
https://docs.vagrantup.com/v2/provisioning/index.html
January 20, 2016 Overview of Vagrant 18
Using Vagrant for Web DevelopmentUsing Vagrant for Web Development
●
Scenario:Scenario:
●
Zurb Foundation for front-end (v. 6.1.0, downloaded)Zurb Foundation for front-end (v. 6.1.0, downloaded)
●
Python Django for back-end (v. 1.9.1, not stock Ubuntu)Python Django for back-end (v. 1.9.1, not stock Ubuntu)
●
IDE on host: Sublime TextIDE on host: Sublime Text
●
Challenges:Challenges:
●
Zurb Foundation installed using npm and bootstrapped usingZurb Foundation installed using npm and bootstrapped using
CLI and Sass/CSS toolchainCLI and Sass/CSS toolchain
●
Django downloaded using pip and bootstrapped using CLIDjango downloaded using pip and bootstrapped using CLI
●
Django runs in its own Python3 virtualenvDjango runs in its own Python3 virtualenv
●
Don't forget the database!Don't forget the database!
January 20, 2016 Overview of Vagrant 19
BackgroundBackground●
Zurb FoundationZurb Foundation
●
'A front-end Framework is a collection of HTML, CSS, and JavaScript containing design patterns that'A front-end Framework is a collection of HTML, CSS, and JavaScript containing design patterns that
you can build upon. They keep you from wasting time rewriting boring, boilerplate code over and overyou can build upon. They keep you from wasting time rewriting boring, boilerplate code over and over
again.' –again.' – http://foundation.zurb.com/learn/about.htmlhttp://foundation.zurb.com/learn/about.html
●
DjangoDjango
●
'With Django, you can take Web applications from concept to launch in a matter of hours. Django takes'With Django, you can take Web applications from concept to launch in a matter of hours. Django takes
care of much of the hassle of Web development, so you can focus on writing your app without needingcare of much of the hassle of Web development, so you can focus on writing your app without needing
to reinvent the wheel. It’s free and open source.' –to reinvent the wheel. It’s free and open source.' – https://www.djangoproject.com/start/overview/https://www.djangoproject.com/start/overview/
●
BowerBower
●
'Bower can manage components that contain HTML, CSS, JavaScript, fonts or even image files. Bower'Bower can manage components that contain HTML, CSS, JavaScript, fonts or even image files. Bower
doesn’t concatenate or minify code or do anything else - it just installs the right versions of thedoesn’t concatenate or minify code or do anything else - it just installs the right versions of the
packages you need and their dependencies.' –packages you need and their dependencies.' – http://bower.io/http://bower.io/
●
npmnpm
●
'npm makes it easy for JavaScript developers to share and reuse code, and it makes it easy to update'npm makes it easy for JavaScript developers to share and reuse code, and it makes it easy to update
the code that you're sharing.' –the code that you're sharing.' – https://docs.npmjs.com/getting-started/what-is-npmhttps://docs.npmjs.com/getting-started/what-is-npm
●
pippip
●
'pip is a package management system used to install and manage software packages written in'pip is a package management system used to install and manage software packages written in
Python.' –Python.' – https://en.wikipedia.org/wiki/Pip_(package_managerhttps://en.wikipedia.org/wiki/Pip_(package_manager))
January 20, 2016 Overview of Vagrant 20
Provisioning ApproachProvisioning Approach
● Step 1:Step 1: vagrant upvagrant up
●
Import VMImport VM
●
Provision usingProvision using
AnsibleAnsible
– Install latest NodeJSInstall latest NodeJS
– Install 'step 2'Install 'step 2'
dependenciesdependencies
– Install PostgreSQLInstall PostgreSQL
– Create vagrant user inCreate vagrant user in
databasedatabase
● Step 2:Step 2: vagrantvagrant
sshssh
●
Run setup.sh scriptRun setup.sh script
– Excute 'npm install'Excute 'npm install'
and 'bower install'and 'bower install'
– 'foundation build' to'foundation build' to
build CSS from Sassbuild CSS from Sass
– Install PythonInstall Python
virtualenvvirtualenv
– Django 'migrate' DBDjango 'migrate' DB
and 'createsuperuser'and 'createsuperuser'
●
Run only one time!Run only one time!
January 20, 2016 Overview of Vagrant 21
Eliminating Step 2Eliminating Step 2
●
The 'setup.sh' script can be replaced with theThe 'setup.sh' script can be replaced with the
Ansible provisioner insteadAnsible provisioner instead
●
Advantages: can go into 'airplane mode' afterAdvantages: can go into 'airplane mode' after
provisioningprovisioning
●
Ansible package modules: pip, bower, npmAnsible package modules: pip, bower, npm
●
Bower and npm directories in a VM instanceBower and npm directories in a VM instance
directory (/home/vagrant) not project directorydirectory (/home/vagrant) not project directory
●
Modifications will be left as an exercise for theModifications will be left as an exercise for the
readerreader
January 20, 2016 Overview of Vagrant 22
Provisioning DemoProvisioning Demo
January 20, 2016 Overview of Vagrant 23
Vagrant ShareVagrant Share
●
Tunnel HTTP and SSH ports through a proxyTunnel HTTP and SSH ports through a proxy
●
Example: http://ghastly-wombat-4051.vagrantshare.comExample: http://ghastly-wombat-4051.vagrantshare.com
●
Requires account on atlas.hasicorp.comRequires account on atlas.hasicorp.com
● vagrant loginvagrant login
● vagrant sharevagrant share
●
URL can be on your domain (--domain)URL can be on your domain (--domain)
●
Share SSH sessionsShare SSH sessions
● vagrant share --sshvagrant share --ssh
● vagrant connect --sshvagrant connect --ssh
January 20, 2016 Overview of Vagrant 24
Creating BoxenCreating Boxen
January 20, 2016 Overview of Vagrant 25
Box Creation LifecycleBox Creation Lifecycle
$ packer
build
OS ISO image
1st box
$ vagrant
package
2nd box
etc...
● packerpacker
●
install from installation ISO's to temp VMinstall from installation ISO's to temp VM
● vagrant packagevagrant package
●
import from existing VM with Vagrant customizaionsimport from existing VM with Vagrant customizaions
VM
instance
$ vagrant box
add
$ vagrant up
January 20, 2016 Overview of Vagrant 26
vagrant packagevagrant package
● vagrant packagevagrant package takes an existing VM andtakes an existing VM and
outputs a re-usable .box fileoutputs a re-usable .box file
●
The .box file can be added to the repositoryThe .box file can be added to the repository
usingusing vagrant box addvagrant box add
●
It can be copied up to a web server for URLIt can be copied up to a web server for URL
distributiondistribution
●
Using existing Vagrant instance is easiest as it hasUsing existing Vagrant instance is easiest as it has
'vagrant' user, networking, VB guest additions, etc.'vagrant' user, networking, VB guest additions, etc.
$ vagrant
package
VM
instance
my_precious.box
$ vagrant box
add
January 20, 2016 Overview of Vagrant 27
PackerPacker
● packerpacker is a tool to create Vagrant boxes fromis a tool to create Vagrant boxes from
bare metal virtual machinesbare metal virtual machines
●
https://www.packer.io/https://www.packer.io/
●
Packer templates are JSON files:Packer templates are JSON files:
●
Chef / bento:Chef / bento: https://github.com/chef/bentohttps://github.com/chef/bento
– used internally by Chef to build base boxesused internally by Chef to build base boxes
●
Boxcutter:Boxcutter: https://github.com/boxcutterhttps://github.com/boxcutter
– community-driven templates that are CM tool-agnosticcommunity-driven templates that are CM tool-agnostic
$ packer
build
OS ISO image my_precious.box
January 20, 2016 Overview of Vagrant 28
Hashicorp AtlasHashicorp Atlas
Boxes can be built in the cloud using templates pushed up by packer. For example,
need to build a box for VMWare desktop but you don't have VMWare? Not a
problem. See http://atlas.hashicorp.com for more information.
January 20, 2016 Overview of Vagrant 29
Box VersioningBox Versioning
●
Boxes may be versioned usingBoxes may be versioned using semanticsemantic
versioningversioning (e.g. 1.0.9)(e.g. 1.0.9)
●
Versioning is default for Atlas hosted boxesVersioning is default for Atlas hosted boxes
●
NoteNote vendor/boxnamevendor/boxname conventionconvention
●
For self-hosted boxes, couple of choices...For self-hosted boxes, couple of choices...
●
No versioning, use naming convention instead inNo versioning, use naming convention instead in
vagrant box addvagrant box add (e.g. 'django-v1.0.0')(e.g. 'django-v1.0.0')
●
Yes versioning, use 'metadata.json' versioningYes versioning, use 'metadata.json' versioning
control in Vagrantcontrol in Vagrant
January 20, 2016 Overview of Vagrant 30
Self-hosted VersioningSelf-hosted Versioning
●
Generate and hostGenerate and host
metadata.json yourselfmetadata.json yourself
●
Nice tool to gen jsonNice tool to gen json
●
pip install vagrant-metadatapip install vagrant-metadata
●
Upload to web orUpload to web or
network sharenetwork share
●
Using box:Using box:
● vagrant initvagrant init
cperez/djsitecperez/djsite
http://localhost/boxes/djsite/metadata.jsonhttp://localhost/boxes/djsite/metadata.json
● Upgrading:Upgrading: vagrantvagrant
box updatebox update
{
"name": "cperez/djsite",
"description": "Django box",
"baseurl":
"http://localhost/boxes/djsite",
"versions": [
{
"version": "1.0.0",
"providers": [
{
"name": "virtualbox",
"checksum_type":
"sha1",
"checksum":
"5bb7c7580712a547a7f30da920c2fb1e2430f904"
,
"url":
"http://localhost/boxes/djsite/1.0.0/virtu
albox/djsite-1.0.0.box"
}
]
}
]
}
January 20, 2016 Overview of Vagrant 31
Provisioning vs. PackagingProvisioning vs. Packaging
●
Best to take a base box, provision it, and thenBest to take a base box, provision it, and then
'freeze' it using'freeze' it using vagrant packagevagrant package
● speeds upspeeds up vagrant destroyvagrant destroy // vagrant upvagrant up
cyclecycle
●
can include a Vagrantfile with the box with preferredcan include a Vagrantfile with the box with preferred
settings (such as networking and port forwards)settings (such as networking and port forwards)
●
Nice recipes:Nice recipes:
– https://github.com/pro-vagranthttps://github.com/pro-vagrant
●
Best to keep box packaging scripts in separateBest to keep box packaging scripts in separate
directorydirectory
January 20, 2016 Overview of Vagrant 32
Multiple MachinesMultiple Machines
●
Mulit-machine can beMulit-machine can be
specified inspecified in
VagrantfileVagrantfile
●
Name each machineName each machine
● vagrant ssh webvagrant ssh web
●
Networking optionsNetworking options
allow for machine toallow for machine to
machinemachine
communicationscommunications
Vagrant.configure("2") do |config|
config.vm.provision "shell", inline:
"echo Hello"
config.vm.define "web" do |web|
web.vm.box = "apache"
end
config.vm.define "db" do |db|
db.vm.box = "mysql"
end
end
January 20, 2016 Overview of Vagrant 33
Vagrant SecurityVagrant Security
●
By default, Vagrant boxes areBy default, Vagrant boxes are insecureinsecure
●
For local development, not productionFor local development, not production
●
Keep your box behind a firewall, not on Internet!Keep your box behind a firewall, not on Internet!
●
Public boxes contain the 'insecure private key'Public boxes contain the 'insecure private key'
●
https://github.com/mitchellh/vagrant/tree/master/keyshttps://github.com/mitchellh/vagrant/tree/master/keys
●
Default password is 'vagrant'Default password is 'vagrant'
● OnOn vagrant upvagrant up, the insecure key is replaced with a, the insecure key is replaced with a
local 'insecure key'local 'insecure key'
● vagrant packagevagrant package may create box with newmay create box with new
vagrant_private_keyvagrant_private_key
January 20, 2016 Overview of Vagrant 34
Other TipsOther Tips
●
Unix vs. DOS line feeds, confuses shell and file provisioners. Standardize onUnix vs. DOS line feeds, confuses shell and file provisioners. Standardize on
Unix line endings (LF) in your IDE's.Unix line endings (LF) in your IDE's.
●
C++ developers: cannot execute built binaries from /vagrant mount? Copy toC++ developers: cannot execute built binaries from /vagrant mount? Copy to
/home/vagrant./home/vagrant.
●
Running FreeBSD and the nfs folder sync doesn't work because your homeRunning FreeBSD and the nfs folder sync doesn't work because your home
directory is encrypted? Try 'rsync' option for folder syncing.directory is encrypted? Try 'rsync' option for folder syncing.
●
Box versioning: best to specify a version in Vagrantfile rather thanBox versioning: best to specify a version in Vagrantfile rather than
downloading latest base box.downloading latest base box.
●
Ubuntu guest: remove 'mesg n' in /root/.profile to eliminate annoying 'default:Ubuntu guest: remove 'mesg n' in /root/.profile to eliminate annoying 'default:
stdin: is not a tty' message when using shell provisioner.stdin: is not a tty' message when using shell provisioner.
January 20, 2016 Overview of Vagrant 35
Thank You!Thank You!
●
Sample Vagrant project with Django andSample Vagrant project with Django and
Foundation:Foundation:
https://github.com/coloradocarlos/djfoundation1https://github.com/coloradocarlos/djfoundation1
●
Contact: perez@doorstep.comContact: perez@doorstep.com

More Related Content

What's hot

Vagrant for Virtualized Development
Vagrant for Virtualized DevelopmentVagrant for Virtualized Development
Vagrant for Virtualized DevelopmentAdam Culp
 
Vagrant + Docker provider [+Puppet]
Vagrant + Docker provider [+Puppet]Vagrant + Docker provider [+Puppet]
Vagrant + Docker provider [+Puppet]Nicolas Poggi
 
Vagrant vs Docker
Vagrant vs DockerVagrant vs Docker
Vagrant vs Dockerjchase50
 
Vagrant + Ansible + Docker
Vagrant + Ansible + DockerVagrant + Ansible + Docker
Vagrant + Ansible + DockerVijay Selvaraj
 
Automated Infrastructure and Application Management
Automated Infrastructure and Application ManagementAutomated Infrastructure and Application Management
Automated Infrastructure and Application ManagementClark Everetts
 
Using Docker with Puppet - PuppetConf 2014
Using Docker with Puppet - PuppetConf 2014Using Docker with Puppet - PuppetConf 2014
Using Docker with Puppet - PuppetConf 2014Puppet
 
Locally it worked! virtualizing docker
Locally it worked! virtualizing dockerLocally it worked! virtualizing docker
Locally it worked! virtualizing dockerSascha Brinkmann
 
Node4J: Running Node.js in a JavaWorld
Node4J: Running Node.js in a JavaWorldNode4J: Running Node.js in a JavaWorld
Node4J: Running Node.js in a JavaWorldIan Bull
 
An Introduction to Vagrant and Docker
An Introduction to Vagrant and DockerAn Introduction to Vagrant and Docker
An Introduction to Vagrant and DockerScott Lowe
 
Docker and Puppet for Continuous Integration
Docker and Puppet for Continuous IntegrationDocker and Puppet for Continuous Integration
Docker and Puppet for Continuous IntegrationGiacomo Vacca
 
Drone your Ansible
Drone your AnsibleDrone your Ansible
Drone your AnsibleDennis Rowe
 
Oscar: Rapid Iteration with Vagrant and Puppet Enterprise - PuppetConf 2013
Oscar: Rapid Iteration with Vagrant and Puppet Enterprise - PuppetConf 2013Oscar: Rapid Iteration with Vagrant and Puppet Enterprise - PuppetConf 2013
Oscar: Rapid Iteration with Vagrant and Puppet Enterprise - PuppetConf 2013Puppet
 
Getting Started with Docker (For Developers)
Getting Started with Docker (For Developers)Getting Started with Docker (For Developers)
Getting Started with Docker (For Developers)ColdFusionConference
 
Web Applications with Eclipse RT and Docker in the Cloud
Web Applications with Eclipse RT and Docker in the CloudWeb Applications with Eclipse RT and Docker in the Cloud
Web Applications with Eclipse RT and Docker in the CloudMarkus Knauer
 
Package Management on Windows with Chocolatey
Package Management on Windows with ChocolateyPackage Management on Windows with Chocolatey
Package Management on Windows with ChocolateyPuppet
 

What's hot (20)

Vagrant for Virtualized Development
Vagrant for Virtualized DevelopmentVagrant for Virtualized Development
Vagrant for Virtualized Development
 
Vagrant + Docker provider [+Puppet]
Vagrant + Docker provider [+Puppet]Vagrant + Docker provider [+Puppet]
Vagrant + Docker provider [+Puppet]
 
Vagrant + Docker
Vagrant + DockerVagrant + Docker
Vagrant + Docker
 
Introduction to Vagrant
Introduction to VagrantIntroduction to Vagrant
Introduction to Vagrant
 
Vagrant vs Docker
Vagrant vs DockerVagrant vs Docker
Vagrant vs Docker
 
Vagrant + Ansible + Docker
Vagrant + Ansible + DockerVagrant + Ansible + Docker
Vagrant + Ansible + Docker
 
GlassFish Embedded API
GlassFish Embedded APIGlassFish Embedded API
GlassFish Embedded API
 
Automated Infrastructure and Application Management
Automated Infrastructure and Application ManagementAutomated Infrastructure and Application Management
Automated Infrastructure and Application Management
 
Intro to vagrant
Intro to vagrantIntro to vagrant
Intro to vagrant
 
Vagrant and CentOS 7
Vagrant and CentOS 7Vagrant and CentOS 7
Vagrant and CentOS 7
 
Using Docker with Puppet - PuppetConf 2014
Using Docker with Puppet - PuppetConf 2014Using Docker with Puppet - PuppetConf 2014
Using Docker with Puppet - PuppetConf 2014
 
Locally it worked! virtualizing docker
Locally it worked! virtualizing dockerLocally it worked! virtualizing docker
Locally it worked! virtualizing docker
 
Node4J: Running Node.js in a JavaWorld
Node4J: Running Node.js in a JavaWorldNode4J: Running Node.js in a JavaWorld
Node4J: Running Node.js in a JavaWorld
 
An Introduction to Vagrant and Docker
An Introduction to Vagrant and DockerAn Introduction to Vagrant and Docker
An Introduction to Vagrant and Docker
 
Docker and Puppet for Continuous Integration
Docker and Puppet for Continuous IntegrationDocker and Puppet for Continuous Integration
Docker and Puppet for Continuous Integration
 
Drone your Ansible
Drone your AnsibleDrone your Ansible
Drone your Ansible
 
Oscar: Rapid Iteration with Vagrant and Puppet Enterprise - PuppetConf 2013
Oscar: Rapid Iteration with Vagrant and Puppet Enterprise - PuppetConf 2013Oscar: Rapid Iteration with Vagrant and Puppet Enterprise - PuppetConf 2013
Oscar: Rapid Iteration with Vagrant and Puppet Enterprise - PuppetConf 2013
 
Getting Started with Docker (For Developers)
Getting Started with Docker (For Developers)Getting Started with Docker (For Developers)
Getting Started with Docker (For Developers)
 
Web Applications with Eclipse RT and Docker in the Cloud
Web Applications with Eclipse RT and Docker in the CloudWeb Applications with Eclipse RT and Docker in the Cloud
Web Applications with Eclipse RT and Docker in the Cloud
 
Package Management on Windows with Chocolatey
Package Management on Windows with ChocolateyPackage Management on Windows with Chocolatey
Package Management on Windows with Chocolatey
 

Similar to Vagrant for Software Development

Vagrant are you still develop in a non-virtual environment-
Vagrant  are you still develop in a non-virtual environment-Vagrant  are you still develop in a non-virtual environment-
Vagrant are you still develop in a non-virtual environment-Anatoly Bubenkov
 
Take Home Your Very Own Free Vagrant CFML Dev Environment
Take Home Your Very Own Free Vagrant CFML Dev Environment Take Home Your Very Own Free Vagrant CFML Dev Environment
Take Home Your Very Own Free Vagrant CFML Dev Environment ColdFusionConference
 
Take home your very own free Vagrant CFML Dev Environment - Presented at dev....
Take home your very own free Vagrant CFML Dev Environment - Presented at dev....Take home your very own free Vagrant CFML Dev Environment - Presented at dev....
Take home your very own free Vagrant CFML Dev Environment - Presented at dev....Gavin Pickin
 
AtoM and Vagrant: Installing and Configuring the AtoM Vagrant Box for Local T...
AtoM and Vagrant: Installing and Configuring the AtoM Vagrant Box for Local T...AtoM and Vagrant: Installing and Configuring the AtoM Vagrant Box for Local T...
AtoM and Vagrant: Installing and Configuring the AtoM Vagrant Box for Local T...Artefactual Systems - AtoM
 
DevOps: Using Vagrant to Enhance Your Day to Day Development
DevOps: Using Vagrant to Enhance Your Day to Day DevelopmentDevOps: Using Vagrant to Enhance Your Day to Day Development
DevOps: Using Vagrant to Enhance Your Day to Day DevelopmentRob Reynolds
 
Node.js, Vagrant, Chef, and Mathoid @ Benetech
Node.js, Vagrant, Chef, and Mathoid @ BenetechNode.js, Vagrant, Chef, and Mathoid @ Benetech
Node.js, Vagrant, Chef, and Mathoid @ BenetechChristopher Bumgardner
 
Vagrant workshop 2015
Vagrant workshop 2015Vagrant workshop 2015
Vagrant workshop 2015Haifa Ftirich
 
Vagrant Workshop
Vagrant WorkshopVagrant Workshop
Vagrant Workshopsys army
 
Continuous Delivery w projekcie Open Source - Marcin Stachniuk - DevCrowd 2017
Continuous Delivery w projekcie Open Source - Marcin Stachniuk - DevCrowd 2017Continuous Delivery w projekcie Open Source - Marcin Stachniuk - DevCrowd 2017
Continuous Delivery w projekcie Open Source - Marcin Stachniuk - DevCrowd 2017MarcinStachniuk
 
Vagrant for local and team WordPress Development
Vagrant for local and team WordPress DevelopmentVagrant for local and team WordPress Development
Vagrant for local and team WordPress DevelopmentAnthony Alvarez
 
Vagrant 101 Workshop
Vagrant 101 WorkshopVagrant 101 Workshop
Vagrant 101 WorkshopLiora Milbaum
 
Vagrant - Version control your dev environment
Vagrant - Version control your dev environmentVagrant - Version control your dev environment
Vagrant - Version control your dev environmentbocribbz
 
Dev/Stage/Prod Parity with Vagrant
Dev/Stage/Prod Parity with VagrantDev/Stage/Prod Parity with Vagrant
Dev/Stage/Prod Parity with VagrantMike Bybee
 
Automating with ansible (Part B)
Automating with ansible (Part B)Automating with ansible (Part B)
Automating with ansible (Part B)iman darabi
 
DevOps Camp 2017 NYC Local Development using Vagrant by Anthony Alvarez
DevOps Camp 2017 NYC Local Development using Vagrant by Anthony AlvarezDevOps Camp 2017 NYC Local Development using Vagrant by Anthony Alvarez
DevOps Camp 2017 NYC Local Development using Vagrant by Anthony AlvarezAnthony Alvarez
 
Vagrant - Team Development made easy
Vagrant - Team Development made easyVagrant - Team Development made easy
Vagrant - Team Development made easyMarco Silva
 
Django & Buildout (en)
Django & Buildout (en)Django & Buildout (en)
Django & Buildout (en)zerok
 

Similar to Vagrant for Software Development (20)

Vagrant are you still develop in a non-virtual environment-
Vagrant  are you still develop in a non-virtual environment-Vagrant  are you still develop in a non-virtual environment-
Vagrant are you still develop in a non-virtual environment-
 
Take Home Your Very Own Free Vagrant CFML Dev Environment
Take Home Your Very Own Free Vagrant CFML Dev Environment Take Home Your Very Own Free Vagrant CFML Dev Environment
Take Home Your Very Own Free Vagrant CFML Dev Environment
 
Take home your very own free Vagrant CFML Dev Environment - Presented at dev....
Take home your very own free Vagrant CFML Dev Environment - Presented at dev....Take home your very own free Vagrant CFML Dev Environment - Presented at dev....
Take home your very own free Vagrant CFML Dev Environment - Presented at dev....
 
AtoM and Vagrant: Installing and Configuring the AtoM Vagrant Box for Local T...
AtoM and Vagrant: Installing and Configuring the AtoM Vagrant Box for Local T...AtoM and Vagrant: Installing and Configuring the AtoM Vagrant Box for Local T...
AtoM and Vagrant: Installing and Configuring the AtoM Vagrant Box for Local T...
 
Keep calm and vagrant up
Keep calm and vagrant upKeep calm and vagrant up
Keep calm and vagrant up
 
DevOps: Using Vagrant to Enhance Your Day to Day Development
DevOps: Using Vagrant to Enhance Your Day to Day DevelopmentDevOps: Using Vagrant to Enhance Your Day to Day Development
DevOps: Using Vagrant to Enhance Your Day to Day Development
 
Node.js, Vagrant, Chef, and Mathoid @ Benetech
Node.js, Vagrant, Chef, and Mathoid @ BenetechNode.js, Vagrant, Chef, and Mathoid @ Benetech
Node.js, Vagrant, Chef, and Mathoid @ Benetech
 
Vagrant workshop 2015
Vagrant workshop 2015Vagrant workshop 2015
Vagrant workshop 2015
 
Skyfall b sides-c00-l-ed5-sp-2013
Skyfall b sides-c00-l-ed5-sp-2013Skyfall b sides-c00-l-ed5-sp-2013
Skyfall b sides-c00-l-ed5-sp-2013
 
Vagrant Workshop
Vagrant WorkshopVagrant Workshop
Vagrant Workshop
 
Continuous Delivery w projekcie Open Source - Marcin Stachniuk - DevCrowd 2017
Continuous Delivery w projekcie Open Source - Marcin Stachniuk - DevCrowd 2017Continuous Delivery w projekcie Open Source - Marcin Stachniuk - DevCrowd 2017
Continuous Delivery w projekcie Open Source - Marcin Stachniuk - DevCrowd 2017
 
V for vagrant
V for vagrantV for vagrant
V for vagrant
 
Vagrant for local and team WordPress Development
Vagrant for local and team WordPress DevelopmentVagrant for local and team WordPress Development
Vagrant for local and team WordPress Development
 
Vagrant 101 Workshop
Vagrant 101 WorkshopVagrant 101 Workshop
Vagrant 101 Workshop
 
Vagrant - Version control your dev environment
Vagrant - Version control your dev environmentVagrant - Version control your dev environment
Vagrant - Version control your dev environment
 
Dev/Stage/Prod Parity with Vagrant
Dev/Stage/Prod Parity with VagrantDev/Stage/Prod Parity with Vagrant
Dev/Stage/Prod Parity with Vagrant
 
Automating with ansible (Part B)
Automating with ansible (Part B)Automating with ansible (Part B)
Automating with ansible (Part B)
 
DevOps Camp 2017 NYC Local Development using Vagrant by Anthony Alvarez
DevOps Camp 2017 NYC Local Development using Vagrant by Anthony AlvarezDevOps Camp 2017 NYC Local Development using Vagrant by Anthony Alvarez
DevOps Camp 2017 NYC Local Development using Vagrant by Anthony Alvarez
 
Vagrant - Team Development made easy
Vagrant - Team Development made easyVagrant - Team Development made easy
Vagrant - Team Development made easy
 
Django & Buildout (en)
Django & Buildout (en)Django & Buildout (en)
Django & Buildout (en)
 

Recently uploaded

Amazon Bedrock in Action - presentation of the Bedrock's capabilities
Amazon Bedrock in Action - presentation of the Bedrock's capabilitiesAmazon Bedrock in Action - presentation of the Bedrock's capabilities
Amazon Bedrock in Action - presentation of the Bedrock's capabilitiesKrzysztofKkol1
 
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptxReal-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptxRTS corp
 
SoftTeco - Software Development Company Profile
SoftTeco - Software Development Company ProfileSoftTeco - Software Development Company Profile
SoftTeco - Software Development Company Profileakrivarotava
 
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...Angel Borroy López
 
Effectively Troubleshoot 9 Types of OutOfMemoryError
Effectively Troubleshoot 9 Types of OutOfMemoryErrorEffectively Troubleshoot 9 Types of OutOfMemoryError
Effectively Troubleshoot 9 Types of OutOfMemoryErrorTier1 app
 
Powering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data StreamsPowering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data StreamsSafe Software
 
Comparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdfComparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdfDrew Moseley
 
Precise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive GoalPrecise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive GoalLionel Briand
 
UI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptxUI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptxAndreas Kunz
 
A healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfA healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfMarharyta Nedzelska
 
SensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving CarsSensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving CarsChristian Birchler
 
Keeping your build tool updated in a multi repository world
Keeping your build tool updated in a multi repository worldKeeping your build tool updated in a multi repository world
Keeping your build tool updated in a multi repository worldRoberto Pérez Alcolea
 
Strategies for using alternative queries to mitigate zero results
Strategies for using alternative queries to mitigate zero resultsStrategies for using alternative queries to mitigate zero results
Strategies for using alternative queries to mitigate zero resultsJean Silva
 
Large Language Models for Test Case Evolution and Repair
Large Language Models for Test Case Evolution and RepairLarge Language Models for Test Case Evolution and Repair
Large Language Models for Test Case Evolution and RepairLionel Briand
 
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdf
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdfExploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdf
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdfkalichargn70th171
 
Not a Kubernetes fan? The state of PaaS in 2024
Not a Kubernetes fan? The state of PaaS in 2024Not a Kubernetes fan? The state of PaaS in 2024
Not a Kubernetes fan? The state of PaaS in 2024Anthony Dahanne
 
Enhancing Supply Chain Visibility with Cargo Cloud Solutions.pdf
Enhancing Supply Chain Visibility with Cargo Cloud Solutions.pdfEnhancing Supply Chain Visibility with Cargo Cloud Solutions.pdf
Enhancing Supply Chain Visibility with Cargo Cloud Solutions.pdfRTS corp
 
SAM Training Session - How to use EXCEL ?
SAM Training Session - How to use EXCEL ?SAM Training Session - How to use EXCEL ?
SAM Training Session - How to use EXCEL ?Alexandre Beguel
 
eSoftTools IMAP Backup Software and migration tools
eSoftTools IMAP Backup Software and migration toolseSoftTools IMAP Backup Software and migration tools
eSoftTools IMAP Backup Software and migration toolsosttopstonverter
 
OpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full Recording
OpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full RecordingOpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full Recording
OpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full RecordingShane Coughlan
 

Recently uploaded (20)

Amazon Bedrock in Action - presentation of the Bedrock's capabilities
Amazon Bedrock in Action - presentation of the Bedrock's capabilitiesAmazon Bedrock in Action - presentation of the Bedrock's capabilities
Amazon Bedrock in Action - presentation of the Bedrock's capabilities
 
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptxReal-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
 
SoftTeco - Software Development Company Profile
SoftTeco - Software Development Company ProfileSoftTeco - Software Development Company Profile
SoftTeco - Software Development Company Profile
 
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
 
Effectively Troubleshoot 9 Types of OutOfMemoryError
Effectively Troubleshoot 9 Types of OutOfMemoryErrorEffectively Troubleshoot 9 Types of OutOfMemoryError
Effectively Troubleshoot 9 Types of OutOfMemoryError
 
Powering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data StreamsPowering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data Streams
 
Comparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdfComparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdf
 
Precise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive GoalPrecise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive Goal
 
UI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptxUI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptx
 
A healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfA healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdf
 
SensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving CarsSensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving Cars
 
Keeping your build tool updated in a multi repository world
Keeping your build tool updated in a multi repository worldKeeping your build tool updated in a multi repository world
Keeping your build tool updated in a multi repository world
 
Strategies for using alternative queries to mitigate zero results
Strategies for using alternative queries to mitigate zero resultsStrategies for using alternative queries to mitigate zero results
Strategies for using alternative queries to mitigate zero results
 
Large Language Models for Test Case Evolution and Repair
Large Language Models for Test Case Evolution and RepairLarge Language Models for Test Case Evolution and Repair
Large Language Models for Test Case Evolution and Repair
 
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdf
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdfExploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdf
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdf
 
Not a Kubernetes fan? The state of PaaS in 2024
Not a Kubernetes fan? The state of PaaS in 2024Not a Kubernetes fan? The state of PaaS in 2024
Not a Kubernetes fan? The state of PaaS in 2024
 
Enhancing Supply Chain Visibility with Cargo Cloud Solutions.pdf
Enhancing Supply Chain Visibility with Cargo Cloud Solutions.pdfEnhancing Supply Chain Visibility with Cargo Cloud Solutions.pdf
Enhancing Supply Chain Visibility with Cargo Cloud Solutions.pdf
 
SAM Training Session - How to use EXCEL ?
SAM Training Session - How to use EXCEL ?SAM Training Session - How to use EXCEL ?
SAM Training Session - How to use EXCEL ?
 
eSoftTools IMAP Backup Software and migration tools
eSoftTools IMAP Backup Software and migration toolseSoftTools IMAP Backup Software and migration tools
eSoftTools IMAP Backup Software and migration tools
 
OpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full Recording
OpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full RecordingOpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full Recording
OpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full Recording
 

Vagrant for Software Development

  • 1. It Works on My Machine:It Works on My Machine: Vagrant for Software DevelopmentVagrant for Software Development Colorado Springs Open Source Software MeetupColorado Springs Open Source Software Meetup 1/20/20161/20/2016 Carlos PerezCarlos Perez perez@doorstep.comperez@doorstep.com
  • 2. January 20, 2016 Overview of Vagrant 2 Traditional Dev. EnvironmentTraditional Dev. Environment SCM / CI Dev. 1 w/ app stack Mac OS X Test / Stage /Prod Dev. 2 w/ app stack Linux Ubuntu Dev. 3 w/ app stack MS Windows Dev. 4 w/ app stack Everyone has their own application stack and machine dependencies. This is known as the 'works on my machine' problem.
  • 3. January 20, 2016 Overview of Vagrant 3 Source: TIOBE Index for January 2016 http://www.tiobe.com/index.php/content/paperinfo/tpci/index.html TIOBE Index of Popular Programming Languages
  • 4. January 20, 2016 Overview of Vagrant 4 Why Use Vagrant?Why Use Vagrant? ● SOLUTION: Have everyone work on the 'sameSOLUTION: Have everyone work on the 'same machine' bymachine' by declaratively specifying thedeclaratively specifying the configuration for a VM instanceconfiguration for a VM instance ● Based on virtual machines you already knowBased on virtual machines you already know (VirtualBox, VMWare, Hyper-V, etc.)(VirtualBox, VMWare, Hyper-V, etc.) ● Easy to configure, reproducible, portableEasy to configure, reproducible, portable ● SCM friendly files (git, tfvc)SCM friendly files (git, tfvc) ● DevOps friendly: write and test provisioningDevOps friendly: write and test provisioning 'scripts' (Chef, Puppet, Ansible, etc.)'scripts' (Chef, Puppet, Ansible, etc.)
  • 5. January 20, 2016 Overview of Vagrant 5 Vagrant ArchitectureVagrant Architecture VM Host OS Guest OS: CentOS /home/user1/projects/web1 => /vagrant Web Browser IDE / Editor git Apache PHP MySQL port 2222 => 22; port 8000 => 80 Virtualbox port forwards synced folders
  • 6. January 20, 2016 Overview of Vagrant 6 Basic DemoBasic Demo
  • 7. January 20, 2016 Overview of Vagrant 7 VagrantVagrant ● Open source, started in 2010 by MitchellOpen source, started in 2010 by Mitchell HashimotoHashimoto ● MIT LicenseMIT License ● Website:Website: https://www.vagrantup.comhttps://www.vagrantup.com ● Docs:Docs: https://docs.vagrantup.com/v2/https://docs.vagrantup.com/v2/ ● Installation:Installation: ● Vagrant (apt-get, .deb, .dmg, .msi)Vagrant (apt-get, .deb, .dmg, .msi) ● VM (VM (https://www.virtualbox.orghttps://www.virtualbox.org)) ● Windows: PuTTY, PuTTYgenWindows: PuTTY, PuTTYgen
  • 8. January 20, 2016 Overview of Vagrant 8 TerminologyTerminology ● BoxBox: VM base image for: VM base image for guestguest (a.k.a.(a.k.a. templatetemplate)) ● ProviderProvider: virtualization layer on: virtualization layer on hosthost (VirtualBox, VMWare, etc.)(VirtualBox, VMWare, etc.) ● ProvisionerProvisioner: system for automating software: system for automating software installations (shell, chef, etc.)installations (shell, chef, etc.) ● ProjectProject: directory containing Vagrantfile and: directory containing Vagrantfile and typically the root of the 'synced folder'typically the root of the 'synced folder'
  • 9. January 20, 2016 Overview of Vagrant 9 Basic CommandsBasic Commands ● vagrant –helpvagrant –help ● vagrant global-statusvagrant global-status: show: show environmentsenvironments ● vagrant statusvagrant status: show project status: show project status ● vagrant box listvagrant box list: show installed boxes: show installed boxes
  • 10. January 20, 2016 Overview of Vagrant 10 Vagrant Up FlowVagrant Up Flow A Box repository download B Local box directory C VM instance directory import 1) vagrant up 2) If box does not exist, download from 'A' and add to 'B' 3) If VM does not exist, import from local box directory 'B' and copy to 'C' 4) Start VM, networking, port forwards, import SSH keys 5) Mount shared folders 6) Provision VM 7) vagrant ssh https://atlas.hashicorp.com/ubuntu/boxes/trusty32/versions/20151218.0.1/ provider/virtualbox.box ~/.vagrant.d/boxes/ubuntu-VAGRANTSLASH-trusty32 ~/VirtualBox VMs/trusty32_default_1452718546328_49107
  • 11. January 20, 2016 Overview of Vagrant 11 Where to Find Boxes?Where to Find Boxes? ● Hashicorp Atlas (Hashicorp Atlas (https://atlas.hashicorp.com/https://atlas.hashicorp.com/)) ● Cataloged using theCataloged using the vendor/boxnamevendor/boxname notationnotation ● Public catalogs (Public catalogs (http://www.vagrantbox.es/http://www.vagrantbox.es/)) ● Think craigslist-- boxes may not be secureThink craigslist-- boxes may not be secure ● Build your own usingBuild your own using packerpacker oror vagrantvagrant packagepackage ● Installation ISO + packer + JSON config = your boxInstallation ISO + packer + JSON config = your box ● Host on your own web serverHost on your own web server
  • 12. January 20, 2016 Overview of Vagrant 12 Vagrant Lifecycle CommandsVagrant Lifecycle Commands ● vagrant upvagrant up instantiate, provision,instantiate, provision, start VMstart VM ● vagrant haltvagrant halt: stop: stop / poweroff VM/ poweroff VM ● vagrant destoryvagrant destory:: stop / delete VMstop / delete VM ● vagrant suspendvagrant suspend // vagrant resumevagrant resume running powered off suspended non- existent resumesuspend up halt destroy up
  • 13. January 20, 2016 Overview of Vagrant 13 Vagrant SnapshotVagrant Snapshot ● Vagrant supports VMVagrant supports VM snapshotssnapshots ● vagrant snapshot pushvagrant snapshot push // poppop ● vagrant snapshot savevagrant snapshot save // restorerestore ● vagrant snapshot listvagrant snapshot list ● vagrant snapshotvagrant snapshot deletedelete ● Note: do not mixNote: do not mix push/pop andpush/pop and save/restoresave/restore snapshots VM instance push pop
  • 14. January 20, 2016 Overview of Vagrant 14 The VagrantfileThe Vagrantfile ● Vagrantfile in project controls 'up' processVagrantfile in project controls 'up' process ● Ruby languageRuby language ● Located in project directory and checked into SCMLocated in project directory and checked into SCM ● vagrant upvagrant up creates .vagrant directory (add tocreates .vagrant directory (add to .gitignore).gitignore) ● Other Vagrantfiles are consulted duringOther Vagrantfiles are consulted during vagrant upvagrant up (process called 'merging')(process called 'merging') ● ~/.vagrant.d/boxes/.../Vagrantfile, include/_Vagrantfile~/.vagrant.d/boxes/.../Vagrantfile, include/_Vagrantfile ● ~/.vagrant.d~/.vagrant.d ● Vagrantfile in the project hierarchyVagrantfile in the project hierarchy
  • 15. January 20, 2016 Overview of Vagrant 15 Initializing a ProjectInitializing a Project $ cd ~/project1 $ vagrant init ubuntu/trusty32 $ vagrant up
  • 16. January 20, 2016 Overview of Vagrant 16 ProvisioningProvisioning ● ProvisioningProvisioning occursoccurs after aafter a boxbox isis importedimported into a VMinto a VM ● Provisioning usuallyProvisioning usually occurs once, but canoccurs once, but can be run againbe run again ● vagrant provisionvagrant provision ● Vagrantfile config.vm.provisionVagrantfile config.vm.provision run: 'always', etc.run: 'always', etc. ... config.vm.provision "shell", inline: <<-SHELL sudo apt-get update sudo apt-get install -y apache2 SHELL ...
  • 17. January 20, 2016 Overview of Vagrant 17 Types of ProvisionersTypes of Provisioners Name Description file The file provisioner allows you to upload a file or directory from the host machine to the guest machine. shell The shell provisioner allows you to upload and execute a script within the guest machine. ansible, ansible_local The Ansible provisioner allows you to provision the guest using Ansible playbooks by executing ansible-playbook from the Vagrant host; ansible_local is executed on the guest machine. cfengine The CFEngine provisioner allows you to provision the guest using CFEngine. chef_solo, chef_zero, chef_client, chef_apply Provision with Chef 'cookbooks' and 'recipes' using a Chef Server. chef_solo doesn't need a server and is easy to setup. docker The docker provisioner can automatically install Docker, pull Docker containers, and configure certain containers to run on boot. puppet, puppet_server The Puppet provisioner, 'puppet' does not require a Puppet Master. salt The salt Provisioner allows you to provision the guest using Salt states. https://docs.vagrantup.com/v2/provisioning/index.html
  • 18. January 20, 2016 Overview of Vagrant 18 Using Vagrant for Web DevelopmentUsing Vagrant for Web Development ● Scenario:Scenario: ● Zurb Foundation for front-end (v. 6.1.0, downloaded)Zurb Foundation for front-end (v. 6.1.0, downloaded) ● Python Django for back-end (v. 1.9.1, not stock Ubuntu)Python Django for back-end (v. 1.9.1, not stock Ubuntu) ● IDE on host: Sublime TextIDE on host: Sublime Text ● Challenges:Challenges: ● Zurb Foundation installed using npm and bootstrapped usingZurb Foundation installed using npm and bootstrapped using CLI and Sass/CSS toolchainCLI and Sass/CSS toolchain ● Django downloaded using pip and bootstrapped using CLIDjango downloaded using pip and bootstrapped using CLI ● Django runs in its own Python3 virtualenvDjango runs in its own Python3 virtualenv ● Don't forget the database!Don't forget the database!
  • 19. January 20, 2016 Overview of Vagrant 19 BackgroundBackground● Zurb FoundationZurb Foundation ● 'A front-end Framework is a collection of HTML, CSS, and JavaScript containing design patterns that'A front-end Framework is a collection of HTML, CSS, and JavaScript containing design patterns that you can build upon. They keep you from wasting time rewriting boring, boilerplate code over and overyou can build upon. They keep you from wasting time rewriting boring, boilerplate code over and over again.' –again.' – http://foundation.zurb.com/learn/about.htmlhttp://foundation.zurb.com/learn/about.html ● DjangoDjango ● 'With Django, you can take Web applications from concept to launch in a matter of hours. Django takes'With Django, you can take Web applications from concept to launch in a matter of hours. Django takes care of much of the hassle of Web development, so you can focus on writing your app without needingcare of much of the hassle of Web development, so you can focus on writing your app without needing to reinvent the wheel. It’s free and open source.' –to reinvent the wheel. It’s free and open source.' – https://www.djangoproject.com/start/overview/https://www.djangoproject.com/start/overview/ ● BowerBower ● 'Bower can manage components that contain HTML, CSS, JavaScript, fonts or even image files. Bower'Bower can manage components that contain HTML, CSS, JavaScript, fonts or even image files. Bower doesn’t concatenate or minify code or do anything else - it just installs the right versions of thedoesn’t concatenate or minify code or do anything else - it just installs the right versions of the packages you need and their dependencies.' –packages you need and their dependencies.' – http://bower.io/http://bower.io/ ● npmnpm ● 'npm makes it easy for JavaScript developers to share and reuse code, and it makes it easy to update'npm makes it easy for JavaScript developers to share and reuse code, and it makes it easy to update the code that you're sharing.' –the code that you're sharing.' – https://docs.npmjs.com/getting-started/what-is-npmhttps://docs.npmjs.com/getting-started/what-is-npm ● pippip ● 'pip is a package management system used to install and manage software packages written in'pip is a package management system used to install and manage software packages written in Python.' –Python.' – https://en.wikipedia.org/wiki/Pip_(package_managerhttps://en.wikipedia.org/wiki/Pip_(package_manager))
  • 20. January 20, 2016 Overview of Vagrant 20 Provisioning ApproachProvisioning Approach ● Step 1:Step 1: vagrant upvagrant up ● Import VMImport VM ● Provision usingProvision using AnsibleAnsible – Install latest NodeJSInstall latest NodeJS – Install 'step 2'Install 'step 2' dependenciesdependencies – Install PostgreSQLInstall PostgreSQL – Create vagrant user inCreate vagrant user in databasedatabase ● Step 2:Step 2: vagrantvagrant sshssh ● Run setup.sh scriptRun setup.sh script – Excute 'npm install'Excute 'npm install' and 'bower install'and 'bower install' – 'foundation build' to'foundation build' to build CSS from Sassbuild CSS from Sass – Install PythonInstall Python virtualenvvirtualenv – Django 'migrate' DBDjango 'migrate' DB and 'createsuperuser'and 'createsuperuser' ● Run only one time!Run only one time!
  • 21. January 20, 2016 Overview of Vagrant 21 Eliminating Step 2Eliminating Step 2 ● The 'setup.sh' script can be replaced with theThe 'setup.sh' script can be replaced with the Ansible provisioner insteadAnsible provisioner instead ● Advantages: can go into 'airplane mode' afterAdvantages: can go into 'airplane mode' after provisioningprovisioning ● Ansible package modules: pip, bower, npmAnsible package modules: pip, bower, npm ● Bower and npm directories in a VM instanceBower and npm directories in a VM instance directory (/home/vagrant) not project directorydirectory (/home/vagrant) not project directory ● Modifications will be left as an exercise for theModifications will be left as an exercise for the readerreader
  • 22. January 20, 2016 Overview of Vagrant 22 Provisioning DemoProvisioning Demo
  • 23. January 20, 2016 Overview of Vagrant 23 Vagrant ShareVagrant Share ● Tunnel HTTP and SSH ports through a proxyTunnel HTTP and SSH ports through a proxy ● Example: http://ghastly-wombat-4051.vagrantshare.comExample: http://ghastly-wombat-4051.vagrantshare.com ● Requires account on atlas.hasicorp.comRequires account on atlas.hasicorp.com ● vagrant loginvagrant login ● vagrant sharevagrant share ● URL can be on your domain (--domain)URL can be on your domain (--domain) ● Share SSH sessionsShare SSH sessions ● vagrant share --sshvagrant share --ssh ● vagrant connect --sshvagrant connect --ssh
  • 24. January 20, 2016 Overview of Vagrant 24 Creating BoxenCreating Boxen
  • 25. January 20, 2016 Overview of Vagrant 25 Box Creation LifecycleBox Creation Lifecycle $ packer build OS ISO image 1st box $ vagrant package 2nd box etc... ● packerpacker ● install from installation ISO's to temp VMinstall from installation ISO's to temp VM ● vagrant packagevagrant package ● import from existing VM with Vagrant customizaionsimport from existing VM with Vagrant customizaions VM instance $ vagrant box add $ vagrant up
  • 26. January 20, 2016 Overview of Vagrant 26 vagrant packagevagrant package ● vagrant packagevagrant package takes an existing VM andtakes an existing VM and outputs a re-usable .box fileoutputs a re-usable .box file ● The .box file can be added to the repositoryThe .box file can be added to the repository usingusing vagrant box addvagrant box add ● It can be copied up to a web server for URLIt can be copied up to a web server for URL distributiondistribution ● Using existing Vagrant instance is easiest as it hasUsing existing Vagrant instance is easiest as it has 'vagrant' user, networking, VB guest additions, etc.'vagrant' user, networking, VB guest additions, etc. $ vagrant package VM instance my_precious.box $ vagrant box add
  • 27. January 20, 2016 Overview of Vagrant 27 PackerPacker ● packerpacker is a tool to create Vagrant boxes fromis a tool to create Vagrant boxes from bare metal virtual machinesbare metal virtual machines ● https://www.packer.io/https://www.packer.io/ ● Packer templates are JSON files:Packer templates are JSON files: ● Chef / bento:Chef / bento: https://github.com/chef/bentohttps://github.com/chef/bento – used internally by Chef to build base boxesused internally by Chef to build base boxes ● Boxcutter:Boxcutter: https://github.com/boxcutterhttps://github.com/boxcutter – community-driven templates that are CM tool-agnosticcommunity-driven templates that are CM tool-agnostic $ packer build OS ISO image my_precious.box
  • 28. January 20, 2016 Overview of Vagrant 28 Hashicorp AtlasHashicorp Atlas Boxes can be built in the cloud using templates pushed up by packer. For example, need to build a box for VMWare desktop but you don't have VMWare? Not a problem. See http://atlas.hashicorp.com for more information.
  • 29. January 20, 2016 Overview of Vagrant 29 Box VersioningBox Versioning ● Boxes may be versioned usingBoxes may be versioned using semanticsemantic versioningversioning (e.g. 1.0.9)(e.g. 1.0.9) ● Versioning is default for Atlas hosted boxesVersioning is default for Atlas hosted boxes ● NoteNote vendor/boxnamevendor/boxname conventionconvention ● For self-hosted boxes, couple of choices...For self-hosted boxes, couple of choices... ● No versioning, use naming convention instead inNo versioning, use naming convention instead in vagrant box addvagrant box add (e.g. 'django-v1.0.0')(e.g. 'django-v1.0.0') ● Yes versioning, use 'metadata.json' versioningYes versioning, use 'metadata.json' versioning control in Vagrantcontrol in Vagrant
  • 30. January 20, 2016 Overview of Vagrant 30 Self-hosted VersioningSelf-hosted Versioning ● Generate and hostGenerate and host metadata.json yourselfmetadata.json yourself ● Nice tool to gen jsonNice tool to gen json ● pip install vagrant-metadatapip install vagrant-metadata ● Upload to web orUpload to web or network sharenetwork share ● Using box:Using box: ● vagrant initvagrant init cperez/djsitecperez/djsite http://localhost/boxes/djsite/metadata.jsonhttp://localhost/boxes/djsite/metadata.json ● Upgrading:Upgrading: vagrantvagrant box updatebox update { "name": "cperez/djsite", "description": "Django box", "baseurl": "http://localhost/boxes/djsite", "versions": [ { "version": "1.0.0", "providers": [ { "name": "virtualbox", "checksum_type": "sha1", "checksum": "5bb7c7580712a547a7f30da920c2fb1e2430f904" , "url": "http://localhost/boxes/djsite/1.0.0/virtu albox/djsite-1.0.0.box" } ] } ] }
  • 31. January 20, 2016 Overview of Vagrant 31 Provisioning vs. PackagingProvisioning vs. Packaging ● Best to take a base box, provision it, and thenBest to take a base box, provision it, and then 'freeze' it using'freeze' it using vagrant packagevagrant package ● speeds upspeeds up vagrant destroyvagrant destroy // vagrant upvagrant up cyclecycle ● can include a Vagrantfile with the box with preferredcan include a Vagrantfile with the box with preferred settings (such as networking and port forwards)settings (such as networking and port forwards) ● Nice recipes:Nice recipes: – https://github.com/pro-vagranthttps://github.com/pro-vagrant ● Best to keep box packaging scripts in separateBest to keep box packaging scripts in separate directorydirectory
  • 32. January 20, 2016 Overview of Vagrant 32 Multiple MachinesMultiple Machines ● Mulit-machine can beMulit-machine can be specified inspecified in VagrantfileVagrantfile ● Name each machineName each machine ● vagrant ssh webvagrant ssh web ● Networking optionsNetworking options allow for machine toallow for machine to machinemachine communicationscommunications Vagrant.configure("2") do |config| config.vm.provision "shell", inline: "echo Hello" config.vm.define "web" do |web| web.vm.box = "apache" end config.vm.define "db" do |db| db.vm.box = "mysql" end end
  • 33. January 20, 2016 Overview of Vagrant 33 Vagrant SecurityVagrant Security ● By default, Vagrant boxes areBy default, Vagrant boxes are insecureinsecure ● For local development, not productionFor local development, not production ● Keep your box behind a firewall, not on Internet!Keep your box behind a firewall, not on Internet! ● Public boxes contain the 'insecure private key'Public boxes contain the 'insecure private key' ● https://github.com/mitchellh/vagrant/tree/master/keyshttps://github.com/mitchellh/vagrant/tree/master/keys ● Default password is 'vagrant'Default password is 'vagrant' ● OnOn vagrant upvagrant up, the insecure key is replaced with a, the insecure key is replaced with a local 'insecure key'local 'insecure key' ● vagrant packagevagrant package may create box with newmay create box with new vagrant_private_keyvagrant_private_key
  • 34. January 20, 2016 Overview of Vagrant 34 Other TipsOther Tips ● Unix vs. DOS line feeds, confuses shell and file provisioners. Standardize onUnix vs. DOS line feeds, confuses shell and file provisioners. Standardize on Unix line endings (LF) in your IDE's.Unix line endings (LF) in your IDE's. ● C++ developers: cannot execute built binaries from /vagrant mount? Copy toC++ developers: cannot execute built binaries from /vagrant mount? Copy to /home/vagrant./home/vagrant. ● Running FreeBSD and the nfs folder sync doesn't work because your homeRunning FreeBSD and the nfs folder sync doesn't work because your home directory is encrypted? Try 'rsync' option for folder syncing.directory is encrypted? Try 'rsync' option for folder syncing. ● Box versioning: best to specify a version in Vagrantfile rather thanBox versioning: best to specify a version in Vagrantfile rather than downloading latest base box.downloading latest base box. ● Ubuntu guest: remove 'mesg n' in /root/.profile to eliminate annoying 'default:Ubuntu guest: remove 'mesg n' in /root/.profile to eliminate annoying 'default: stdin: is not a tty' message when using shell provisioner.stdin: is not a tty' message when using shell provisioner.
  • 35. January 20, 2016 Overview of Vagrant 35 Thank You!Thank You! ● Sample Vagrant project with Django andSample Vagrant project with Django and Foundation:Foundation: https://github.com/coloradocarlos/djfoundation1https://github.com/coloradocarlos/djfoundation1 ● Contact: perez@doorstep.comContact: perez@doorstep.com

Editor's Notes

  1. Survey: Do you virtualize your development environment? Production environment? VirtualBox? VMWare? Others?
  2. Traditional development environments have everyone work on native host platforms, IDE&amp;apos;s and tool chains. Byte-code languages (.NET, Java) and portable interpreters (PHP, Python) have been able to firewall developers from host-specific differences. Model works reasonably well in shops that control dev. environment (e.g. the IT locked down laptop), but in BYOM environments, consistency and stability is difficult. When it is time to move your app to the cloud, it is not likely that your laptop environment will be easily replicated.
  3. Developers work with a number of programming languages and environments. Some languages, such as C, C++, Assembly are tightly coupled to the machine architecture. Some platforms, such as ARM, require cross-compilers and vendor tool chains that are tricky and difficult to get setup.
  4. Provisioning a dev. environment is time consuming-- automate and streamline the process with Vagrant. A virtualized dev. environment, if done correctly, mimics your production environment. Vagrant also is a path for shops with strong DevOps workflow-- DevOps can (and should) be involved with building Vagrant instances. CONS of using Vagrant: Need powerful machine and lots of disc space Virtualization may not work well for all cases: driver or RTOS embedded development, or non-web GUI development (e.g. Qt)
  5. Vagrant is a &amp;apos;shell&amp;apos; for starting and stopping VM&amp;apos;s. Host: serves as your front end to your IDE, browser, and SCM. Guest: typically runs headless using port forwards and synced folders. Access using SSH. When developing in dynamically typed languages such as PHP, may not even need to ssh in to start services
  6. mkdir foo cd foo vagrant init ubuntu/trusty32 vagrant up ls -lsat vagrant ssh-config vagrant ssh vagrant halt vagrant destroy rm -rf .vagrant cd .. rmdir foo
  7. Vagrant is open source! Written in Ruby.
  8. &amp;apos;vagrant ssh-config&amp;apos; displays current ssh configuration &amp;apos;vagrant rdp&amp;apos; allows one to connect to a machine using the RDP protocol. &amp;apos;vagrant powershell&amp;apos; for Windows servers. &amp;apos;vagrant port&amp;apos; shows the port forwards in use.
  9. &amp;apos;vagrant init&amp;apos; will default to Atlas if no URL is secified for box URL
  10. &amp;apos;vagrant snapshot&amp;apos; allows you to create and restore snapshots of your VM
  11. &amp;apos;vagrant init&amp;apos; will create a Vagrantfile for you with the box set to &amp;apos;ubuntu/trusty32&amp;apos;. By default, it will use the Atlas URL to find boxes. A .vagrant directory is created in the project folder.
  12. Show example of shell provisioner.
  13. Walk through Foundation and Django.
  14. To use sharing, need to sign up for an account on Hashicorp. vagrant ssh; start web server vagrant share --domain vagrantshare.doorstep.com --name demo Go to: http://demo.vagrantshare.doorstep.com SSH sessions can also be tunnelled. Private key is encrypted for additional security on the Internet.
  15. vagrant package: On guest: vi /etc/hostname (change hostname to djsite-v1-0) history -c; history -w exit On host: vagrant package --output djsite-v1.0.box --vagrantfile Vagrantfile.pkg vagrant box add djsite-v1.0 djsite-v1.0.box cd ..; mkdir djsite2; cd djsite2 vagrant init -m djsite-v1.0 vagrant up
  16. An advantage of packaging your own box is that it is already provisioned the way you like. vagrant package: On guest: sudo vi /etc/hostname (change to djsite-v1-0) history -c; history -w exit On host: vagrant package --output djsite-v1.0.box --vagrantfile Vagrantfile.pkg vagrant box add djsite-v1.0 djsite-v1.0.box cd ..; mkdir djsite2; cd djsite2 vagrant init -m djsite-v1.0 vagrant up
  17. packer build -only=virtualbox-iso ubuntu-14.04-i386.json
  18. vagrant box list Show difference between boxes that are versioned and those that are not. Note the &amp;apos; config.vm.box_version = &amp;quot;20151218.0.1&amp;quot;&amp;apos; in Vagrantfile
  19. Once a .box file is created from packaging, then it can be distributed Tool: https://github.com/lvillani/vagrant-metadata/ cd ~/Doorstep/vagrant/boxes/djsite vagrant-metadata -n &amp;quot;cperez/djsite&amp;quot; -d &amp;quot;Django box&amp;quot; --baseurl=&amp;quot;http://localhost/boxes/djsite&amp;quot; Directory is symlinked to http://localhost for ease of syncing Then create a new directory somewhere: vagrant init cperez/djsite http://localhost/boxes/djsite/metadata.json Good to go with &amp;apos;vagrant up&amp;apos;