@ g Ivan Prisyazhnyy on software engineering

Rebuild vagrant box

Box repositories

Upgrade

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

Upgrade

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

http://dantwining.co.uk/2011/07/18/how-to-shrink-a-dynamically-expanding-guest-virtualbox-image/

“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)

http://docs.puppetlabs.com/guides/puppetlabs_package_repositories.html#for-debian-and-ubuntu

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