Skip to content

Instantly share code, notes, and snippets.

@boktai1000
Created March 25, 2019 04:20
Show Gist options
  • Save boktai1000/ef9091d76fcd151e5a9b18d25705dcc4 to your computer and use it in GitHub Desktop.
Save boktai1000/ef9091d76fcd151e5a9b18d25705dcc4 to your computer and use it in GitHub Desktop.
# You can run this script directly with the following command:
# Append your version number after "| sudo bash -s" ; Example- "| sudo bash -s 6.0.4"
# curl -s https://gist.githubusercontent.com/boktai1000/ef9091d76fcd151e5a9b18d25705dcc4/raw/df0bea473765ef72f623513e3114781467e23b86/el7-install-vboxgav.sh | sudo bash -s
# Set VirtualBox Variable so argument from command line gets passed through
VBOX_VERSION=$1
# Install prereqs
yum install -y bzip2 kernel-devel gcc
# Change to temp directory and download VboxGuestAdditions
cd /tmp
curl -O http://download.virtualbox.org/virtualbox/$VBOX_VERSION/VBoxGuestAdditions_$VBOX_VERSION.iso
# Mount and run iso
mount -o loop,ro VBoxGuestAdditions_$VBOX_VERSION.iso /mnt
sh /mnt/VBoxLinuxAdditions.run
# Cleanup
umount /mnt
rm /tmp/VBoxGuestAdditions_$VBOX_VERSION.iso
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment