Skip to content

Instantly share code, notes, and snippets.

@grimen
Created July 22, 2012 19:11
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save grimen/3160742 to your computer and use it in GitHub Desktop.
Save grimen/3160742 to your computer and use it in GitHub Desktop.
Vagrant: Upgrade "Guest Additions" for a box.
# SOURCE:
# - http://hedgehogshiatus.com/upgrade-virtualbox-guest-additions-in-a-vargr
# - http://software.darrenthetiger.com/2012/01/installing-virtualbox-guest-additions-on-a-vagrant-lucid64-box
$ vagrant ssh
vagrant@box:~$ wget -q -O - https://raw.github.com/gist/3160742/vagrant-guest_additions-upgrade.sh | sh
$ vagrant halt
$ vagrant package
# Created: package.box
#!/usr/bin/env sh
# Upgrading "Guest Additions"...
VB_GA_VERSION='4.1.18'
sudo apt-get update
sudo apt-get install build-essential module-assistant linux-headers-$(uname -r) dkms python-software-properties -y
sudo add-apt-repository ppa:debfx/virtualbox
cd /opt
sudo wget -c http://download.virtualbox.org/virtualbox/$VB_GA_VERSION/VBoxGuestAdditions_$VB_GA_VERSION.iso -O VBoxGuestAdditions_4.1.18.iso
sudo mount VBoxGuestAdditions_$VB_GA_VERSION.iso -o loop /mnt
cd /mnt
sudo sh VBoxLinuxAdditions.run --nox11
cd /opt
sudo rm *.iso
exit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment