I am using mac os x as host so I have decided to choose the option of using my terminal to ssh into my virtual box ubuntu.
first select the vm inside virtual box and go to settings > network > portforwarding

then add in the rule with host port as 3022 and guest port as 22 and the name as ssh. Leave everything else as blank.

install ssh server packages in the guest ubuntu os
sudo apt-get install openssh-server
finally open up your terminal and then type the following if you want to login as root
ssh -p 3022 root@127.0.0.1
acknowledgements to comments and answers from:
http://stackoverflow.com/a/10532299/80353
and
http://stackoverflow.com/questions/5906441/how-to-ssh-to-a-virtualbox-ubuntu-guest-externally-through-a-windows-host#comment19298721_10532299