ssh into virtualbox

I have virtualbox on my system with Ubuntu 10.04 as a test bed for something I'm writing, if I want to ssh into this from my FreeBSD system how would I do this? I try and ssh into the IP address it gives me in ifconfig but it just won't connect.
 
For NAT:

Code:
Settings/Network/Advanced/Port Forwarding/+

[B]Host IP      Host Port     Guest IP     Guest Port[/B]
127.0.0.1      2222        10.0.2.15        22

OK

Start the guest.
% ssh -p 2222 127.0.0.1

If you want to ssh in from an external machine, add another entry for the host machine's IP address.
 
And just in case you have more than one virtual machines running from Virtualbox, I'd recommend you to use a static IP on your virtual machine.
 
Back
Top