# ssh into virtualbox



## kr651129 (Mar 10, 2012)

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.


----------



## wblock@ (Mar 10, 2012)

For NAT:


```
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.


----------



## mamalos (Mar 15, 2012)

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.


----------

