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 firstname.lastname@example.org
acknowledgements to comments and answers from: