Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
138 lines (92 sloc) 3.6 KB


Donate via flattr Donate via Gratipay Apache-2.0-licensed Join Gitter Chat

Environment setup using Vagrant for infrastructure hacking and development


You need:

  • basic packer/ vagrant knowledge (RTFM skills are sufficient)
  • Internet connection (at least for the initial creation of your vagrant boxes)
  • Vagrant >= 1.6.5 ($ vagrant -v)
  • Packer >= v0.7.5 ($ packer version)

Supported Platforms

Host Operating Systems:

  • OS X 10.9
  • OS X 10.10

Guest Operating systems:

  • GNU/ Linux Debian 7
  • GNU/ Linux Debian 8
  • CentOS 6
  • CentOS 7

Vagrant providers:

  • VirtualBox (>= 4.3.22, Oracle VM VirtualBox Extension Pack >= 4.3.22)

Vagrant provisioners:

Files & Directories

$ tree -I '.git|.vagrant|.*\.swp|packer_cache' --matchdirs
├── Vagrantfile.template          # Default Vagrantfile for every Vagrant box
├── assets
│   ├── scripts                   # Scripts that are used for image provisioning
├── build-boxes
├── shared                        # Created Vagrant boxes will be placed here
│   └── boxes
├── templates
│   ├── centos-7                  # A packer template directory
│   │   ├── public_html
│   │   │   └── ks.cfg
│   │   └── template.json         # Packer template
└── update-docs

Deploying a minimal Vagrant box

Create the base box

# Clone this Git repository (vagrant-devenv) to your local workstation
mkdir -p ~/dev/vagrant_hacking/ && cd ~/dev/vagrant_hacking/
git clone --recursive
cd vagrant-devenv/

# Run the following to use some sane default:
./build-boxes centos7

# If everything went well you'll find a new Vagrant box in shared/boxes/:
ls -l shared/boxes/

Instantiate the Vagrant box

# Clone test Git repository (vagrant-devenv-test) to your local workstation
mkdir -p ~/dev/vagrant_hacking/ && cd ~/dev/vagrant_hacking/
git clone
cd vagrant-devenv-test/

# Execute one of the 'init' scripts


In case of any errors during image/ box creation, keep cool and follow the following steps:


  • set headless to false in your packer user variable file
  • build image with debug param -var debug_provision=yes, this causes a long sleep at the end of image provisioning so that you can log into the machine

Additional resources