Skip to content

AvANa-BBS/freepto-vagrant

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

51 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Freepto-vagrant

Easy way to create a Freepto development environment

Usage

Vagrant setup:

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

Build Freepto:

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

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 http://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

  2. 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 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

Update an existing vagrant box

$ vagrant status

$ vagrant box package --output ${boxname} ${boxname}.box

$ vagrant box add ${boxname}.box --name ${boxname} --force

NOTE:

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