Skip to content

Instantly share code, notes, and snippets.

@hollodotme
Last active June 22, 2018 14:48
Show Gist options
  • Save hollodotme/9388876996845ed7397d to your computer and use it in GitHub Desktop.
Save hollodotme/9388876996845ed7397d to your computer and use it in GitHub Desktop.
# prepare
$ sudo apt-get install -y linux-headers-generic build-essential dkms
# get the right ISO from http://download.virtualbox.org/virtualbox/
$ wget http://download.virtualbox.org/virtualbox/5.2.8/VBoxGuestAdditions_5.2.8.iso
# create a mount folder
$ sudo mkdir /media/VBoxGuestAdditions
# mount the ISO
$ sudo mount -o loop,ro VBoxGuestAdditions_5.2.8.iso /media/VBoxGuestAdditions
# install the guest additions
$ sudo sh /media/VBoxGuestAdditions/VBoxLinuxAdditions.run
# remove the ISO
$ rm VBoxGuestAdditions_5.2.8.iso
# unmount the ISO
$ sudo umount /media/VBoxGuestAdditions
# remove the mount folder
$ sudo rmdir /media/VBoxGuestAdditions

One-Liner

VERSION='5.2.8' && \
sudo apt-get install -y linux-headers-generic build-essential dkms && \
sudo wget "http://download.virtualbox.org/virtualbox/$VERSION/VBoxGuestAdditions_$VERSION.iso" && \
sudo mkdir /media/VBoxGuestAdditions && \
sudo mount -o loop,ro "VBoxGuestAdditions_$VERSION.iso" /media/VBoxGuestAdditions && \
sudo sh /media/VBoxGuestAdditions/VBoxLinuxAdditions.run && \
sudo umount /media/VBoxGuestAdditions && \
sudo rm -rf "VBoxGuestAdditions_$VERSION.iso" && \
sudo rmdir /media/VBoxGuestAdditions
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment