Freepto Vagrant

Easy way for create a Freepto development environment

Vagrant setup:

Install Vagrant 1.6.2:

$ sudo apt-get install git virtualbox
$ git clone https://github.com/vinc3nt/freepto-vagrant.git
$ cd freepto-vagrant
$ vagrant up vbox --provider=virtualbox
$ vagrant ssh vbox

Build Freepto:

$ sudo vim /etc/freeptobuild.cfg
$ sudo freeptobuild /home/vagrant/freepto-lb

Build from another repository:

$ git clone https://github.com/vinc3nt/freepto-lb.git freepto-lb_vinc3nt
$ sudo freeptobuild /home/vagrant/freepto-lb_vinc3nt

Build with a diffrent localization:

The default localization is Italian, but is possible configure a different localization:

$ sudo freeptobuild /home/vagrant/freepto-lb en_GB.UTF-8 Europe/London en

Add libvirt support:

Install KVM, qemu and libvirt:

$ sudo apt-get install libxslt-dev libxml2-dev libvirt-dev
$ vagrant plugin install vagrant-libvirt

Currently vagrant-libvirt support rsync as a default method for shared folder sync.
However, with rsync is possible only an uni-directional sync (physical host → virtual machine).
In order to provide a bi-directional sync, the shared folder will be mounted with NFS.

Unfortunately, some additional configurations are needed:

$ sudo apt-get install nfs-kernel-server nfs-common portmap
$ sudo service nfs-common start
$ sudo service nfs-kernel-server start
$ sudo service rpcbind start
$ vagrant up kvm --provider=libvirt
$ vagrant ssh kvm

Creating a new custom virtualbox image

A box for VirtualBox is already available from dev.freepto.mx/vagrant but if you want create a custom VirtualBox image, you should follow these steps:

  1. Install packer:
  1. Customize provisioning scripts
  1. Build a new freepto-vbox.box
$ cd packer
$ packer build --only=freepto-vbox freepto.json
$ vagrant box add builds/virtualbox/freepto-vbox.box --name freepto --force

Creating a new custom libvirt image

A box for libvirt is already available from dev.freepto.mx/vagrant but if you want create a custom libvirt image, you should follow these steps:

$ cd packer
$ packer build --only=freepto-libvirt freepto.json
$ ./raw2box.sh
$ vagrant box add builds/libvirt/freepto-libvirt.box --name freepto --force

Update an existing vagrant box

$ vagrant box list
$ vagrant box repackage --output freepto-${boxname}.box ${boxname}

NOTE:

Tested with the following software releases:

$ vboxmanage --version:
4.3.10_Debianr93012
$ vagrant -v
Vagrant 1.6.2
$ vagrant plugin list | grep vagrant-libvirt
vagrant-libvirt (0.0.16)
$ cat /etc/debian_version
jessie/sid