SlideShare a Scribd company logo
- Sagar Acharya
Agenda
☞ Understanding of Vagrant
☞ Why should we use Vagrant?
☞ How to Install Vagrant
☞ Clone vagrant Box
☞ File sharing between host & guest OS
☞ Rsync-auto command
☞ References
Understanding of Vagrant
☞ A CLI-based tool for streaming the use of VM environments.
☞ It is tool for Dev, Production and Test environment.
☞ It is virtual machine so changes done in it, doesn't actually reflected to host
machine.
Why should we use Vagrant ?
☞ Quick
☞ Easily replicate production on a Dev Box.
☞ Easily go production from Dev Box.
☞ Mature, stable and proven.
☞ Sharing VM environments with other users.
☞ Multi-platform (Windows, Linux, OS X).
☞ CLI (no GUI).
☞ No need to setup environmental things again and again.
☞ Lightweight as compared to GUT based VM.
Step 1: Install Vagrant
☞ Before installing Vagrant, make sure you have VM installed on your machine
(Virtual Box, VM Ware).
☞ Go to this URL: https://www.vagrantup.com/downloads.html
☞ And download & install vagrant version according to your OS.
Step 2: Vagrant Setup
☞ Then go to this this URL: http://www.vagrantcloud.com and downoload box as
per your requirement.
☞ For now i’m using ubuntu/trusty64 box.
☞ After that follow steps as shown below. (For Linux/Mac OS)
$ sudo mkdir vagrant_getting_started
$ cd vagrant_getting_started
$ vagrant init ubuntu/trusty64; vagrant up --provider virtualbox
Step 3: Vagrant Up
$ sudo vagrant up
Step 4: Vagrant ssh
$ sudo vagrant ssh
Success
More Commands
☞ status : status of the machine
☞ halt : stop machine
☞ suspend : suspend machine
☞ reload : restart machine (load new vagrantfile)
☞ resume : resume suspended machine
☞ provision : force provisioning machine
☞ destroy : stop and delete machine
Clone Vagrant Box
☞ This command will take some time and it will generate a file called package.box
in the vagrant project folder. Make sure your vagrant machine is up.
☞ You need to copy the package.box file to a different location, may be to a
different machine. It is a good idea to rename
$ sudo vagrant package
Clone Vagrant Box : Initial Setup to Install
☞ You need to copy the package.box file to a different location, may be to a
different machine. It is a good idea to rename. I’m renaming it to hvvm.box
$ sudo vagrant init
☞ Now to install the cloned .box file, you can create a new folder on your
machine or another machine and initiate it.
Install Cloned Vagrant Box
☞ sudo vagrant init. This command will generate a Vagrantfile in your
project folder.
☞ Open the Vagrantfile in your favorite editor and add the following lines in it.
1. config.vm.box = "hvvm"
2. config.vm.box_url = "/Users/my/Vagrant/temp1/hvvm.box"
Install Cloned Vagrant Box (contd..)
☞ It is important that the box name "hvvm" should not be used earlier by
another vagrant based virtual machines.
☞ Once the location of the box is specified simply do Vagrant up and your
would have a cloned or duplicate virtual machine.
$ sudo vagrant up
File sharing from host machine to guest machine
☞ Sometimes you will need to share files from host machine to guest
machine or vice versa.
☞ So to do that open your Vagrantfile in any editor and add below lines in it.
☞ So above lines contains rsync command which will sync lamp/sharedata
folder (Host Machine) to html/sharedata (guest Machine)
☞ To make your changes reflected in both OS you will need to execute
vagrant reload command.
Automatically reflect your changes
$ sudo vagrant rsync-auto
References
☞ https://docs.vagrantup.com/v2/synced-folders/rsync.html
☞ https://laracasts.com/discuss/channels/tips/speed-up-vagrant-file-syncing-using-rsync
☞ https://www.vagrantcloud.com
☞ http://www.vagrantup.com
☞ http://code.tutsplus.com/tutorials/vagrant-what-why-and-how--net-26500
Vagrant step-by-step guide for Beginners
Vagrant step-by-step guide for Beginners

More Related Content

What's hot (19)

PDF
Vagrant presentation
Mahmudur Rahman
 
PDF
Minicurso de Vagrant
Leandro Nunes
 
PPTX
Using vagrant
Cuong Huynh
 
PDF
Install openstack
어형 이
 
PDF
Intro to vagrant
Mantas Klasavicius
 
PPTX
Docker and fig for dev
pranas_algoteq
 
PDF
Docker in Action
Alper Kanat
 
PDF
Create your very own Development Environment with Vagrant and Packer
frastel
 
ODP
Building (localized) Vagrant boxes with Packer
Cristovao G. Verstraeten
 
PDF
Docker Compose to Production with Docker Swarm
Mario IC
 
PDF
Hybrid (Windows + Linux) Apps with Docker Swarm
Runcy Oommen
 
PDF
Docker 101 - from 0 to Docker in 30 minutes
Luciano Fiandesio
 
PDF
Vagrant for Development
Jacky Chan
 
PDF
DevOps Series: Defining and Sharing Testable Machine Configurations with vagrant
Felipe
 
PDF
Lightweight and reproducible environments with vagrant and Puppet
Hendrik Ebbers
 
PPTX
nginx + uwsgi emperor + bottle
Jordi Soucheiron
 
PPTX
Simple webapps with nginx, uwsgi emperor and bottle
Jordi Soucheiron
 
PPTX
Vagrant
Denys Haryachyy
 
PDF
When Docker ends, Chef begins ~ #idi2015 Incontro DevOps Italia
Giovanni Toraldo
 
Vagrant presentation
Mahmudur Rahman
 
Minicurso de Vagrant
Leandro Nunes
 
Using vagrant
Cuong Huynh
 
Install openstack
어형 이
 
Intro to vagrant
Mantas Klasavicius
 
Docker and fig for dev
pranas_algoteq
 
Docker in Action
Alper Kanat
 
Create your very own Development Environment with Vagrant and Packer
frastel
 
Building (localized) Vagrant boxes with Packer
Cristovao G. Verstraeten
 
Docker Compose to Production with Docker Swarm
Mario IC
 
Hybrid (Windows + Linux) Apps with Docker Swarm
Runcy Oommen
 
Docker 101 - from 0 to Docker in 30 minutes
Luciano Fiandesio
 
Vagrant for Development
Jacky Chan
 
DevOps Series: Defining and Sharing Testable Machine Configurations with vagrant
Felipe
 
Lightweight and reproducible environments with vagrant and Puppet
Hendrik Ebbers
 
nginx + uwsgi emperor + bottle
Jordi Soucheiron
 
Simple webapps with nginx, uwsgi emperor and bottle
Jordi Soucheiron
 
When Docker ends, Chef begins ~ #idi2015 Incontro DevOps Italia
Giovanni Toraldo
 

Viewers also liked (11)

PPTX
Vagrant Up in 5 Easy Steps
Trevor Roberts Jr.
 
PDF
Vagrant vs docker? Melhor vagrant + docker
Wellington Silva
 
PDF
Provisioning & DevOps at Amis25
Francisco Arturo Viveros
 
PDF
Service Delivery Assembly Line with Vagrant, Packer, and Ansible
Isaac Christoffersen
 
PDF
Mitchell Hashimoto, HashiCorp
Ontico
 
PDF
Testing applications with traffic control in containers / Alban Crequy (Kinvolk)
Ontico
 
PDF
NVMf: 5 млн IOPS по сети своими руками / Андрей Николаенко (IBS)
Ontico
 
PPTX
Orchestrating Docker with Terraform and Consul by Mitchell Hashimoto
Docker, Inc.
 
PDF
Hype vs. Reality: The AI Explainer
Luminary Labs
 
PDF
3 Things Every Sales Team Needs to Be Thinking About in 2017
Drift
 
PDF
Build Features, Not Apps
Natasha Murashev
 
Vagrant Up in 5 Easy Steps
Trevor Roberts Jr.
 
Vagrant vs docker? Melhor vagrant + docker
Wellington Silva
 
Provisioning & DevOps at Amis25
Francisco Arturo Viveros
 
Service Delivery Assembly Line with Vagrant, Packer, and Ansible
Isaac Christoffersen
 
Mitchell Hashimoto, HashiCorp
Ontico
 
Testing applications with traffic control in containers / Alban Crequy (Kinvolk)
Ontico
 
NVMf: 5 млн IOPS по сети своими руками / Андрей Николаенко (IBS)
Ontico
 
Orchestrating Docker with Terraform and Consul by Mitchell Hashimoto
Docker, Inc.
 
Hype vs. Reality: The AI Explainer
Luminary Labs
 
3 Things Every Sales Team Needs to Be Thinking About in 2017
Drift
 
Build Features, Not Apps
Natasha Murashev
 
Ad

Similar to Vagrant step-by-step guide for Beginners (20)

KEY
Vagrant
Michael Peacock
 
PPTX
DevOps Hackathon - Session 1: Vagrant
Antons Kranga
 
PDF
Making Developers Productive with Vagrant, VirtualBox, and Docker
John Rofrano
 
PDF
Vagrant For DevOps
Lalatendu Mohanty
 
PPTX
Vagrant-Overview
Crifkin
 
PDF
Vagrant workshop 2015
Haifa Ftirich
 
PPTX
Vagrant introduction for Developers
Antons Kranga
 
PDF
Vagrant - Version control your dev environment
bocribbz
 
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
Create Development and Production Environments with Vagrant
Brian Hogan
 
PPTX
How To Set a Vagrant Development System
Paul Bearne
 
PDF
Virtualization with Vagrant (ua.pycon 2011)
Dmitry Guyvoronsky
 
PDF
Vagrant for local and team WordPress Development
Anthony Alvarez
 
PDF
Vagrant are you still develop in a non-virtual environment-
Anatoly Bubenkov
 
ODP
It Works On My Machine: Vagrant for Software Development
Carlos Perez
 
PDF
Vagrant 의 활용
InHwan Chun
 
PDF
ITB2015 - Winning with Vagrant, Puppet and Chef
Ortus Solutions, Corp
 
PDF
Vagrant - Team Development made easy
Marco Silva
 
PPTX
Vagrant
Larry Nung
 
DevOps Hackathon - Session 1: Vagrant
Antons Kranga
 
Making Developers Productive with Vagrant, VirtualBox, and Docker
John Rofrano
 
Vagrant For DevOps
Lalatendu Mohanty
 
Vagrant-Overview
Crifkin
 
Vagrant workshop 2015
Haifa Ftirich
 
Vagrant introduction for Developers
Antons Kranga
 
Vagrant - Version control your dev environment
bocribbz
 
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
 
Create Development and Production Environments with Vagrant
Brian Hogan
 
How To Set a Vagrant Development System
Paul Bearne
 
Virtualization with Vagrant (ua.pycon 2011)
Dmitry Guyvoronsky
 
Vagrant for local and team WordPress Development
Anthony Alvarez
 
Vagrant are you still develop in a non-virtual environment-
Anatoly Bubenkov
 
It Works On My Machine: Vagrant for Software Development
Carlos Perez
 
Vagrant 의 활용
InHwan Chun
 
ITB2015 - Winning with Vagrant, Puppet and Chef
Ortus Solutions, Corp
 
Vagrant - Team Development made easy
Marco Silva
 
Vagrant
Larry Nung
 
Ad

Recently uploaded (20)

PPTX
Introduction to web development | MERN Stack
JosephLiyon
 
PDF
Continouous failure - Why do we make our lives hard?
Papp Krisztián
 
PPTX
Automatic_Iperf_Log_Result_Excel_visual_v2.pptx
Chen-Chih Lee
 
PDF
LPS25 - Operationalizing MLOps in GEP - Terradue.pdf
terradue
 
PPTX
How Can Recruitment Management Software Improve Hiring Efficiency?
HireME
 
PDF
What Is an Internal Quality Audit and Why It Matters for Your QMS
BizPortals365
 
PPTX
Quality on Autopilot: Scaling Testing in Uyuni
Oscar Barrios Torrero
 
PDF
>Nitro Pro Crack 14.36.1.0 + Keygen Free Download [Latest]
utfefguu
 
PPTX
NeuroStrata: Harnessing Neuro-Symbolic Paradigms for Improved Testability and...
Ivan Ruchkin
 
PDF
Building scalbale cloud native apps with .NET 8
GillesMathieu10
 
PDF
Difference Between Kubernetes and Docker .pdf
Kindlebit Solutions
 
PDF
capitulando la keynote de GrafanaCON 2025 - Madrid
Imma Valls Bernaus
 
PPTX
EO4EU Ocean Monitoring: Maritime Weather Routing Optimsation Use Case
EO4EU
 
PDF
IDM Crack with Internet Download Manager 6.42 Build 41
utfefguu
 
PDF
Alur Perkembangan Software dan Jaringan Komputer
ssuser754303
 
PDF
>Wondershare Filmora Crack Free Download 2025
utfefguu
 
PDF
The Rise of Sustainable Mobile App Solutions by New York Development Firms
ostechnologies16
 
PPTX
IObit Driver Booster Pro 12.4-12.5 license keys 2025-2026
chaudhryakashoo065
 
PDF
Cloud computing Lec 02 - virtualization.pdf
asokawennawatte
 
PDF
WholeClear Split vCard Software for Split large vCard file
markwillsonmw004
 
Introduction to web development | MERN Stack
JosephLiyon
 
Continouous failure - Why do we make our lives hard?
Papp Krisztián
 
Automatic_Iperf_Log_Result_Excel_visual_v2.pptx
Chen-Chih Lee
 
LPS25 - Operationalizing MLOps in GEP - Terradue.pdf
terradue
 
How Can Recruitment Management Software Improve Hiring Efficiency?
HireME
 
What Is an Internal Quality Audit and Why It Matters for Your QMS
BizPortals365
 
Quality on Autopilot: Scaling Testing in Uyuni
Oscar Barrios Torrero
 
>Nitro Pro Crack 14.36.1.0 + Keygen Free Download [Latest]
utfefguu
 
NeuroStrata: Harnessing Neuro-Symbolic Paradigms for Improved Testability and...
Ivan Ruchkin
 
Building scalbale cloud native apps with .NET 8
GillesMathieu10
 
Difference Between Kubernetes and Docker .pdf
Kindlebit Solutions
 
capitulando la keynote de GrafanaCON 2025 - Madrid
Imma Valls Bernaus
 
EO4EU Ocean Monitoring: Maritime Weather Routing Optimsation Use Case
EO4EU
 
IDM Crack with Internet Download Manager 6.42 Build 41
utfefguu
 
Alur Perkembangan Software dan Jaringan Komputer
ssuser754303
 
>Wondershare Filmora Crack Free Download 2025
utfefguu
 
The Rise of Sustainable Mobile App Solutions by New York Development Firms
ostechnologies16
 
IObit Driver Booster Pro 12.4-12.5 license keys 2025-2026
chaudhryakashoo065
 
Cloud computing Lec 02 - virtualization.pdf
asokawennawatte
 
WholeClear Split vCard Software for Split large vCard file
markwillsonmw004
 

Vagrant step-by-step guide for Beginners

  • 2. Agenda ☞ Understanding of Vagrant ☞ Why should we use Vagrant? ☞ How to Install Vagrant ☞ Clone vagrant Box ☞ File sharing between host & guest OS ☞ Rsync-auto command ☞ References
  • 3. Understanding of Vagrant ☞ A CLI-based tool for streaming the use of VM environments. ☞ It is tool for Dev, Production and Test environment. ☞ It is virtual machine so changes done in it, doesn't actually reflected to host machine.
  • 4. Why should we use Vagrant ? ☞ Quick ☞ Easily replicate production on a Dev Box. ☞ Easily go production from Dev Box. ☞ Mature, stable and proven. ☞ Sharing VM environments with other users. ☞ Multi-platform (Windows, Linux, OS X). ☞ CLI (no GUI). ☞ No need to setup environmental things again and again. ☞ Lightweight as compared to GUT based VM.
  • 5. Step 1: Install Vagrant ☞ Before installing Vagrant, make sure you have VM installed on your machine (Virtual Box, VM Ware). ☞ Go to this URL: https://www.vagrantup.com/downloads.html ☞ And download & install vagrant version according to your OS.
  • 6. Step 2: Vagrant Setup ☞ Then go to this this URL: http://www.vagrantcloud.com and downoload box as per your requirement. ☞ For now i’m using ubuntu/trusty64 box. ☞ After that follow steps as shown below. (For Linux/Mac OS) $ sudo mkdir vagrant_getting_started $ cd vagrant_getting_started $ vagrant init ubuntu/trusty64; vagrant up --provider virtualbox
  • 7. Step 3: Vagrant Up $ sudo vagrant up Step 4: Vagrant ssh $ sudo vagrant ssh
  • 9. More Commands ☞ status : status of the machine ☞ halt : stop machine ☞ suspend : suspend machine ☞ reload : restart machine (load new vagrantfile) ☞ resume : resume suspended machine ☞ provision : force provisioning machine ☞ destroy : stop and delete machine
  • 10. Clone Vagrant Box ☞ This command will take some time and it will generate a file called package.box in the vagrant project folder. Make sure your vagrant machine is up. ☞ You need to copy the package.box file to a different location, may be to a different machine. It is a good idea to rename $ sudo vagrant package
  • 11. Clone Vagrant Box : Initial Setup to Install ☞ You need to copy the package.box file to a different location, may be to a different machine. It is a good idea to rename. I’m renaming it to hvvm.box $ sudo vagrant init ☞ Now to install the cloned .box file, you can create a new folder on your machine or another machine and initiate it.
  • 12. Install Cloned Vagrant Box ☞ sudo vagrant init. This command will generate a Vagrantfile in your project folder. ☞ Open the Vagrantfile in your favorite editor and add the following lines in it. 1. config.vm.box = "hvvm" 2. config.vm.box_url = "/Users/my/Vagrant/temp1/hvvm.box"
  • 13. Install Cloned Vagrant Box (contd..) ☞ It is important that the box name "hvvm" should not be used earlier by another vagrant based virtual machines. ☞ Once the location of the box is specified simply do Vagrant up and your would have a cloned or duplicate virtual machine. $ sudo vagrant up
  • 14. File sharing from host machine to guest machine ☞ Sometimes you will need to share files from host machine to guest machine or vice versa. ☞ So to do that open your Vagrantfile in any editor and add below lines in it. ☞ So above lines contains rsync command which will sync lamp/sharedata folder (Host Machine) to html/sharedata (guest Machine) ☞ To make your changes reflected in both OS you will need to execute vagrant reload command.
  • 15. Automatically reflect your changes $ sudo vagrant rsync-auto
  • 16. References ☞ https://docs.vagrantup.com/v2/synced-folders/rsync.html ☞ https://laracasts.com/discuss/channels/tips/speed-up-vagrant-file-syncing-using-rsync ☞ https://www.vagrantcloud.com ☞ http://www.vagrantup.com ☞ http://code.tutsplus.com/tutorials/vagrant-what-why-and-how--net-26500