A Word For Chet

Just a nice word!
Because it is nice to say nice things

Packer

This is a follow-up post to going devopsey on OpenFoodFacts.
In this one, I will look at how to create a box from a packer template.

As previously hinted, I will use this github repo as a start.
Call it {lazy,clever,opportunistic}, I call it open source.

I forked the repo, updated the debian wheezy virtualbox template and added a couple more keys/values.
Then I builded the box itself.

This post will cover the definition of box and the few commands involved.
This post will not cover how to install packer, I assume you have already.

I will link to the packer documentation as we go along.
Let's start with the general structure of a template.

There is six objects that can be define:
* builders: Builders are responsible for creating machines and generating images from them for various platforms (AWS, vmware, virtualbox,etc.).
* description: A general description of the template.
* min__packer__version: A minimum version of packer to use.
* post-processors: Post-processors are responcible for converting or otherwise registering the build against a specific cloud or infrastructure provider.
* provisioners: Provisioners define which configuration management tool or script you want to apply, think puppet, chef, ansible, salt or some old fashion bash script.
* variables: User variables are a nice way to separate the data and the logic.

The only required object you need to define is the builder.
The rest is somehow nice to have but not essential to a packer template.

These objects put together tell us a story.
Let' hear the story we are trying to tell.

Fist we describe the use we have for this template:
"description": "A base OS to install Product Opener on"

This can be easily retrieve from the command line:

packer inspect ta-debian-7-wheezy-virtualbox.json|head -n3
Description:

A base OS to install Product Opener on

The second part encompass all the data we want to use through the template.
This improve greatly further modification and overall readability.

  "variables": {  
    "core": 1,  
    "memory": 512,  
    "disk_size": 10140,  
    "ssh_port": 22,  
    "ssh_wait_timeout": "10000s",
    "iso_url": "http://cdimage.debian.org/debian-cd/7.8.0/amd64/iso-cd/debian-7.8.0-amd64-netinst.iso",
    "iso_md5": "a91fba5001cf0fbccb44a7ae38c63b6e",
    "vm_name": "debian780"
  },

There isn't much to explain at this stage.
We will refer to those varaibles with {{user `my_variable_name}} later on.

Then we have our main part of the story.

"builders": [
  {
    "boot_command": [
      "<esc><wait>",
      "install <wait>",
      "preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed.cfg <wait>",
      "debian-installer=en_US <wait>",
      "auto <wait>",
      "locale=en_US <wait>",
      "kbd-chooser/method=us <wait>",
      "netcfg/get_hostname={{ .Name }} <wait>",
      "netcfg/get_domain=vagrantup.com <wait>",
      "fb=false <wait>",
      "debconf/frontend=noninteractive <wait>",
      "console-setup/ask_detect=false <wait>",
      "console-keymaps-at/keymap=us <wait>",
      "keyboard-configuration/xkb-keymap=us <wait>",
      "<enter><wait>"
    ],
    "disk_size": "{{user `disk_size`}}",
    "guest_os_type": "Debian_64",
    "headless": true,
    "http_directory": "http",
    "iso_checksum": "{{user `iso_md5`}}",
    "iso_checksum_type": "md5",
    "iso_url": "{{user `iso_url`}}",
    "name": "debian780-VirtualBox",
    "shutdown_command": "echo 'halt -p' > shutdown.sh; echo 'vagrant'|sudo -S sh 'shutdown.sh'",
    "ssh_password": "vagrant",
    "ssh_username": "vagrant",
    "ssh_port": "{{user `ssh_port`}}",
    "ssh_wait_timeout": "{{user `ssh_wait_timeout`}}",
    "type": "virtualbox-iso",
    "vm_name": "{{user `vm_name`}}",
    "vboxmanage": [
      ["modifyvm", "{{.Name}}", "--memory", "{{user `memory`}}"],
      ["modifyvm", "{{.Name}}", "--cpus", "{{user `core`}}"]
    ]
  }
],

This is lot to take in, let's break it down.
First step is the boot command.
We are emulating key entry into the virtual machine.
Some syntax is required to do special key like <enter>.
The same mechanism is used by packer to emulate a 1 second pause with <wait>.
Finally {{ .HTTPIP }} and {{ .HTTPPort }} are actually auto populated.
Packer is actually serving a directory refered as http_directory over http.
This is really convenient since the preseed is expected to be served over http.
More on that in a moment.

With this knowledge we are able to understand this part:

"<esc><wait>",
"install <wait>",
"preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed.cfg <wait>",
"debian-installer=en_US <wait>",
"auto <wait>",
"locale=en_US <wait>",
"kbd-chooser/method=us <wait>",
"netcfg/get_hostname={{ .Name }} <wait>",
"netcfg/get_domain=vagrantup.com <wait>",
"fb=false <wait>",
"debconf/frontend=noninteractive <wait>",
"console-setup/ask_detect=false <wait>",
"console-keymaps-at/keymap=us <wait>",
"keyboard-configuration/xkb-keymap=us <wait>",
"<enter><wait>"

Going further into the builder definition, we can see the hardware definition:

"disk_size": "{{user `disk_size`}}",
"guest_os_type": "Debian_64",
"headless": true,

There is the afforementionned directory, where our preseed.cfg is stored:
"http_directory": "http",

Then comes the place where we get the iso, the way to ensure no corruption occured during the download:

"iso_checksum": "{{user `iso_md5`}}",
"iso_checksum_type": "md5",
"iso_url": "{{user `iso_url`}}",

We provide a name for the build:
"name": "debian780-VirtualBox",

We provide a way to turn the VM down, used once we are done with it.
"shutdown_command": "echo 'halt -p' > shutdown.sh; echo 'vagrant'|sudo -S sh 'shutdown.sh'"

We set a username/password and other details for the ssh configuration:

"ssh_password": "vagrant",
"ssh_username": "vagrant",
"ssh_port": "{{user `ssh_port`}}",
"ssh_wait_timeout": "{{user `ssh_wait_timeout`}}",

The most important property for the builder object is the type.
This type define the targeted platform running the box.
The use the virtualbox builder in this example:
"type": "virtualbox-iso",

We give a name to the created VM:

"vm_name": "{{user `vm_name`}}",

Finally we provide some details to modify the VM hardware:

"vboxmanage": [
  ["modifyvm", "{{.Name}}", "--memory", "{{user `memory`}}"],
  ["modifyvm", "{{.Name}}", "--cpus", "{{user `core`}}"]
]

While it looks like a lot, it remains fairly concice.
It is also worth remembering that it is the only mendatory part of the definiton.
Now, we will look at the post-processor part of our template.
We are using a vagrant post-processor.
This will take the virtualbox files and make a vagrant box out of it.
In the process, the original virtual machine will not be kept.

We are not doing much appart of saying that we want a vagrant box.
We also want to change the output name from packer__.box to the one we set in the variables at the top of our template:

  "post-processors": [
    {
      "type": "vagrant",
      "output": "{{user `vm_name`}}"
    }
  ]

To conclude the template, we add a provisioner.
While I personally find provisioner and post-processor to be used/named the wrong way around, I will stick to the naming scheme used by packer convention.

In this provisioner, we will use shell script.
The scripts listed are the one that were provided in the original repository.
We will cover them after the provisioner definition.

The only complex par of the provisioner is the execute_command.
Which is what will be used to execute the scripts, one after another.
The other noteworthy part is the override, that tells packer to only triger the scripts for the debian780-VirtualBox box.

"provisioners": [
  {
    "type": "shell",
    "pause_before": "5s",
    "execute_command": "echo 'vagrant'|sudo -S sh '{{.Path}}'",
    "override": {
      "debian780-VirtualBox": {
        "scripts": [
          "scripts/base.sh",
          "scripts/vagrant.sh",
          "scripts/virtualbox.sh",
          "scripts/cleanup.sh"
        ]
      }

The shell script are here to do a specific task.
The first one set a minimum configuration, update the distro and install a few required packages.
It also change the grub and sshd configuration to speedup booting time and logging time.
The second one will add vagrant user and public key to allow password less login from vagrant ssh.
It also set a message of the day and install nfs-common.
The third one install the dkms module and remove the other installed virtual box guess support package.
The last and fourth one will cleanup some of the instantiation cruft like dhcp leases, building tools and the network card udev picked.

Looking at base.sh script:

# Update the box
apt-get -y update
apt-get -y install linux-headers-$(uname -r) build-essential
apt-get -y install zlib1g-dev libssl-dev libreadline-gplv2-dev
apt-get -y install curl unzip

# Set up sudo
echo 'vagrant ALL=NOPASSWD:ALL' > /etc/sudoers.d/vagrant

# Tweak sshd to prevent DNS resolution (speed up logins)
echo 'UseDNS no' >> /etc/ssh/sshd_config

# Remove 5s grub timeout to speed up booting
cat <<EOF > /etc/default/grub
# If you change this file, run 'update-grub' afterwards to update
# /boot/grub/grub.cfg.

GRUB_DEFAULT=0
GRUB_TIMEOUT=0
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT="quiet"
GRUB_CMDLINE_LINUX="debian-installer=en_US"
EOF

update-grub

looking at the vagrant.sh script:

# Set up Vagrant.

date > /etc/vagrant_box_build_time

# Create the user vagrant with password vagrant
useradd -G sudo -p $(perl -e'print crypt("vagrant", "vagrant")') -m -s /bin/bash -N vagrant

# Install vagrant keys
mkdir -pm 700 /home/vagrant/.ssh
curl -Lo /home/vagrant/.ssh/authorized_keys \
  'https://raw.github.com/mitchellh/vagrant/master/keys/vagrant.pub'
chmod 0600 /home/vagrant/.ssh/authorized_keys
chown -R vagrant:vagrant /home/vagrant/.ssh

# Customize the message of the day
echo 'Welcome to your Vagrant-built virtual machine.' > /var/run/motd

# Install NFS client
apt-get -y install nfs-common

looking at the virtualbox.sh script:

if test -f .vbox_version ; then
  # The netboot installs the VirtualBox support (old) so we have to remove it
  if test -f /etc/init.d/virtualbox-ose-guest-utils ; then
    /etc/init.d/virtualbox-ose-guest-utils stop
  fi

  rmmod vboxguest
  aptitude -y purge virtualbox-ose-guest-x11 virtualbox-ose-guest-dkms virtualbox-ose-guest-utils

  # Install dkms for dynamic compiles

  apt-get install -y dkms

  # If libdbus is not installed, virtualbox will not autostart
  apt-get -y install --no-install-recommends libdbus-1-3

  # Install the VirtualBox guest additions
  mount -o loop VBoxGuestAdditions.iso /mnt
  yes|sh /mnt/VBoxLinuxAdditions.run
  umount /mnt
  rm -f VBoxLinuxAdditions.iso

  # Start the newly build driver
  /etc/init.d/vboxadd start
fi

looking at the cleanup.sh script

# Clean up
apt-get -y remove linux-headers-$(uname -r) build-essential
apt-get -y autoremove
apt-get -y clean

# Removing leftover leases and persistent rules
echo "cleaning up dhcp leases"
rm /var/lib/dhcp/*

# Make sure Udev doesn't block our network
echo "cleaning up udev rules"
rm /etc/udev/rules.d/70-persistent-net.rules
mkdir /etc/udev/rules.d/70-persistent-net.rules
rm -rf /dev/.udev/
rm /lib/udev/rules.d/75-persistent-net-generator.rules

echo "Adding a 2 sec delay to the interface up, to make the dhclient happy"
echo "pre-up sleep 2" >> /etc/network/interfaces

This conclude the walkthrough of the template.
We will now look at the few commands to make something useful out of this template.

The first step is to make sure we have a valid template.
It will validate the syntaxe, not the logic, let’s keep that in mind.
$ packer validate ta-debian-7-wheezy-virtualbox.json Template validated successfully.

The next and last step is to build the box:
$ packer build ta-debian-7-wheezy-virtualbox.json

After some time and is everthing is going ok, you should see something like:

debian780-VirtualBox output will be in this color.

==> debian780-VirtualBox: Cannot find "Default Guest Additions ISO" in vboxmanage output (or it is empty)
==> debian780-VirtualBox: Downloading or copying Guest additions checksums
    debian780-VirtualBox: Downloading or copying: http://download.virtualbox.org/virtualbox/4.1.18/SHA256SUMS
==> debian780-VirtualBox: Downloading or copying Guest additions
    debian780-VirtualBox: Downloading or copying: http://download.virtualbox.org/virtualbox/4.1.18/VBoxGuestAdditions_4.1.18.iso
    debian780-VirtualBox: Download progress: 12%
    debian780-VirtualBox: Download progress: 25%
    debian780-VirtualBox: Download progress: 38%
    debian780-VirtualBox: Download progress: 52%
    debian780-VirtualBox: Download progress: 66%
    debian780-VirtualBox: Download progress: 81%
    debian780-VirtualBox: Download progress: 95%
==> debian780-VirtualBox: Downloading or copying ISO
    debian780-VirtualBox: Downloading or copying: http://cdimage.debian.org/debian-cd/7.8.0/amd64/iso-cd/debian-7.8.0-amd64-netinst.iso
    debian780-VirtualBox: Download progress: 2%
    debian780-VirtualBox: Download progress: 5%
    debian780-VirtualBox: Download progress: 8%
    debian780-VirtualBox: Download progress: 11%
    debian780-VirtualBox: Download progress: 14%
    debian780-VirtualBox: Download progress: 17%
    debian780-VirtualBox: Download progress: 20%
    debian780-VirtualBox: Download progress: 22%
    debian780-VirtualBox: Download progress: 25%
    debian780-VirtualBox: Download progress: 27%
    debian780-VirtualBox: Download progress: 30%
    debian780-VirtualBox: Download progress: 33%
    debian780-VirtualBox: Download progress: 36%
    debian780-VirtualBox: Download progress: 39%
    debian780-VirtualBox: Download progress: 42%
    debian780-VirtualBox: Download progress: 45%
    debian780-VirtualBox: Download progress: 49%
    debian780-VirtualBox: Download progress: 52%
    debian780-VirtualBox: Download progress: 55%
    debian780-VirtualBox: Download progress: 58%
    debian780-VirtualBox: Download progress: 60%
    debian780-VirtualBox: Download progress: 63%
    debian780-VirtualBox: Download progress: 66%
    debian780-VirtualBox: Download progress: 69%
    debian780-VirtualBox: Download progress: 73%
    debian780-VirtualBox: Download progress: 76%
    debian780-VirtualBox: Download progress: 80%
    debian780-VirtualBox: Download progress: 83%
    debian780-VirtualBox: Download progress: 86%
    debian780-VirtualBox: Download progress: 90%
    debian780-VirtualBox: Download progress: 93%
    debian780-VirtualBox: Download progress: 96%
    debian780-VirtualBox: Download progress: 100%
==> debian780-VirtualBox: Starting HTTP server on port 8016
==> debian780-VirtualBox: Creating virtual machine...
==> debian780-VirtualBox: Creating hard drive...
==> debian780-VirtualBox: Creating forwarded port mapping for SSH (host port 2920)
==> debian780-VirtualBox: Executing custom VBoxManage commands...
    debian780-VirtualBox: Executing: modifyvm debian780 --memory 512
    debian780-VirtualBox: Executing: modifyvm debian780 --cpus 1
==> debian780-VirtualBox: Starting the virtual machine...
    debian780-VirtualBox: WARNING: The VM will be started in headless mode, as configured.
    debian780-VirtualBox: In headless mode, errors during the boot sequence or OS setup
    debian780-VirtualBox: won't be easily visible. Use at your own discretion.
==> debian780-VirtualBox: Waiting 10s for boot...
==> debian780-VirtualBox: Typing the boot command...
==> debian780-VirtualBox: Waiting for SSH to become available...
==> debian780-VirtualBox: Connected to SSH!
==> debian780-VirtualBox: Uploading VirtualBox version info (4.1.18)
==> debian780-VirtualBox: Uploading VirtualBox guest additions ISO...
==> debian780-VirtualBox: Pausing 5s before the next provisioner...
        ==> debian780-VirtualBox: Provisioning with shell script: scripts/base.sh
    debian780-VirtualBox:
    debian780-VirtualBox: We trust you have received the usual lecture from the local System
    debian780-VirtualBox: Administrator. It usually boils down to these three things:
    debian780-VirtualBox:
    debian780-VirtualBox: #1) Respect the privacy of others.
    debian780-VirtualBox: #2) Think before you type.
    debian780-VirtualBox: #3) With great power comes great responsibility.
    debian780-VirtualBox:
    debian780-VirtualBox: Hit http://security.debian.org wheezy/updates Release.gpg
    debian780-VirtualBox: Hit http://security.debian.org wheezy/updates Release
    debian780-VirtualBox: Hit http://security.debian.org wheezy/updates/main Sources
    debian780-VirtualBox: Hit http://security.debian.org wheezy/updates/main amd64 Packages
    debian780-VirtualBox: Hit http://security.debian.org wheezy/updates/main Translation-en
    debian780-VirtualBox: Hit http://http.us.debian.org wheezy Release.gpg
    debian780-VirtualBox: Hit http://http.us.debian.org wheezy-updates Release.gpg
    debian780-VirtualBox: Hit http://http.us.debian.org wheezy Release
    debian780-VirtualBox: Hit http://http.us.debian.org wheezy-updates Release
    debian780-VirtualBox: Hit http://http.us.debian.org wheezy/main Sources
    debian780-VirtualBox: Hit http://http.us.debian.org wheezy/main amd64 Packages
    debian780-VirtualBox: Hit http://http.us.debian.org wheezy/main Translation-en
    debian780-VirtualBox: Hit http://http.us.debian.org wheezy-updates/main Sources
    debian780-VirtualBox: Hit http://http.us.debian.org wheezy-updates/main amd64 Packages/DiffIndex
    debian780-VirtualBox: Hit http://http.us.debian.org wheezy-updates/main Translation-en/DiffIndex
    debian780-VirtualBox: Reading package lists... Done
    debian780-VirtualBox: Reading package lists... Done
    debian780-VirtualBox: Building dependency tree
    debian780-VirtualBox: Reading state information... Done
    debian780-VirtualBox: The following extra packages will be installed:
    debian780-VirtualBox: binutils cpp cpp-4.6 cpp-4.7
    debian780-VirtualBox: dpkg-dev fakeroot g++ g++-4.7 gcc
    debian780-VirtualBox: gcc-4.6 gcc-4.6-base gcc-4.7
    debian780-VirtualBox: libalgorithm-diff-perl
    debian780-VirtualBox: libalgorithm-diff-xs-perl
    debian780-VirtualBox: libalgorithm-merge-perl libc-bin
    debian780-VirtualBox: libc-dev-bin libc6 libc6-dev
    debian780-VirtualBox: libdpkg-perl libfile-fcntllock-perl
    debian780-VirtualBox: libgmp10 libgomp1 libitm1 libmpc2
    debian780-VirtualBox: libmpfr4 libquadmath0
    debian780-VirtualBox: libstdc++6-4.7-dev libtimedate-perl
    debian780-VirtualBox: linux-headers-3.2.0-4-common
    debian780-VirtualBox: linux-kbuild-3.2 linux-libc-dev make
    debian780-VirtualBox: manpages-dev
    debian780-VirtualBox: Suggested packages:
    debian780-VirtualBox: binutils-doc cpp-doc gcc-4.6-locales
    debian780-VirtualBox: gcc-4.7-locales debian-keyring
    debian780-VirtualBox: g++-multilib g++-4.7-multilib
    debian780-VirtualBox: gcc-4.7-doc libstdc++6-4.7-dbg
    debian780-VirtualBox: gcc-multilib autoconf automake1.9
    debian780-VirtualBox: libtool flex bison gdb gcc-doc
    debian780-VirtualBox: gcc-4.6-multilib libmudflap0-4.6-dev
    debian780-VirtualBox: gcc-4.6-doc libgcc1-dbg libgomp1-dbg
    debian780-VirtualBox: libquadmath0-dbg libmudflap0-dbg
    debian780-VirtualBox: binutils-gold gcc-4.7-multilib
    debian780-VirtualBox: libmudflap0-4.7-dev libitm1-dbg
    debian780-VirtualBox: libcloog-ppl0 libppl-c2 libppl7
    debian780-VirtualBox: glibc-doc libstdc++6-4.7-doc
    debian780-VirtualBox: make-doc
    debian780-VirtualBox: The following NEW packages will be installed:
    debian780-VirtualBox: binutils build-essential cpp cpp-4.6
    debian780-VirtualBox: cpp-4.7 dpkg-dev fakeroot g++
    debian780-VirtualBox: g++-4.7 gcc gcc-4.6 gcc-4.6-base
    debian780-VirtualBox: gcc-4.7 libalgorithm-diff-perl
    debian780-VirtualBox: libalgorithm-diff-xs-perl
    debian780-VirtualBox: libalgorithm-merge-perl libc-dev-bin
    debian780-VirtualBox: libc6-dev libdpkg-perl
    debian780-VirtualBox: libfile-fcntllock-perl libgmp10
    debian780-VirtualBox: libgomp1 libitm1 libmpc2 libmpfr4
    debian780-VirtualBox: libquadmath0 libstdc++6-4.7-dev
    debian780-VirtualBox: libtimedate-perl
    debian780-VirtualBox: linux-headers-3.2.0-4-amd64
    debian780-VirtualBox: linux-headers-3.2.0-4-common
    debian780-VirtualBox: linux-kbuild-3.2 linux-libc-dev make
    debian780-VirtualBox: manpages-dev
    debian780-VirtualBox: The following packages will be upgraded:
    debian780-VirtualBox: libc-bin libc6
    debian780-VirtualBox: 2 upgraded, 34 newly installed, 0 to remove and 5 not upgraded.
    debian780-VirtualBox: Need to get 60.1 MB of archives.
    debian780-VirtualBox: After this operation, 153 MB of additional disk space will be used.
    debian780-VirtualBox: Get:1 http://security.debian.org/ wheezy/updates/main libc-bin amd64 2.13-38+deb7u7 [1,274 kB]
    debian780-VirtualBox: Get:2 http://http.us.debian.org/debian/ wheezy/main libgmp10 amd64 2:5.0.5+dfsg-2 [250 kB]
    debian780-VirtualBox: Get:3 http://security.debian.org/ wheezy/updates/main libc6 amd64 2.13-38+deb7u7 [4,355 kB]
    debian780-VirtualBox: Get:4 http://http.us.debian.org/debian/ wheezy/main libgomp1 amd64 4.7.2-5 [27.5 kB]
    debian780-VirtualBox: Get:5 http://http.us.debian.org/debian/ wheezy/main libitm1 amd64 4.7.2-5 [36.6 kB]
    debian780-VirtualBox: Get:6 http://http.us.debian.org/debian/ wheezy/main libmpfr4 amd64 3.1.0-5 [538 kB]
    debian780-VirtualBox: Get:7 http://http.us.debian.org/debian/ wheezy/main libquadmath0 amd64 4.7.2-5 [125 kB]
    debian780-VirtualBox: Get:8 http://http.us.debian.org/debian/ wheezy/main libmpc2 amd64 0.9-4 [40.1 kB]
    debian780-VirtualBox: Get:9 http://http.us.debian.org/debian/ wheezy/main cpp-4.7 amd64 4.7.2-5 [5,416 kB]
    debian780-VirtualBox: Get:10 http://security.debian.org/ wheezy/updates/main binutils amd64 2.22-8+deb7u2 [4,793 kB]
    debian780-VirtualBox: Get:11 http://security.debian.org/ wheezy/updates/main libc-dev-bin amd64 2.13-38+deb7u7 [225 kB]
    debian780-VirtualBox: Get:12 http://security.debian.org/ wheezy/updates/main linux-libc-dev amd64 3.2.65-1+deb7u1 [836 kB]
    debian780-VirtualBox: Get:13 http://security.debian.org/ wheezy/updates/main libc6-dev amd64 2.13-38+deb7u7 [2,666 kB]
    debian780-VirtualBox: Get:14 http://security.debian.org/ wheezy/updates/main linux-headers-3.2.0-4-common amd64 3.2.65-1+deb7u1 [3,586 kB]
    debian780-VirtualBox: Get:15 http://http.us.debian.org/debian/ wheezy/main cpp amd64 4:4.7.2-1 [16.6 kB]
    debian780-VirtualBox: Get:16 http://http.us.debian.org/debian/ wheezy/main gcc-4.7 amd64 4.7.2-5 [8,296 kB]
    debian780-VirtualBox: Get:17 http://security.debian.org/ wheezy/updates/main linux-headers-3.2.0-4-amd64 amd64 3.2.65-1+deb7u1 [625 kB]

    debian780-VirtualBox: Get:18 http://http.us.debian.org/debian/ wheezy/main gcc amd64 4:4.7.2-1 [5,064 B]
    debian780-VirtualBox: Get:19 http://http.us.debian.org/debian/ wheezy/main libstdc++6-4.7-dev amd64 4.7.2-5 [1,726 kB]
    debian780-VirtualBox: Get:20 http://http.us.debian.org/debian/ wheezy/main g++-4.7 amd64 4.7.2-5 [8,011 kB]
    debian780-VirtualBox: Get:21 http://http.us.debian.org/debian/ wheezy/main g++ amd64 4:4.7.2-1 [1,374 B]
    debian780-VirtualBox: Get:22 http://http.us.debian.org/debian/ wheezy/main make amd64 3.81-8.2 [396 kB]
    debian780-VirtualBox: Get:23 http://http.us.debian.org/debian/ wheezy/main libtimedate-perl all 1.2000-1 [41.2 kB]
    debian780-VirtualBox: Get:24 http://http.us.debian.org/debian/ wheezy/main libdpkg-perl all 1.16.15 [958 kB]
    debian780-VirtualBox: Get:25 http://http.us.debian.org/debian/ wheezy/main dpkg-dev all 1.16.15 [1,356 kB]
    debian780-VirtualBox: Get:26 http://http.us.debian.org/debian/ wheezy/main build-essential amd64 11.5 [7,178 B]
    debian780-VirtualBox: Get:27 http://http.us.debian.org/debian/ wheezy/main gcc-4.6-base amd64 4.6.3-14 [142 kB]
    debian780-VirtualBox: Get:28 http://http.us.debian.org/debian/ wheezy/main cpp-4.6 amd64 4.6.3-14 [4,828 kB]
    debian780-VirtualBox: Get:29 http://http.us.debian.org/debian/ wheezy/main fakeroot amd64 1.18.4-2 [109 kB]
    debian780-VirtualBox: Get:30 http://http.us.debian.org/debian/ wheezy/main gcc-4.6 amd64 4.6.3-14 [7,325 kB]
    debian780-VirtualBox: Get:18 http://http.us.debian.org/debian/ wheezy/main gcc amd64 4:4.7.2-1 [5,064 B]
    debian780-VirtualBox: Get:19 http://http.us.debian.org/debian/ wheezy/main libstdc++6-4.7-dev amd64 4.7.2-5 [1,726 kB]
    debian780-VirtualBox: Get:20 http://http.us.debian.org/debian/ wheezy/main g++-4.7 amd64 4.7.2-5 [8,011 kB]
    debian780-VirtualBox: Get:21 http://http.us.debian.org/debian/ wheezy/main g++ amd64 4:4.7.2-1 [1,374 B]
    debian780-VirtualBox: Get:22 http://http.us.debian.org/debian/ wheezy/main make amd64 3.81-8.2 [396 kB]
    debian780-VirtualBox: Get:23 http://http.us.debian.org/debian/ wheezy/main libtimedate-perl all 1.2000-1 [41.2 kB]
    debian780-VirtualBox: Get:24 http://http.us.debian.org/debian/ wheezy/main libdpkg-perl all 1.16.15 [958 kB]
    debian780-VirtualBox: Get:25 http://http.us.debian.org/debian/ wheezy/main dpkg-dev all 1.16.15 [1,356 kB]
    debian780-VirtualBox: Get:26 http://http.us.debian.org/debian/ wheezy/main build-essential amd64 11.5 [7,178 B]
    debian780-VirtualBox: Get:27 http://http.us.debian.org/debian/ wheezy/main gcc-4.6-base amd64 4.6.3-14 [142 kB]
    debian780-VirtualBox: Get:28 http://http.us.debian.org/debian/ wheezy/main cpp-4.6 amd64 4.6.3-14 [4,828 kB]
    debian780-VirtualBox: Get:29 http://http.us.debian.org/debian/ wheezy/main fakeroot amd64 1.18.4-2 [109 kB]
    debian780-VirtualBox: Get:30 http://http.us.debian.org/debian/ wheezy/main gcc-4.6 amd64 4.6.3-14 [7,325 kB]
    debian780-VirtualBox: Get:31 http://http.us.debian.org/debian/ wheezy/main libalgorithm-diff-perl all 1.19.02-2 [51.5 kB]
    debian780-VirtualBox: Get:32 http://http.us.debian.org/debian/ wheezy/main libalgorithm-diff-xs-perl amd64 0.04-2+b1 [12.9 kB]
    debian780-VirtualBox: Get:33 http://http.us.debian.org/debian/ wheezy/main libalgorithm-merge-perl all 0.08-2 [13.5 kB]
    debian780-VirtualBox: Get:34 http://http.us.debian.org/debian/ wheezy/main libfile-fcntllock-perl amd64 0.14-2 [17.2 kB]
    debian780-VirtualBox: Get:35 http://http.us.debian.org/debian/ wheezy/main linux-kbuild-3.2 amd64 3.2.17-1 [238 kB]
    debian780-VirtualBox: Get:36 http://http.us.debian.org/debian/ wheezy/main manpages-dev all 3.44-1 [1,737 kB]
    debian780-VirtualBox: Fetched 60.1 MB in 1min 19s (757 kB/s)
    debian780-VirtualBox: Reading changelogs... Done
    debian780-VirtualBox: Extracting templates from packages: 100%
    debian780-VirtualBox: Preconfiguring packages ...
    debian780-VirtualBox: (Reading database ... 24818 files and directories currently installed.)
    debian780-VirtualBox: Preparing to replace libc-bin 2.13-38+deb7u6 (using .../libc-bin_2.13-38+deb7u7_amd64.deb) ...
    debian780-VirtualBox: Unpacking replacement libc-bin ...
    debian780-VirtualBox: Processing triggers for man-db ...
    debian780-VirtualBox: Setting up libc-bin (2.13-38+deb7u7) ...
    debian780-VirtualBox: (Reading database ... 24818 files and directories currently installed.)
    debian780-VirtualBox: Preparing to replace libc6:amd64 2.13-38+deb7u6 (using .../libc6_2.13-38+deb7u7_amd64.deb) ...
    debian780-VirtualBox: Unpacking replacement libc6:amd64 ...
    debian780-VirtualBox: Setting up libc6:amd64 (2.13-38+deb7u7) ...
    debian780-VirtualBox: Selecting previously unselected package libgmp10:amd64.
    debian780-VirtualBox: (Reading database ... 24818 files and directories currently installed.)
    debian780-VirtualBox: Unpacking libgmp10:amd64 (from .../libgmp10_2%3a5.0.5+dfsg-2_amd64.deb) ...
    debian780-VirtualBox: Selecting previously unselected package libgomp1:amd64.
    debian780-VirtualBox: Unpacking libgomp1:amd64 (from .../libgomp1_4.7.2-5_amd64.deb) ...
    debian780-VirtualBox: Selecting previously unselected package libitm1:amd64.
    debian780-VirtualBox: Unpacking libitm1:amd64 (from .../libitm1_4.7.2-5_amd64.deb) ...
    debian780-VirtualBox: Selecting previously unselected package libmpfr4:amd64.
    debian780-VirtualBox: Unpacking libmpfr4:amd64 (from .../libmpfr4_3.1.0-5_amd64.deb) ...
    debian780-VirtualBox: Selecting previously unselected package libquadmath0:amd64.
    debian780-VirtualBox: Unpacking libquadmath0:amd64 (from .../libquadmath0_4.7.2-5_amd64.deb) ...
    debian780-VirtualBox: Selecting previously unselected package libmpc2:amd64.
    debian780-VirtualBox: Unpacking libmpc2:amd64 (from .../libmpc2_0.9-4_amd64.deb) ...
    debian780-VirtualBox: Selecting previously unselected package binutils.
    debian780-VirtualBox: Unpacking binutils (from .../binutils_2.22-8+deb7u2_amd64.deb) ...
    debian780-VirtualBox: Selecting previously unselected package libc-dev-bin.
    debian780-VirtualBox: Unpacking libc-dev-bin (from .../libc-dev-bin_2.13-38+deb7u7_amd64.deb) ...
    debian780-VirtualBox: Selecting previously unselected package linux-libc-dev:amd64.
    debian780-VirtualBox: Unpacking linux-libc-dev:amd64 (from .../linux-libc-dev_3.2.65-1+deb7u1_amd64.deb) ...
    debian780-VirtualBox: Selecting previously unselected package libc6-dev:amd64.
    debian780-VirtualBox: Unpacking libc6-dev:amd64 (from .../libc6-dev_2.13-38+deb7u7_amd64.deb) ...
    debian780-VirtualBox: Selecting previously unselected package cpp-4.7.
    debian780-VirtualBox: Unpacking cpp-4.7 (from .../cpp-4.7_4.7.2-5_amd64.deb) ...
    debian780-VirtualBox: Selecting previously unselected package cpp.
    debian780-VirtualBox: Unpacking cpp (from .../cpp_4%3a4.7.2-1_amd64.deb) ...
    debian780-VirtualBox: Selecting previously unselected package gcc-4.7.
    debian780-VirtualBox: Unpacking gcc-4.7 (from .../gcc-4.7_4.7.2-5_amd64.deb) ...
    debian780-VirtualBox: Selecting previously unselected package gcc.
    debian780-VirtualBox: Unpacking gcc (from .../gcc_4%3a4.7.2-1_amd64.deb) ...
    debian780-VirtualBox: Selecting previously unselected package libstdc++6-4.7-dev.
    debian780-VirtualBox: Unpacking libstdc++6-4.7-dev (from .../libstdc++6-4.7-dev_4.7.2-5_amd64.deb) ...
    debian780-VirtualBox: Selecting previously unselected package g++-4.7.
    debian780-VirtualBox: Unpacking g++-4.7 (from .../g++-4.7_4.7.2-5_amd64.deb) ...
    debian780-VirtualBox: Selecting previously unselected package g++.
    debian780-VirtualBox: Selecting previously unselected package make.
    debian780-VirtualBox: Unpacking make (from .../make_3.81-8.2_amd64.deb) ...
    debian780-VirtualBox: Selecting previously unselected package libtimedate-perl.
    debian780-VirtualBox: Unpacking libtimedate-perl (from .../libtimedate-perl_1.2000-1_all.deb) ...
    debian780-VirtualBox: Selecting previously unselected package libdpkg-perl.
    debian780-VirtualBox: Unpacking libdpkg-perl (from .../libdpkg-perl_1.16.15_all.deb) ...
    debian780-VirtualBox: Selecting previously unselected package dpkg-dev.
    debian780-VirtualBox: Unpacking dpkg-dev (from .../dpkg-dev_1.16.15_all.deb) ...
    debian780-VirtualBox: Selecting previously unselected package build-essential.
    debian780-VirtualBox: Unpacking build-essential (from .../build-essential_11.5_amd64.deb) ...
    debian780-VirtualBox: Selecting previously unselected package gcc-4.6-base:amd64.
    debian780-VirtualBox: Unpacking gcc-4.6-base:amd64 (from .../gcc-4.6-base_4.6.3-14_amd64.deb) ...
    debian780-VirtualBox: Selecting previously unselected package cpp-4.6.
    debian780-VirtualBox: Unpacking cpp-4.6 (from .../cpp-4.6_4.6.3-14_amd64.deb) ...
    debian780-VirtualBox: Selecting previously unselected package fakeroot.
    debian780-VirtualBox: Unpacking fakeroot (from .../fakeroot_1.18.4-2_amd64.deb) ...
    debian780-VirtualBox: Selecting previously unselected package gcc-4.6.
    debian780-VirtualBox: Unpacking gcc-4.6 (from .../gcc-4.6_4.6.3-14_amd64.deb) ...
    debian780-VirtualBox: Selecting previously unselected package libalgorithm-diff-perl.
    debian780-VirtualBox: Unpacking libalgorithm-diff-perl (from .../libalgorithm-diff-perl_1.19.02-2_all.deb) ...
    debian780-VirtualBox: Selecting previously unselected package libalgorithm-diff-xs-perl.
    debian780-VirtualBox: Unpacking libalgorithm-diff-xs-perl (from .../libalgorithm-diff-xs-perl_0.04-2+b1_amd64.deb) ...
    debian780-VirtualBox: Selecting previously unselected package libalgorithm-merge-perl.
    debian780-VirtualBox: Unpacking libalgorithm-merge-perl (from .../libalgorithm-merge-perl_0.08-2_all.deb) ...
    debian780-VirtualBox: Selecting previously unselected package libfile-fcntllock-perl.
    debian780-VirtualBox: Unpacking libfile-fcntllock-perl (from .../libfile-fcntllock-perl_0.14-2_amd64.deb) ...
    debian780-VirtualBox: Selecting previously unselected package linux-headers-3.2.0-4-common.
    debian780-VirtualBox: Unpacking linux-headers-3.2.0-4-common (from .../linux-headers-3.2.0-4-common_3.2.65-1+deb7u1_amd64.deb) ...
    debian780-VirtualBox: Selecting previously unselected package linux-kbuild-3.2.
    debian780-VirtualBox: Unpacking linux-kbuild-3.2 (from .../linux-kbuild-3.2_3.2.17-1_amd64.deb) ...
    debian780-VirtualBox: Selecting previously unselected package linux-headers-3.2.0-4-amd64.
    debian780-VirtualBox: Unpacking linux-headers-3.2.0-4-amd64 (from .../linux-headers-3.2.0-4-amd64_3.2.65-1+deb7u1_amd64.deb) ...
    debian780-VirtualBox: Selecting previously unselected package manpages-dev.
    debian780-VirtualBox: Unpacking manpages-dev (from .../manpages-dev_3.44-1_all.deb) ...
    debian780-VirtualBox: Processing triggers for man-db ...
    debian780-VirtualBox: Setting up libgmp10:amd64 (2:5.0.5+dfsg-2) ...
    debian780-VirtualBox: Setting up libgomp1:amd64 (4.7.2-5) ...
    debian780-VirtualBox: Setting up libitm1:amd64 (4.7.2-5) ...
    debian780-VirtualBox: Setting up libmpfr4:amd64 (3.1.0-5) ...
    debian780-VirtualBox: Setting up libquadmath0:amd64 (4.7.2-5) ...
    debian780-VirtualBox: Setting up libmpc2:amd64 (0.9-4) ...
    debian780-VirtualBox: Setting up binutils (2.22-8+deb7u2) ...
    debian780-VirtualBox: Setting up libc-dev-bin (2.13-38+deb7u7) ...
   debian780-VirtualBox: Setting up cpp-4.7 (4.7.2-5) ...
    debian780-VirtualBox: Setting up cpp (4:4.7.2-1) ...
    debian780-VirtualBox: Setting up gcc-4.7 (4.7.2-5) ...
    debian780-VirtualBox: Setting up gcc (4:4.7.2-1) ...
    debian780-VirtualBox: Setting up make (3.81-8.2) ...
    debian780-VirtualBox: Setting up libtimedate-perl (1.2000-1) ...
    debian780-VirtualBox: Setting up libdpkg-perl (1.16.15) ...
    debian780-VirtualBox: Setting up dpkg-dev (1.16.15) ...
    debian780-VirtualBox: Setting up gcc-4.6-base:amd64 (4.6.3-14) ...
    debian780-VirtualBox: Setting up cpp-4.6 (4.6.3-14) ...
    debian780-VirtualBox: Setting up fakeroot (1.18.4-2) ...
    debian780-VirtualBox: update-alternatives: using /usr/bin/fakeroot-sysv to provide /usr/bin/fakeroot (fakeroot) in auto mode
    debian780-VirtualBox: Setting up gcc-4.6 (4.6.3-14) ...
    debian780-VirtualBox: Setting up libalgorithm-diff-perl (1.19.02-2) ...
    debian780-VirtualBox: Setting up libalgorithm-diff-xs-perl (0.04-2+b1) ...
    debian780-VirtualBox: Setting up libalgorithm-merge-perl (0.08-2) ...
    debian780-VirtualBox: Setting up libfile-fcntllock-perl (0.14-2) ...
    debian780-VirtualBox: Setting up linux-headers-3.2.0-4-common (3.2.65-1+deb7u1) ...
    debian780-VirtualBox: Setting up linux-kbuild-3.2 (3.2.17-1) ...
    debian780-VirtualBox: Setting up linux-headers-3.2.0-4-amd64 (3.2.65-1+deb7u1) ...
    debian780-VirtualBox: Setting up manpages-dev (3.44-1) ...
    debian780-VirtualBox: Setting up g++-4.7 (4.7.2-5) ...
    debian780-VirtualBox: Setting up g++ (4:4.7.2-1) ...
    debian780-VirtualBox: update-alternatives: using /usr/bin/g++ to provide /usr/bin/c++ (c++) in auto mode
    debian780-VirtualBox: Setting up build-essential (11.5) ...
    debian780-VirtualBox: Setting up libstdc++6-4.7-dev (4.7.2-5) ...
    debian780-VirtualBox: Reading package lists... Done
    debian780-VirtualBox: Building dependency tree
    debian780-VirtualBox: Reading state information... Done
    debian780-VirtualBox: The following extra packages will be installed:
    debian780-VirtualBox: libssl-doc libssl1.0.0 libtinfo-dev
    debian780-VirtualBox: The following NEW packages will be installed:
    debian780-VirtualBox: libreadline-gplv2-dev libssl-dev
    debian780-VirtualBox: libssl-doc libtinfo-dev zlib1g-dev
    debian780-VirtualBox: The following packages will be upgraded:
    debian780-VirtualBox: libssl1.0.0
    debian780-VirtualBox: 1 upgraded, 5 newly installed, 0 to remove and 4 not upgraded.
    debian780-VirtualBox: Need to get 4,712 kB of archives.
    debian780-VirtualBox: After this operation, 9,426 kB of additional disk space will be used.
    debian780-VirtualBox: Get:1 http://security.debian.org/ wheezy/updates/main libssl1.0.0 amd64 1.0.1e-2+deb7u14 [1,260 kB]
    debian780-VirtualBox: Get:2 http://http.us.debian.org/debian/ wheezy/main zlib1g-dev amd64 1:1.2.7.dfsg-13 [215 kB]
    debian780-VirtualBox: Get:3 http://security.debian.org/ wheezy/updates/main libssl-dev amd64 1.0.1e-2+deb7u14 [1,756 kB]
    debian780-VirtualBox: Get:4 http://http.us.debian.org/debian/ wheezy/main libtinfo-dev amd64 5.9-10 [105 kB]
    debian780-VirtualBox: Get:5 http://http.us.debian.org/debian/ wheezy/main libreadline-gplv2-dev amd64 5.2+dfsg-2~deb7u1 [179 kB]
    debian780-VirtualBox: Get:6 http://security.debian.org/ wheezy/updates/main libssl-doc all 1.0.1e-2+deb7u14 [1,198 kB]
    debian780-VirtualBox: Fetched 4,712 kB in 3s (1,219 kB/s)
    debian780-VirtualBox: Reading changelogs... Done
    debian780-VirtualBox: Preconfiguring packages ...
    debian780-VirtualBox: (Reading database ... 38545 files and directories currently installed.)
    debian780-VirtualBox: Preparing to replace libssl1.0.0:amd64 1.0.1e-2+deb7u13 (using .../libssl1.0.0_1.0.1e-2+deb7u14_amd64.deb) ...
    debian780-VirtualBox: Unpacking replacement libssl1.0.0:amd64 ...
    debian780-VirtualBox: Selecting previously unselected package zlib1g-dev:amd64.
    debian780-VirtualBox: Unpacking zlib1g-dev:amd64 (from .../zlib1g-dev_1%3a1.2.7.dfsg-13_amd64.deb) ...
    debian780-VirtualBox: Selecting previously unselected package libssl-dev.
    debian780-VirtualBox: Unpacking libssl-dev (from .../libssl-dev_1.0.1e-2+deb7u14_amd64.deb) ...
    debian780-VirtualBox: Selecting previously unselected package libssl-doc.
    debian780-VirtualBox: Unpacking libssl-doc (from .../libssl-doc_1.0.1e-2+deb7u14_all.deb) ...
    debian780-VirtualBox: Selecting previously unselected package libtinfo-dev:amd64.
    debian780-VirtualBox: Unpacking libtinfo-dev:amd64 (from .../libtinfo-dev_5.9-10_amd64.deb) ...
    debian780-VirtualBox: Selecting previously unselected package libreadline-gplv2-dev:amd64.
    debian780-VirtualBox: Unpacking libreadline-gplv2-dev:amd64 (from .../libreadline-gplv2-dev_5.2+dfsg-2~deb7u1_amd64.deb) ...
    debian780-VirtualBox: Processing triggers for man-db ...
    debian780-VirtualBox: Setting up libssl1.0.0:amd64 (1.0.1e-2+deb7u14) ...
    debian780-VirtualBox: Setting up zlib1g-dev:amd64 (1:1.2.7.dfsg-13) ...
    debian780-VirtualBox: Setting up libssl-dev (1.0.1e-2+deb7u14) ...
    debian780-VirtualBox: Setting up libssl-doc (1.0.1e-2+deb7u14) ...
    debian780-VirtualBox: Setting up libtinfo-dev:amd64 (5.9-10) ...
    debian780-VirtualBox: Setting up libreadline-gplv2-dev:amd64 (5.2+dfsg-2~deb7u1) ...
    debian780-VirtualBox: Reading package lists... Done
    debian780-VirtualBox: Building dependency tree
    debian780-VirtualBox: Reading state information... Done
    debian780-VirtualBox: The following extra packages will be installed:
    debian780-VirtualBox: libcurl3 librtmp0 libssh2-1
    debian780-VirtualBox: Suggested packages:
    debian780-VirtualBox: zip
    debian780-VirtualBox: The following NEW packages will be installed:
    debian780-VirtualBox: curl libcurl3 librtmp0 libssh2-1
    debian780-VirtualBox: unzip

    debian780-VirtualBox: 0 upgraded, 5 newly installed, 0 to remove and 4 not upgraded.
    debian780-VirtualBox: Need to get 991 kB of archives.
    debian780-VirtualBox: After this operation, 1,792 kB of additional disk space will be used.
    debian780-VirtualBox: Get:1 http://security.debian.org/ wheezy/updates/main libcurl3 amd64 7.26.0-1+wheezy12 [331 kB]
    debian780-VirtualBox: Get:2 http://http.us.debian.org/debian/ wheezy/main librtmp0 amd64 2.4+20111222.git4e06e21-1 [62.3 kB]
    debian780-VirtualBox: Get:3 http://security.debian.org/ wheezy/updates/main curl amd64 7.26.0-1+wheezy12 [270 kB]
    debian780-VirtualBox: Get:4 http://security.debian.org/ wheezy/updates/main unzip amd64 6.0-8+deb7u2 [195 kB]
    debian780-VirtualBox: Get:5 http://http.us.debian.org/debian/ wheezy/main libssh2-1 amd64 1.4.2-1.1 [133 kB]
    debian780-VirtualBox: Fetched 991 kB in 1s (886 kB/s)
    debian780-VirtualBox: Selecting previously unselected package librtmp0:amd64.
    debian780-VirtualBox: (Reading database ... 40019 files and directories currently installed.)
    debian780-VirtualBox: Unpacking librtmp0:amd64 (from .../librtmp0_2.4+20111222.git4e06e21-1_amd64.deb) ...
    debian780-VirtualBox: Selecting previously unselected package libssh2-1:amd64.
    debian780-VirtualBox: Unpacking libssh2-1:amd64 (from .../libssh2-1_1.4.2-1.1_amd64.deb) ...
    debian780-VirtualBox: Selecting previously unselected package libcurl3:amd64.
    debian780-VirtualBox: Unpacking libcurl3:amd64 (from .../libcurl3_7.26.0-1+wheezy12_amd64.deb) ...
    debian780-VirtualBox: Selecting previously unselected package curl.
    debian780-VirtualBox: Unpacking curl (from .../curl_7.26.0-1+wheezy12_amd64.deb) ...
    debian780-VirtualBox: Selecting previously unselected package unzip.
    debian780-VirtualBox: Unpacking unzip (from .../unzip_6.0-8+deb7u2_amd64.deb) ...
    debian780-VirtualBox: Processing triggers for man-db ...
    debian780-VirtualBox: Processing triggers for mime-support ...
    debian780-VirtualBox: Setting up librtmp0:amd64 (2.4+20111222.git4e06e21-1) ...
    debian780-VirtualBox: Setting up libssh2-1:amd64 (1.4.2-1.1) ...
    debian780-VirtualBox: Setting up libcurl3:amd64 (7.26.0-1+wheezy12) ...
    debian780-VirtualBox: Setting up curl (7.26.0-1+wheezy12) ...
    debian780-VirtualBox: Setting up unzip (6.0-8+deb7u2) ...
    debian780-VirtualBox: Generating grub.cfg ...
    debian780-VirtualBox: Found linux image: /boot/vmlinuz-3.2.0-4-amd64
    debian780-VirtualBox: Found initrd image: /boot/initrd.img-3.2.0-4-amd64
    debian780-VirtualBox: done
==> debian780-VirtualBox: Provisioning with shell script: scripts/vagrant.sh
    debian780-VirtualBox: useradd: user 'vagrant' already exists
    debian780-VirtualBox: % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
    debian780-VirtualBox: Dload  Upload   Total   Spent    Left  Speed
    debian780-VirtualBox:   0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
    debian780-VirtualBox: 100   409  100   409    0     0    417      0 --:--:-- --:--:-- --:--:--  2034
    debian780-VirtualBox: Reading package lists... Done
    debian780-VirtualBox: Building dependency tree
    debian780-VirtualBox: Reading state information... Done
    debian780-VirtualBox: nfs-common is already the newest version.
    debian780-VirtualBox: 0 upgraded, 0 newly installed, 0 to remove and 4 not upgraded.
==> debian780-VirtualBox: Provisioning with shell script: scripts/virtualbox.sh
    debian780-VirtualBox: Error: Module vboxguest is not currently loaded
    debian780-VirtualBox: No packages will be installed, upgraded, or removed.
    debian780-VirtualBox: 0 packages upgraded, 0 newly installed, 0 to remove and 4 not upgraded.
    debian780-VirtualBox: Need to get 0 B of archives. After unpacking 0 B will be used.
    debian780-VirtualBox: [  0%] Reading task descriptions
    debian780-VirtualBox: Reading package lists... Done
    debian780-VirtualBox: Building dependency tree
    debian780-VirtualBox: Reading state information... Done
    debian780-VirtualBox: The following NEW packages will be installed:
    debian780-VirtualBox: dkms
    debian780-VirtualBox: 0 upgraded, 1 newly installed, 0 to remove and 4 not upgraded.
    debian780-VirtualBox: Need to get 77.4 kB of archives.
    debian780-VirtualBox: After this operation, 196 kB of additional disk space will be used.
    debian780-VirtualBox: Get:1 http://http.us.debian.org/debian/ wheezy/main dkms all 2.2.0.3-1.2 [77.4 kB]
    debian780-VirtualBox: Fetched 77.4 kB in 0s (137 kB/s)
    debian780-VirtualBox: Selecting previously unselected package dkms.
    debian780-VirtualBox: (Reading database ... 40083 files and directories currently installed.)
    debian780-VirtualBox: Unpacking dkms (from .../dkms_2.2.0.3-1.2_all.deb) ...
    debian780-VirtualBox: Processing triggers for man-db ...
    debian780-VirtualBox: Setting up dkms (2.2.0.3-1.2) ...
    debian780-VirtualBox: Reading package lists... Done
    debian780-VirtualBox: Building dependency tree
    debian780-VirtualBox: Reading state information... Done
    debian780-VirtualBox: Recommended packages:
    debian780-VirtualBox: dbus
    debian780-VirtualBox: The following NEW packages will be installed:
    debian780-VirtualBox: libdbus-1-3
    debian780-VirtualBox: Need to get 174 kB of archives.
    debian780-VirtualBox: After this operation, 386 kB of additional disk space will be used.
    debian780-VirtualBox: Get:1 http://http.us.debian.org/debian/ wheezy/main libdbus-1-3 amd64 1.6.8-1+deb7u5 [174 kB]
    debian780-VirtualBox: Fetched 174 kB in 1s (113 kB/s)
    debian780-VirtualBox: Selecting previously unselected package libdbus-1-3:amd64.
    debian780-VirtualBox: (Reading database ... 40130 files and directories currently installed.)
    debian780-VirtualBox: Unpacking libdbus-1-3:amd64 (from .../libdbus-1-3_1.6.8-1+deb7u5_amd64.deb) ...
    debian780-VirtualBox: Setting up libdbus-1-3:amd64 (1.6.8-1+deb7u5) ...
    debian780-VirtualBox: mount: block device /home/vagrant/VBoxGuestAdditions.iso is write-protected, mounting read-only
    debian780-VirtualBox: Verifying archive integrity... All good.
    debian780-VirtualBox: Uncompressing VirtualBox 4.1.18 Guest Additions for Linux.........
    debian780-VirtualBox: VirtualBox Guest Additions installer
    debian780-VirtualBox: Removing existing VirtualBox DKMS kernel modules ...done.
    debian780-VirtualBox: Removing existing VirtualBox non-DKMS kernel modules ...done.
    debian780-VirtualBox: Building the VirtualBox Guest Additions kernel modules
    debian780-VirtualBox: The headers for the current running kernel were not found. If the following
    debian780-VirtualBox: module compilation fails then this could be the reason.
    debian780-VirtualBox:
    debian780-VirtualBox: Building the main Guest Additions module ...done.
    debian780-VirtualBox: Building the shared folder support module ...done.
    debian780-VirtualBox: Building the OpenGL support module ...fail!
    debian780-VirtualBox: (Look at /var/log/vboxadd-install.log to find out what went wrong)
    debian780-VirtualBox: Doing non-kernel setup of the Guest Additions ...done.
    debian780-VirtualBox: Installing the Window System drivers ...fail!
    debian780-VirtualBox: (Could not find the X.Org or XFree86 Window System.)
    debian780-VirtualBox: Starting the VirtualBox Guest Additions ...done.
==> debian780-VirtualBox: Provisioning with shell script: scripts/cleanup.sh
    debian780-VirtualBox: Reading package lists... Done
    debian780-VirtualBox: Building dependency tree
    debian780-VirtualBox: Reading state information... Done
    debian780-VirtualBox: The following packages will be REMOVED:
    debian780-VirtualBox: build-essential
    debian780-VirtualBox: linux-headers-3.2.0-4-amd64
    debian780-VirtualBox: 0 upgraded, 0 newly installed, 2 to remove and 4 not upgraded.
    debian780-VirtualBox: After this operation, 9,275 kB disk space will be freed.
    debian780-VirtualBox: (Reading database ... 40140 files and directories currently installed.)
    debian780-VirtualBox: Removing build-essential ...
    debian780-VirtualBox: Removing linux-headers-3.2.0-4-amd64 ...
    debian780-VirtualBox: Reading package lists... Done
    debian780-VirtualBox: Building dependency tree
    debian780-VirtualBox: Reading state information... Done
    debian780-VirtualBox: The following packages will be REMOVED:
    debian780-VirtualBox: g++ g++-4.7 libstdc++6-4.7-dev
    debian780-VirtualBox: linux-headers-3.2.0-4-common
    debian780-VirtualBox: linux-kbuild-3.2
    debian780-VirtualBox: 0 upgraded, 0 newly installed, 5 to remove and 4 not upgraded.
    debian780-VirtualBox: After this operation, 46.3 MB disk space will be freed.
    debian780-VirtualBox: (Reading database ... 34445 files and directories currently installed.)
    debian780-VirtualBox: Removing g++ ...
    debian780-VirtualBox: Removing linux-headers-3.2.0-4-common ...
    debian780-VirtualBox: Removing linux-kbuild-3.2 ...
    debian780-VirtualBox: Removing g++-4.7 ...
    debian780-VirtualBox: Removing libstdc++6-4.7-dev ...
    debian780-VirtualBox: Processing triggers for man-db ...
    debian780-VirtualBox: cleaning up dhcp leases
    debian780-VirtualBox: cleaning up udev rules
    debian780-VirtualBox: rm: cannot remove `/etc/udev/rules.d/70-persistent-net.rules': No such file or directory
    debian780-VirtualBox: Adding a 2 sec delay to the interface up, to make the dhclient happy
==> debian780-VirtualBox: Gracefully halting virtual machine...
    debian780-VirtualBox: 
    debian780-VirtualBox: Broadcast message from root@debian780 (Tue Feb 10 18:21:43 2015):
    debian780-VirtualBox:
    debian780-VirtualBox: The system is going down for system halt NOW!
==> debian780-VirtualBox: Preparing to export machine...
    debian780-VirtualBox: Deleting forwarded port mapping for SSH (host port 2920)
==> debian780-VirtualBox: Exporting virtual machine...
    debian780-VirtualBox: Executing: export debian780 --output output-debian780-VirtualBox/debian780.ovf
==> debian780-VirtualBox: Unregistering and deleting virtual machine...
==> debian780-VirtualBox: Running post-processor: vagrant
==> debian780-VirtualBox (vagrant): Creating Vagrant box for 'virtualbox' provider
    debian780-VirtualBox (vagrant): Copying from artifact: output-debian780-VirtualBox/debian780-disk1.vmdk
    debian780-VirtualBox (vagrant): Copying from artifact: output-debian780-VirtualBox/debian780.ovf
    debian780-VirtualBox (vagrant): Renaming the OVF to box.ovf...
    debian780-VirtualBox (vagrant): Compressing: Vagrantfile
    debian780-VirtualBox (vagrant): Compressing: box.ovf
    debian780-VirtualBox (vagrant): Compressing: debian780-disk1.vmdk
    debian780-VirtualBox (vagrant): Compressing: metadata.json
Build 'debian780-VirtualBox' finished.

==> Builds finished. The artifacts of successful builds are:
--> debian780-VirtualBox: 'virtualbox' provider box: debian780

We can see a new file being created debian780.
There is also a folder called packer_cache containing the iso downloaded to create the box.

Here is the folder tree before the build:

$ tree
.
├── http
│   └── preseed.cfg
├── LICENCE
├── README.md
├── scripts
│   ├── base.sh
│   ├── cleanup.sh
│   ├── puppet.sh
│   ├── vagrant.sh
│   ├── virtualbox.sh
│   └── vmfusion.sh
├── ta-debian-7-wheezy.json
├── ta-debian-7-wheezy-virtualbox.json
└── ta-debian-7-wheezy-virtualbox-puppet.json

This is the tree output after the build

$ tree
.
├── debian780
├── http
│   └── preseed.cfg
├── LICENCE
├── packer_cache
│   ├── 481544875c8ef4a1d3714f17a1d279c4528eec6087887d6312158f99e8c36061.iso
│   └── 92b92958c4ce830770ca79e9e1b848c7eb43569a164fc2b0f25040112d5d5ed1.iso
├── README.md
├── scripts
│   ├── base.sh
│   ├── cleanup.sh
│   ├── puppet.sh
│   ├── vagrant.sh
│   ├── virtualbox.sh
│   └── vmfusion.sh
├── ta-debian-7-wheezy.json
├── ta-debian-7-wheezy-virtualbox.json
└── ta-debian-7-wheezy-virtualbox-puppet.json

That is for now, later on we will go one step further with vagrant.

Going Devopsey On Openfoodfacts

While this is certainly a ropey title, it kind of makes sense since most of the tooling came from the DevOps problematic.
The goal here is to get a repeatable and scriptable way to build from scratch an Open Food Facts server.
Hopefully this is simplify the operation task and allow more people to contribute.

This is not a complicated task, just a bit complex.
I want to make it as simple and easy to reproduce as possible.
That means every step of the way needs to be done with open source tools.
All of the steps also need to be open in order to be improved by the community.
At some point, it all should be part of a CI process somewhere.

My plan is to start by building an image with packer.
That will allow us to have a base image to build on top of.
Packer will be used the same way I use to build VM with the Foreman.
It requires some information such as:
* Hardware to be emulated.
* Where to get the OS iso from.
* A preseed/kickstart/else to automate the installation process.
* The type of platform targeted (WMware, VirtualBox, AWS, etc).
* What configuration management needs running.

Once you created an machine, you can run it with vagrant.
It provides a simple way to describe and run an development environments.
You can use different virtualisation providers such as VirtualBox, VMware, Docker or Hyper-V.
Vagrantfile has lots of similar concept to the packer definition file.
The goal is to do vagrant up and be ready to ssh into the box(es).
Here we only need one box to have the environment ready, for now.

The next step is to get the part that are required to run Open Food Facts "Product Opener" in a package.
It means a package that contain all the requirement (think httpd, mongodb) and the code of OFF itself.
In order to vendorise it all, I plan to use the base image created by packer.
Then I will create a recipe for fpm-cookery to build the package.

Finally, once the infrastructure and code requirement are all vendored, I can build a "Product Opener appliance".
I just to add the package create in the image with packer.

I will post my methodology and advancement here as I go along.
Next stop this github repo.

Cfgmgmtcamp

I went to configuration management camp in Ghent just after FOSDEM.
I'm not sure it is wise to chain conferences, but did it anyway.

Overall, I'm not impressed about the experience.
The website was lacking information and even misleading (I'm not going to talk about the open street map pointing somewhere random, it deserves its own post). The organisation left a lot to be desired on site too.
Finally, being a multi-track event and some of the rooms being far away from each other made it very difficult to have a sense of choice.
That mean, I likely won't be going there next time.

Now looking into it a bit in details, some of the talks were really good.
The panels were also worth watching.
One of my favourite quote happened during the panel Next steps in Configuration Management.
While there is a representative from Chef, Ansible and Salt, Luke Kanies from Puppet goes like this "every person on stage today is throwing away & building from scratch what people coming before have built".
This is a good summary of the situation for configuration management tooling.

I also like the last talk of the day about packaging with omnibus and fpm-cookery.
I strongly feel that docker is once again blurring the line and mixing concepts.
When it comes to packaging, I think docker is a great way to produce a repeatable environment to build them. I'tm not convinced it is a great delivery tool.
As Jan Ivar Beddari put it, building packages and delivering them is two different task and should not be done within one docker instance.

The one thing that is to remember from the trip was the magnificent fries I got downtown of a food truck.
There is much more to say about the 2 days, but I doubt it is worth reading.

Fosdem

It's the time of the year where the Free and Open source folks flock to Belgium.
It's FOSDEM time!.

I was lucky enough to have a couch to sleep on and some friends to hang out with.
They live or lived in Brussels, they know the right place to eat, to drink, to take touristy pictures, the whole shebang.

I was personally going there for the social aspect of it.
So as planned, I didn't went to many talk.
Instead, I met new people, people I haven't seen in a while.
I purposely didn't spend the whole weekend running around.
You need to sneak your way in full rooms one time out of two if you chain talks.
That said I did attend a few.

The Ntimed talk was really relevant with the leap second happening this June 30.
This was a reminder that under the rather calm surface, the FOSS oceans are as tumultuous as ever.
The FreeBSD talk down the OpenBSD, but not as much as they talk down the *Linux and yet not as much as they talk down MacOS.
It's easy to miss it if you are not partisan in such debate.
It is more difficult to miss, when you are getting a lot of grievances as a maintainer in one of those other *nix.

I was also really keen to see the UX/UI for Open Data talk from @hollielubbock.
It was really nice, I only wished it could have last longer.
Some really great example on what kind of dataset call for what kind of visualisation.
The meme generator is a good laugh, yet a clever way to look at art.

She also made a point about how museums started off as someone's house filled with stuff.
Back then, there wasn't a carefully planned narrative.
Owners were not curators, it wasn't about trying to guide you through a crafted experience.
A website or an API in that regard is quite similar. You make your own story, you only can connect the dots.

Other crucial insight provided by this presentation: the need for clear and simple interface, the need to let the users draw their own conclusions.
That piece of otherwise dull data, should now be a way to inspire.
It should empower the users to do something.

I wasn't surprise to hear that going forward, open data might be a requirement to obtain public funding in the UK.
It makes a lot of sense, considering that museum and gallery are largely financed by citizen.

I also tried to talk people about Open Food Facts.
I think the general audience of FOSDEM is our audience.
They don't need explaining on the 'why'.
Some even knew about the project, which is a positive sign.

Most people were genuinely interested. Few people even told me that they built or tried to build similar project. The main issue they faced was one of technology (quite ironic from a tech crowd). They all tried to do it before the ubiquitous availability of smartphone.

I had quite a good angle to approach the crowd, to get the conversation started.
We've came up with a bit of a theme for fosdem "Open your beer and meet Open Food Facts".
The goal was to get as many new beer in the database as possible.
I'm not aware of a set goal, but I think we didn't go as far as we could have.

The tactic was simple: stay around the bar and engage with people. I looked for people with a beer at hand and asked if I could scan their beer.
Yes, it does sound weird, so I got a few raised eye-brow.

Once you explain what you are doing, how it works and why you are doing it, people open up and are keen to let you their beer.
Then they start asking questions: success!

It wasn't always easy, since the app requires data.
One problem was network, or the lack thereof under the amphitheatre.
There wasn't any working wifi or cellular network.

It is difficult enough to get people attention with that kind of approach. It is extra hard when you need to run outside to access Internet and come back to finish your speech.
Overall people were nice and patient, so it wasn't a big deal, but not optimal.
Beer wise, FOSDEM is not to be ashamed.
To finish the day, I went and see the bar staff.

I asked if I could see their selection, even if it was the empty ones. I have to say they were very VERY helpful.
They took some time to find all the different empty can so I could scan them and take picture.
There was quite a selection of beer and club mate there.
The less popular choices were sourced directly at the bar itself.
Some were registered before FOSDEM and other were entered their favourite ones during FOSDEM (shout out to @lucaa). It didn't take long to have the whole offering of beverages in the DB.

Overall, everyone I talked to about the project was happy to get a stickers or two.
Some went and talked to their work colleagues, some went on social media to tell the world how they liked the project.
The only missing piece, one that most people asked me, is a lightning talk