Wiki » History » Version 1

Version 1/3 - Next ยป - Current version
Fabien Udriot, 2012-07-05 09:37


This is a repository used for setting up a development version of website.

For the first installation, consider one good hour to walk through all the steps. The time will depend on the speed of your network along to the the performance of your machine. There will about +500 Mb to download which includes a virtual machine and the image.

Quick set up guide

The first commands will check if the needed software is installed.

    # Test if your system contains all the necessary software.
    vagrant help        -> Refer to "Vagrant" and "Virtualbox" chapter if command missing
    bundle help         -> Refer to "Gems" chapter if command missing
    chef-solo --help    -> Refer to "Chef" chapter if command missing

    # Add a new image that will be stored into ~/.vagrant.d/boxes/
    vagrant box add debian-6-amd64

    # Download Recipe
    git clone git://
    cd chef-t3org

    # Install Gem dependencies
    bundle install

    # Fire up installation
    # Refer to the troubleshooting below if anything goes wrong.
    vagrant up

    # Enter virtual machine by using vagrant itself.
    # The default username / password is vagrant / vagrant
    vagrant ssh

    # Test the website

    # Sugestion to access the virtual machine from outside
    open Vagrantfile
    # -> comment out "" line
    vagrant reload

    # Files system is at:
    cd /var/www/vhost/

Refer to the troubleshooting section below if any problem pops up during installation.

Installation of the software


To get started you need a environment as described here:

You'll especially need

- git
- gcc compilers and headers (eg. XCode / build-essential)

To install Chef on your system, type:

    # Run as sudo if permission issue
    gem update --system
    gem install chef


Vagrant can be downloaded and installed from the website

    # Run as sudo if permission issue
    gem update --system
    gem install vagrant


VirtualBox is a powerful x86 and AMD64/Intel64 virtualization product for enterprise as well as home use.
Follow this download link to install it on your system


Bundler manages an application's dependencies through its entire life across many machines systematically and repeatably.

    # Run as sudo if permission issue
    gem update --system
    gem install bundler --no-ri --no-rdoc

Configure Vagrant file

To adjust configuration open ``Vagrantfile`` file and change settings according to your needs.

    # Define IP of the virtual machine to access it from the host :hostonly, "" 

    # Activate the GUI or run in headless mode
    config.vm.boot_mode = :gui

    # Turn on verbose Chef logging if necessary
    chef.log_level      = :debug


Vagrant stuck (Network issue)
It happens sometimes Vagrant can not finish the setup and remains stuck most likely because of networking issues. An easy workaround is to login into the Box using the GUI window (vagrant / vagrant as username / password) and to reboot the Box with "sudo reboot".

- Run vagrant using the following line:

config.vm.boot_mode = :gui

- Next, login using "vagrant" / "vagrant"

- Now run "sudo -s" and try to fix the problem manually:

sudo /etc/init.d/networking restart

If that helps, you might try adding the following line to /etc/rc.local (right before "exit 0"):

sh /etc/init.d/networking restart


Debian security updates throws a 404
At your first "vagrant up", vagrant tries to apply all the chef recipes.
During this process, it could be that there are some security updates for the Debian box.
If the security updates throw a 404 like

    Get:1 squeeze/main patch amd64 2.6-2 [120 kB]
    Err squeeze/updates/main linux-headers-2.6.32-5-amd64 amd64 2.6.32-41squeeze2  404  Not Found [IP: 80]
    Failed to fetch  404  Not Found [IP: 80]
    Failed to fetch  404  Not Found [IP: 80]

You have to do some manual stuff, to finish the process.
Just run the following commands:

Login in via ssh to your VM (assuming the VM is launched)

    vagrant ssh

Execute manual update

    sudo apt-get update

Exit the ssh connection


And reload your VM

    vagrant reload

Now, the updates can be applied and the chef magic will start.