Go to the virtualbox settings and change the network type to be bridge adapter. Then boot the box.
sudo nano /etc/network/interfaces
You will find a line saying something like iface eth0 inet dhcp. Replace this line with the following lines.
iface eth0 inet static address 192.168.1.150 netmask 255.255.255.0 network 192.168.1.0 broadcast 192.168.1.255 gateway 192.168.1.1
The new IP address of your virtual machine is on the second line. Choose an IP address high in the range (i.e. 192.168.1.150) so it is unlikely other computer will be issued with the same IP. The gateway address should be the IP of your router.
What most other tutorials forget to mention is although this gives the virtual machine a static IP, the machine cannot resolve web addresses as it does not have a nameserver (ie it can get incoming connection but can get connection to the internet). So you also need to specify a nameserver in etc/resolvconf/resolv.conf.d/base
Add the following lines (Google Public Nameservers) or use the IP address of your router.
nameserver 126.96.36.199 nameserver 188.8.131.52
And everything should work, you can test it but typing
and to cancel