Debian and Virtualbox (updated for Stretch/9.3)

By Dag, on December 30th 2016, updated February 8th 2018.

Dealing with guest additions on a fresh VM, and VirtualBox in general.

Installing guest additions:

# apt update; apt upgrade (reboot after this if kernel upgrade)
# apt install build-essential linux-headers-$(uname -r)
(Insert Guest Additions CD image...) get optical drive device name with 'blkid' if needed.
# mount /dev/sr0 /media/cdrom
# /media/cdrom/VBoxLinuxAdditions.run
^ May show weird screen at completion,
I repeat it twice for a more intuitive result.
^ If you get permission denied, you may have success with using an interpreter:
# sh ./VBoxLinuxAdditions.run
# shutdown -r now