Skip to content

Instantly share code, notes, and snippets.

@nefarioustim nefarioustim/ Secret
Last active Oct 1, 2015

What would you like to do?
Post install for Ubuntu 13.10 base box
date > /etc/vagrant_box_build_time
echo 'ubuntu-saucy.vagrant' > /etc/hostname
echo ' ubuntu-saucy.vagrant' >> /etc/hosts
start hostname
apt-get -y update
apt-get -y upgrade
apt-get -y install linux-headers-$(uname -r) build-essential
apt-get -y install zlib1g-dev libssl-dev libreadline-gplv2-dev libyaml-dev
apt-get -y install vim
apt-get -y install dkms
apt-get -y install nfs-common
apt-get clean
groupadd -r admin
usermod -a -G admin vagrant
cp /etc/sudoers /etc/sudoers.orig
sed -i -e '/Defaults\s\+env_reset/a Defaults\texempt_group=admin' /etc/sudoers
sed -i -e 's/%admin ALL=(ALL) ALL/%admin ALL=NOPASSWD:ALL/g' /etc/sudoers
cd /tmp
tar -xvzf ruby-2.0.0-p247.tar.gz
cd ruby-2.0.0-p247/
./configure --prefix=/usr/local
make install
gem install chef puppet ruby-shadow --no-ri --no-rdoc
# Installing vagrant keys
mkdir -m700 /home/vagrant/.ssh && cd $_
wget --no-check-certificate '' -O authorized_keys
chmod 600 /home/vagrant/.ssh/authorized_keys
chown -R vagrant /home/vagrant/.ssh
echo 'UseDNS no' >> /etc/ssh/sshd_config
# Installing the virtualbox guest additions
VBOX_VERSION=$(cat /home/vagrant/.vbox_version)
cd /tmp
mount -o loop VBoxGuestAdditions_$VBOX_VERSION.iso /mnt
sh /mnt/
umount /mnt
rm VBoxGuestAdditions_$VBOX_VERSION.iso
apt-get -y autoremove
dd if=/dev/zero of=/EMPTY bs=1M
rm -f /EMPTY
echo "cleaning up dhcp leases"
rm /var/lib/dhcp/*
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 "pre-up sleep 2" >> /etc/network/interfaces

This comment has been minimized.

Copy link

davidwinter commented Apr 6, 2012

Thanks for this. Also found that the mime-types gem is throwing the following error:

Invalid gemspec in [/var/lib/gems/1.8/specifications/mime-types-1.18.gemspec]: invalid date format in specification: "2012-03-21 00:00:00.000000000Z"

Suggest that it's added along with the json gem spec removal?


This comment has been minimized.

Copy link
Owner Author

nefarioustim commented Apr 9, 2012

Thanks for the heads-up! :)

I assume the latest mime-types gemspec fixes the issue? In which case you'll need to force install of the mime-types gem 'cos the dependancy will still be the broken one. When I get chance, I'll test the gems and stick in a fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.