Skip to content

Instantly share code, notes, and snippets.

@heroqu
Created February 11, 2016 02:10
Show Gist options
  • Save heroqu/7c69ea7bcf5c2f27c1fb to your computer and use it in GitHub Desktop.
Save heroqu/7c69ea7bcf5c2f27c1fb to your computer and use it in GitHub Desktop.
VirtualBoxGuestAddition install/upgrade for Mac OSX
#! /bin/bash
# VirtualBoxGuestAddition install/upgrade for Mac OSX
#
# VirtualBox should be installed prior to running this script
#
if [ "$EUID" -ne 0 ]; then
echo "Please run as root"
exit
fi
if [ -z $1 ]; then
SCRIPT_NAME=`basename "$0"`
cat << EOT
No version is specified! Usage example:
$ sudo ./$SCRIPT_NAME 5.0.14
(replace 5.0.14 with the real version you want to install)
EOT
exit 1
fi
VBGA_VERSION=$1
ISO_FILE=VBoxGuestAdditions_${VBGA_VERSION}.iso
cat << EOT
VirtualBoxGuestAddition version: ${VBGA_VERSION}
Downloading to file ${ISO_FILE} ...
EOT
wget http://download.virtualbox.org/virtualbox/${VBGA_VERSION}/VBoxGuestAdditions_${VBGA_VERSION}.iso -O ${ISO_FILE}
cat << EOT
Installing...
EOT
cp ${ISO_FILE} /Applications/VirtualBox.app/Contents/MacOS/VBoxGuestAdditions.iso
cat << EOT
Done.
EOT
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment