Basebox building

Basebox building

The one I use: roderik/VagrantQuantal64Box

Without Veewee, as by the book: cal/vagrant-ubuntu-precise-64 · GitHub

opscode/bento · GitHub

Veewee

Build your own basebox: Veewee is used for building your baseboxes. If we want much wider selection of base-boxes (FreeBSD for example).

If we need FreeBSD or even Windows? That we do. And, to be able to use vagrant, you need a basebox with the virtualbox and guest additions versions matching correctly.

https://github.com/jedi4ever/veewee/ :: jedi4ever/veewee · GitHub http://rubydoc.info/gems/veewee/0.2.3/frames :: File: README — Documentation for veewee (0.2.3)

https://github.com/jedi4ever/veewee/blob/master/doc/vagrant.md :: veewee/doc/vagrant.md at master · jedi4ever/veewee · GitHub https://github.com/jedi4ever/veewee/tree/master/templates :: veewee/templates at master · jedi4ever/veewee · GitHub

Install Veewee from RubyGems, with simple: gem install veewee

If Vagrant is not properly configured, you could get an Error #1 (everything felt apart, even Vagrant itself). But, normally, this should work as expected.

You could do a manual install from Git:

%SYSTEMDRIVE% cd
git clone https://github.com/jedi4ever/veewee.git cd veewee gem install bundler bundle install

Keep Veewee templates updated

I chose to install Veewee from gem instead from source, because it’s easier. But, it looks like it comes with horribly out of date basebox templates.

So, I found a nice tool against that problem: http://aaronbonner.tumblr.com/post/28933222730/veewee-templates-updater-a-hidden-little-gem :: veewee-templates-updater - A Hidden Little Gem

And install with: gem install veewee-templates-updater

Usage

After installing, list available baseboxes: vagrant basebox templates

Sources

List of available templates: https://github.com/jedi4ever/veewee/blob/master/doc/template.md :: veewee/doc/template.md at master · jedi4ever/veewee · GitHub

Setup: https://github.com/fadhlirahim/vagrant_veewee :: fadhlirahim/vagrant_veewee · GitHub

Articles: http://www.ducea.com/2011/08/15/building-vagrant-boxes-with-veewee/ :: Building Vagrant boxes with veewee https://github.com/lumoslabs/vagrant-boxes :: lumoslabs/vagrant-boxes · GitHub http://mattrogish.com/blog/2012/05/17/vagrant-a-repeatable-dev-project-setup/ :: Vagrant and veewee: A Repeatable Dev Project Setup - Rogish Reading Writing http://www.whitewashing.de/2012/05/31/virtual_machines_with_vagrant__veewee_and_puppet.html :: Virtual Machines with Vagrant, Veewee and Puppet — Whitewashing How to build windows guests with Veewee: https://github.com/BIAINC/vagrant-windows

Problems & Solutions

Error #1: Solvable

Error message: Unable to activate virtualbox-0.9.2, because ffi-1.1.5 conflicts with ffi (~> 1.0.9) (Gem::LoadError)

The solution could be to uninstall old (or new) version of library. Specifically this FFI library has problems with Windows after version 1.0.10.

To install older version is, use ‘-v’ switch: vagrant gem install ffi -v=‘1.1.4’

Source: http://stackoverflow.com/questions/7852566/error-error-installing-ffi-error-failed-to-build-gem-native-extension :: ruby - ERROR: Error installing ffi: ERROR: Failed to build gem native extension - Stack Overflow Version 1.1.5 has issues compiling on windows. http://stackoverflow.com/questions/8553874/watir-will-not-install-with-xp-x86-or-win-7-x64-getting-error-building-native-e :: ruby - Watir will not install with XP x86 or Win 7 x64. Getting error building native extension for the FFI gem - Stack Overflow

Error #2: Can’t be solved

Veewee is working as expected. Except, the ‘build’ and ‘destroy’ commands. For example, try: vagrant basebox build

Error message: Failed to create WIN32OLE object from `VirtualBox.Session’ (WIN32OLERuntimeError).

There is no solution. The main issue is that win32ole isn’t supported on 64-bit windows systems yet.

There is no way to make it work in Windows 7 64bit: https://github.com/mitchellh/virtualbox/issues/37 :: Issue #37: Versioned interface doesn’t detect version on Windows · mitchellh/virtualbox

Install Ruby on Linux (I want Bundler)

http://superuser.com/questions/291693/how-to-install-the-latest-version-of-ruby-and-ruby-on-rails-in-ubuntu

The best installing with RVM. Never-ever install from apt-get? Why? Perfect tutorial: http://ryanbigg.com/2010/12/ubuntu-ruby-rvm-rails-and-you/

And automates version of it is railsready script: https://github.com/joshfng/railsready

So just type: wget –no-check-certificate https://raw.github.com/joshfng/railsready/master/railsready.sh && bash railsready.sh

You could then remove the part about Rails. Don’t remove Git as it’s used by RVM to fetch the latest source for some versions of Ruby. But I won’t.

I won’t use that at all. I want it manually - with RVM. That like “manual” :) Howto: https://rvm.io/rvm/install/

# zlib is needed or you'll get an error later (rvm reinstall 1.9.3)
# see: http://stackoverflow.com/questions/9727908/cannot-load-such-file-zlib-even-after-using-rvm-pkg-install-zlib
# see: https://rvm.io/packages/zlib/
#
# Fix: no such file to load -- zlib
sudo apt-get install curl zlib1g-dev
\curl -L https://get.rvm.io | bash -s stable --ruby

# And update the hell out of it
#
gem update --system
gem update

# Now you need to reboot. Need to propagate changes in .bash_profile
# Or you could type in every terminal
source ~/.rvm/scripts/rvm

# Note that if you log in graphically in Ubuntu, .bash_profile will not be
# read. That's normal.
#
# See: http://mywiki.wooledge.org/DotFiles
# See: http://askubuntu.com/questions/121073/why-bash-profile-is-not-getting-sourced-when-opening-a-terminal
#
# Check if this is login shell with:
#   shopt login_shell
#
# Simplest solution:
#   copy important thing from ~/.bash_profile to ~/.bashrc

grep ".rvm/scripts/rvm" ~/.bash_profile >> ~/.bashrc

# Install Bundler

# Fix: libxml2 is missing
#
apt-get install libxslt-dev libxml2-dev

# Fix: cannot load such file -- openssl (LoadError)
#
apt-get install libssl-dev
rvm pkg install openssl
#
# rvm install 1.9.3-dev
gem install bundler

Devbox basebox

This had to be changed:

#!/bin/bash -eux

Install Chef.

Omnibus Installer is the recommended method.

mkdir /tmp/chef-install cd /tmp/chef-install wget “http://www.opscode.com/chef/download?v=11.4.4&prerelease=false&p=ubuntu&pv=12.10&m=x86_64" -O chef.deb dpkg -i chef.deb rm -rf /tmp/chef-install

Preseed:

B.4. Contents of the preconfiguration file (for raring)

The main way to discover all of the available preseeding options is to use debconf-get-selections. For instance, to find out all of the current preseed settings from your current install, you would run

$ debconf-get-selections –installer > alloptions.cfg

Install selections:

tasksel –list-tasks tasksel –task-packages server

For example: server (Basic Ubuntu server) openssh-server (OpenSSH server)

The main way to discover all of the available preseeding options is to use debconf-get-selections. For instance, to find out all of the current preseed settings from your current install, you would run

debconf-get-selections --installer > preseed-options.txt
date 01. Jan 0001 | modified 10. Jun 2024
filename: Vagrant - Basebox building