Ubuntu 14:

All commands are as root :

sudo su
apt-get update
apt-get install -y apache2 php5 php5-mysql libapache2-mod-php5 php-soap dkms
nano /etc/apt/sources.list  

 

_~/etc/apt/sources.list _

deb http://download.virtualbox.org/virtualbox/debian trusty contrib
wget -q http://download.virtualbox.org/virtualbox/debian/oracle_vbox.asc -O- | sudo apt-key add - 
apt-get update
apt-get -y install virtualbox-5.0 
vboxmanage --version 
nano vboxextpack.sh

 

_~vboxextpack.sh_

#!/bin/bash
version=$(vboxmanage -v)
echo $version
var1=$(echo $version | cut -d 'r' -f 1)
echo $var1
var2=$(echo $version | cut -d 'r' -f 2)
echo $var2
file="Oracle_VM_VirtualBox_Extension_Pack-$var1-$var2.vbox-extpack"
echo $file
wget http://download.virtualbox.org/virtualbox/$var1/$file -O /tmp/$file
sudo VBoxManage extpack install /tmp/$file 
chmod 777 ./vboxextpack.sh
./vboxextpack.sh 
vboxmanage list extpacks

Now go to :

http://download.virtualbox.org/virtualbox/ and find the version which correlates to vbox-version and wget it.

Example :

wget http://download.virtualbox.org/virtualbox/5.0.0_RC1/VBoxGuestAdditions_5.0.0_RC1.iso 

Move to local ISO folder to add to guests :

mkdir /srv/VirtualBox
mkdir /srv/VirtualBox/ISOS
mv VBoxGuestAdditions*.iso /srv/VirtualBox/ISOS/