Vagrant with puppet - Install webserver environment with Symfony2 project


Before incoming Symfony2 training I've decided to upgrade a little puppet-symfony configuration for our developers (original on


Next Clone the puppet modules and manifests into your project:

cd your-project
git clone git:// .puppet

Create symlink to a Vagrantfile:

ln -s .puppet/Vagrantfile ./Vagrantfile

Boot your virtual machine:

vagrant up

Finally ssh into it once it boots:

vagrant ssh

Networking details

  • VMs network is configured in host-only mode to handle IP
  • Your client accessing it with IP:
  • You can ssh vagrant@ (default password is vagrant)

Next you should add to your hosts file (/etc/hosts)

sudo sh -c 'echo "" >> /etc/hosts'

Editing files on VM

To edit files you can install sshfs sudo apt-get install sshfs and then mount project directory wherever you want (I've mounted it in /home/exu/Training directory, use directory where you want to mount it)

sudo apt-get install sshfs
sshfs vagrant@ /home/exu/Training

If you don't want to enter your password you can execute ssh-copy-id vagrant@ first (if you use PKI).

Additional tips:

If you don't want to provision machine after each restart (with new basic Symfony project) use --no-provision when you run vagrant up command

vagrant up --no-provision

I've added alias to speed up VM start

alias vup='vagrant up --no-provision'

You can put it in your .bashrc or .zshrc file

comments powered by Disqus