Skip to content

Instantly share code, notes, and snippets.

@dceoy
Last active August 2, 2016 16:46
Show Gist options
  • Save dceoy/6101381 to your computer and use it in GitHub Desktop.
Save dceoy/6101381 to your computer and use it in GitHub Desktop.
[RHEL] Install virtualbox guest additions
#!/usr/bin/env bash
if [[ -f "/etc/lsb-release" ]]; then
apt-get --version
sudo apt-get -y update
sudo apt-get -y install gcc make
elif [[ -f "/etc/redhat-release" ]]; then
if `dnf --version`; then
sudo dnf -y update
sudo dnf -y install gcc make
elif `yum --version`; then
sudo yum -y update
sudo yum -y install gcc make
fi
fi
vbga_ver="$(curl http://download.virtualbox.org/virtualbox/LATEST.TXT)"
curl http://download.virtualbox.org/virtualbox/${vbga_ver}/VBoxGuestAdditions_${vbga_ver}.iso -o /tmp/vbga.iso
sudo mount -t iso9660 /tmp/vbga.iso /mnt/
sudo /mnt/VBoxLinuxAdditions.run
# Virtualbox -> Devices -> Install Guest Additions...
mount /dev/cdrom /mnt
/mnt/VBoxLinuxAdditions.run
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment