The basic steps used are from https://www.vagrantup.com/docs/virtualbox/boxes.html.
Run the script below to install, upgrade or downgrade the VirtualBox Guest Additions for Linux. The script will install the latest version by default, but also allows specifying a different version as an argument. Note: The script requires the bzip2 and wget packages.
If the guest already has a shared folder with the host, one can also copy VBoxGuestAdditions.iso
from the VirtualBox installation folder (usually C:\Program Files\Oracle\VirtualBox
on Windows) instead of downloading the Guest Additions using wget
. However, mounting the .iso from a shared folder probably won't work--the file needs to be copied to the guest's filesystem.