SlideShare a Scribd company logo
Vagrant Hands on Workshop for
Beginners
Liora Milbaum
DevOps & ALM Evangelist
whoami
Mother of 3 girls 22,18,13
Software developer 3 years
ALM Expert 20+ years
DevOps Enthusiast 3 years
Owner of L.M.B.-Consulting Ltd. since 1999
IBM Advanced Business Partner ~10 years
https://www.linkedin.com/in/lioramilbaum
Vagrant hands on workshop for beginners
Please interrupt me
Have a
question/remarks?
Vagrant introduction
VirtualBox introduction
Vagrant+Virtualbox workflow
Getting base boxes
Configuring boxes
Provisioning - shell
Agenda
Vagrant introduction
VirtualBox introduction
Vagrant+Virtualbox workflow
Getting base boxes
Configuring boxes
Provisioning - shell
Agenda
What is Vagrant good for?
Create and configure lightweight, reproducible
and portable development environments
https://www.vagrantup.com/
Vagrant in high level
Command line tool
Automates VM creation: Virtualbox, VMWare,
Hyper-V, AWS….
Integrates with configuration management
tools: shell, chef, Ansible, Puppet….
Runs on: Linux, Windows, MacOS
Why use Vagrant?
Create new VMs quickly and easily
Keep the number of VMs under control
Reproducibility
Identical environment in dev/test/stage/prod
Portability
Vagrant introduction
VirtualBox introduction
Vagrant+Virtualbox workflow
Getting base boxes
Configuring boxes
Provisioning - shell
Agenda
What is VirtualBox good for?
A general purpose full virtualizer for x86
hardware
https://www.virtualbox.org
Vagrant introduction
VirtualBox introduction
Vagrant+Virtualbox workflow
Getting base boxes
Configuring boxes
Provisioning - shell
Agenda
Vagrant hands on workshop for beginners
$ vagrant init hashicorp/precise32
$ vagrant up
$ vagrant ssh
Getting Up And Running
What happened under the hood
$ vagrant init hashicorp/precise32
A Vagrantfile is created
VAGRANTFILE_API_VERSION = ‘2’
vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = ‘hashicorp/precise32’
end
What happened under the hood
$ vagrant up
The base box is downloaded and stored locally
in ~/.vagrant.d/boxes
A new VM is created and configured with the base box as
a template
The VM is booted
The box is provisioned
Done!
$ vagrant ssh
You have a working VM ready for use
Vagrant introduction
VirtualBox introduction
Vagrant+Virtualbox workflow
Getting base boxes
Configuring boxes
Provisioning - shell
Agenda
Finding base boxes
https://atlas.hashicorp.com/boxes/search
Using another base box
$ vagrant box add hashicorp/precise64 & Update Vagrantfile
or
$ vagrant init hashicorp/precise64
Vagrantfile after
VAGRANTFILE_API_VERSION = ‘2’
vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = ‘hashicorp/precise64’
end
Applying the change
$ vagrant destroy
$ vagrant up
$ vagrant ssh
Vagrant introduction
VirtualBox introduction
Vagrant+Virtualbox workflow
Getting base boxes
Configuring boxes
Provisioning - shell
Agenda
Modified VM
VAGRANTFILE_API_VERSION = ‘2’
vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = ‘hashicorp/precise64’
config.vm.provider :virtualbox do |vb|
vb.name = HOST_NAME
vb.customize [‘modifyvm’, :id, ‘--memory’, 256]
end
end
Applying the change
$ vagrant reload
or
$ vagrant destroy -f
$ vagrant up
Task
Create a VM:
Name - DevOpsTLV
Memory - 1GB
CPUs - 2
$ vagrant init user/box # Create Vagrantfile for specified
base box
$ vim/notepad Vagrantfile # Customize your box
$ vagrant up # Create VM if needed and boot
$ vagrant reload # After every change to Vagrantfile
$ vagrant halt # Poweroff
$ vagrant destroy # Clean up!
$ vagrant ssh # log in
$ vagrant status # Status of your VM
Summery
Vagrant introduction
VirtualBox introduction
Vagrant+Virtualbox workflow
Getting base boxes
Configuring boxes
Provisioning - shell
Agenda
Shell Provisioning
Add to your Vagrantfile
config.vm.provision 'shell', path: 'provision.sh'
Put the script into the same folder as
Vagrantfile
$ vagrant@precise32:~$ ls /vagrant/
provision.sh Vagrantfile
Synced folders
Recommended workflow
First do the installation manually (vagrant ssh)
Make sure every command runs without user interaction!
Record every command in the script
If everything works: vagrant destroy -f && vagrant up
Task
Write a provision.sh script which:
Install nginx
Starts the nginx service
That’s it
(for today)
Credit to Bert Van Vreckem
http://slidedeck.io/bertvv/vagrant-presentation

More Related Content

PPTX
Vagrant 101 Workshop
PPTX
Vagrant step-by-step guide for Beginners
PPTX
Vagrant-Overview
PDF
Vagrant presentation
PDF
Vagrant for Virtualized Development
PPTX
Vagrant
PPTX
Vagrant
PDF
Intro to vagrant
Vagrant 101 Workshop
Vagrant step-by-step guide for Beginners
Vagrant-Overview
Vagrant presentation
Vagrant for Virtualized Development
Vagrant
Vagrant
Intro to vagrant

What's hot (20)

PPTX
Using vagrant
PPTX
PPTX
How To Set a Vagrant Development System
PDF
Vagrant for Development
PDF
Vagrant + Ansible + Docker
PDF
Local development environment through virtualisation
PPTX
Gestión de la configuración - Jenkins ci
PDF
Devoxx UK 2013: Sandboxing with the Vagrant-Binding API
PDF
Lightweight and reproducible environments with vagrant and Puppet
PPTX
Docker and fig for dev
PDF
VCCW - Vagrant based WordPress development environment
PDF
Vagrant - Team Development made easy
PDF
Build and deployment
PDF
The future of the php development environment
PDF
CloudOpen North America 2013: Vagrant & CFEngine
PDF
Meetup C++ Floripa - Conan.io
PDF
體驗 Hhvm
PDF
Ohio Linux Fest 2013: Provisioning VMs Quickly with Vagrant and CFEngine
PDF
Helpful pre commit hooks for Python and Django
PDF
Easy WP Dev environments with VVV
Using vagrant
How To Set a Vagrant Development System
Vagrant for Development
Vagrant + Ansible + Docker
Local development environment through virtualisation
Gestión de la configuración - Jenkins ci
Devoxx UK 2013: Sandboxing with the Vagrant-Binding API
Lightweight and reproducible environments with vagrant and Puppet
Docker and fig for dev
VCCW - Vagrant based WordPress development environment
Vagrant - Team Development made easy
Build and deployment
The future of the php development environment
CloudOpen North America 2013: Vagrant & CFEngine
Meetup C++ Floripa - Conan.io
體驗 Hhvm
Ohio Linux Fest 2013: Provisioning VMs Quickly with Vagrant and CFEngine
Helpful pre commit hooks for Python and Django
Easy WP Dev environments with VVV
Ad

Similar to Vagrant hands on workshop for beginners (20)

PDF
DevOps Series: Defining and Sharing Testable Machine Configurations with vagrant
KEY
PDF
Making Developers Productive with Vagrant, VirtualBox, and Docker
PDF
Vagrant For DevOps
PDF
Vagrant workshop 2015
PPTX
DevOps Hackathon - Session 1: Vagrant
PPTX
20180607 master your vms with vagrant
PPTX
Vagrant Up in 5 Easy Steps
PDF
Improved development workflows using vagrant
PDF
Create Development and Production Environments with Vagrant
PDF
Vagrantfordevops
PDF
Vagrant in 15 minutes
PDF
Keep calm and vagrant up
PDF
Automating with ansible (Part B)
PPTX
PDF
ITB2015 - Winning with Vagrant, Puppet and Chef
PPTX
Development with Vagrant
PPTX
Vagrant introduction for Developers
ODP
It Works On My Machine: Vagrant for Software Development
PDF
Quick & Easy Dev Environments with Vagrant
DevOps Series: Defining and Sharing Testable Machine Configurations with vagrant
Making Developers Productive with Vagrant, VirtualBox, and Docker
Vagrant For DevOps
Vagrant workshop 2015
DevOps Hackathon - Session 1: Vagrant
20180607 master your vms with vagrant
Vagrant Up in 5 Easy Steps
Improved development workflows using vagrant
Create Development and Production Environments with Vagrant
Vagrantfordevops
Vagrant in 15 minutes
Keep calm and vagrant up
Automating with ansible (Part B)
ITB2015 - Winning with Vagrant, Puppet and Chef
Development with Vagrant
Vagrant introduction for Developers
It Works On My Machine: Vagrant for Software Development
Quick & Easy Dev Environments with Vagrant
Ad

Recently uploaded (20)

PDF
NewMind AI Monthly Chronicles - July 2025
PDF
Unlocking AI with Model Context Protocol (MCP)
PPT
Teaching material agriculture food technology
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
Machine learning based COVID-19 study performance prediction
PPTX
Big Data Technologies - Introduction.pptx
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PDF
CIFDAQ's Market Insight: SEC Turns Pro Crypto
PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
PDF
Network Security Unit 5.pdf for BCA BBA.
PPTX
MYSQL Presentation for SQL database connectivity
PDF
Encapsulation theory and applications.pdf
PPTX
A Presentation on Artificial Intelligence
PPTX
Understanding_Digital_Forensics_Presentation.pptx
NewMind AI Monthly Chronicles - July 2025
Unlocking AI with Model Context Protocol (MCP)
Teaching material agriculture food technology
Reach Out and Touch Someone: Haptics and Empathic Computing
Machine learning based COVID-19 study performance prediction
Big Data Technologies - Introduction.pptx
Mobile App Security Testing_ A Comprehensive Guide.pdf
20250228 LYD VKU AI Blended-Learning.pptx
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
CIFDAQ's Market Insight: SEC Turns Pro Crypto
Review of recent advances in non-invasive hemoglobin estimation
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Spectral efficient network and resource selection model in 5G networks
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
Network Security Unit 5.pdf for BCA BBA.
MYSQL Presentation for SQL database connectivity
Encapsulation theory and applications.pdf
A Presentation on Artificial Intelligence
Understanding_Digital_Forensics_Presentation.pptx

Vagrant hands on workshop for beginners