Here is what you need to do to successfully build and install the Oracle VirtualBox Guest Additions on Debian 5.
First mount the VirualBox guest additions (Extensions Pack) media (Host-D). Then either mount your Debian 5 installation media or configure your Debian 5 package manager to download the necessary packages from a suitable repository.
# apt-get update # apt-get install gcc make # apt-get install linux-headers-$(uname -r) # cd /media/cdrom # bash VBoxLinuxAdditions.run
Then reboot your appliance and check that you can auto-resize the guest display. If not, check the build logs which are available under /var/log.