Installing virtualbox on debian amd64. If you are running a mac, you might want to use debian amd64 – stretch. Load into your installed debian (MATE interface) and run commandline terminal via Applications > System Tools > MATE Terminal . If you are using other UIs of debian, just find the appropriate terminal for use.
Switch to root user
$ su
Install 2 packages. * note that you do not have to do apt-get anymore. as of Stretch, you can use apt command. This application is a superset of apt-get and apt-cache.
$ apt install build-essential module-assistant
Prepare to build kernel
$ m-a prepare
Now mount the guest iso cd from DEVICES > INSERT GUEST ADDITIONS … . Execute the installation of guest additions
$ sh /media/cdrom/VBoxLinuxAdditions.run
and you are done. Restart your virtualbox and you can now use resize.