The errors seem to be because you have a whole bunch of programs missing on your guess. The shell script tries to install the graphical X guest additions (even though you apparently don't have X installed on your server). It also tries to compile the guest kernel modules, but you have neither GCC nor the kernel headers installed, so it fails.
Normally the package manager would automate installing dependencies you need, but a shell script can't do that.
Fortunately, the Guest Additions have been available in the Ubuntu universe repositories for a while. You can install them using from the package
virtualbox-guest-utils (on the guest). You probably want to skip installing the
virtualbox-guest-x11 package which
virtualbox-guest-utils recommends, since you don't have X. The necessary compilers, headers, and DKMS stuff should get installed automatically. Be aware that this will use roughly 200 MB of additional disk space.