@JohnKoepi @ g on software engineering

Rebuild vagrant box

Box repositories


Building vagrant boxes with packer.io

Build a new environment

$ mkdir /tmp/upgrade
$ cd /tmp/upgrade
$ vagrant init squeeze64
$ vagrant up
$ vagrant halt

At that point the VM is stoped. Launch it from the Virtual Box GUI and mount the guest tools (Host+D).


Log into the VM through vagrant:

$ vagrant ssh

Upgrade the OS and the tools:

$ sudo aptitude update
$ sudo aptitude dist-upgrade
$ sudo mount /dev/scd0 /mnt
$ sudo aptitude install build-essential linux-headers-$(uname -r)
$ sudo /mnt/VBoxLinuxAdditions.run
$ sudo rm -rf /usr/src/vboxguest*

insert whatever other upgrades you may need to do here.

$ sudo aptitude purge build-essential linux-headers-$(uname -r)
$ sudo aptitude clean
$ sudo init 1

Clean up


“mount: / is busy” when trying to mount as read-only so that I can run zerofree.

Follow up: Following Jari’s answer and this post by running these commands resolves the issue.

$ service rsyslog stop
$ service network-manager stop
$ killall dhclient

Re-log through the console and execute:

$ rm -r /var/cache/**/**
$ mount -o remount,ro /dev/sda1
$ zerofree /dev/sda1
$ halt

Package the VM:

$ cd /tmp/upgrade
$ vagrant package
$ vagrant box remove squeeze64
$ vagrant box add squeeze64 /tmp/upgrade/package.box

Destroy the upgrade environment:

$ cd /tmp/upgrade
$ vagrant destroy

Our home puppet (we compatible >= 2.7.19)


Latest 2.7 version:

$ wget https://apt.puppetlabs.com/puppetlabs-release-precise.deb
$ sudo dpkg -i puppetlabs-release-precise.deb
$ sudo apt-get update

$ sudo apt-get install puppet=2.7.25-1puppetlabs1 puppet-common=2.7.25-1puppetlabs1 facter=1.7.5-1puppetlabs1
blog comments powered by Disqus