Easy way to create a Freepto development environment
Install Vagrant 1.6.2:
Install Virtualbox:
$ sudo apt-get install git virtualbox
$ git clone https://github.com/vinc3nt/freepto-vagrant.git
$ cd freepto-vagrant
If the physical host have enough memory, the Vagrantfile should be modified in order to speedup the building process using the ramdisk. The ram size (by default 2048) should be set to 6656 (1024 * 6 + 512). If your host doesn’t have enough memory, you can ignore the next two steps.
$ vim Vagrantfile
$ vagrant reload
$ vagrant up vbox --provider=virtualbox
$ vagrant ssh vbox
In order to change the building type (RAM or DISK) you should modify the freeptobuild configuration file.
$ sudo vim /etc/freeptobuild.cfg
$ sudo freeptobuild /home/vagrant/freepto-lb
$ git clone https://github.com/vinc3nt/freepto-lb.git freepto-lb_vinc3nt
$ sudo freeptobuild /home/vagrant/freepto-lb_vinc3nt
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
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
A box for VirtualBox is already available from http://dev.freepto.mx/vagrant/ but if you want create a custom VirtualBox image, you should follow these steps:
- Install packer:
-
Customize provisioning scripts
-
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
A box for libvirt is already available from http://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-libvirt --force
$ vagrant status
$ vagrant box package --output ${boxname} ${boxname}.box
$ vagrant box add ${boxname}.box --name ${boxname} --force
Tested with the following software relases:
$ 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