# ssh from FreeBSD to OpenBSD install in VirtualBox



## mfaridi (Oct 5, 2010)

I use FreeBSD 8.1 AMD64 and I install VirtualBox and Install OpenBSD with Virtualbox . During installation I use normal or default networking my openBSD system IP is 10.2.2.10 and my FreeBSD IP is 192.168.0.90, how I can ssh from FreeBSD to OpenBSD installed in Virtualbox, I use default setting of VirtualBox for networking and it is NAT.


----------



## SirDice (Oct 5, 2010)

First off make sure both are in the same network segment. This isn't strictly necessary but it'll make things easier. After that you connect like normal, it doesn't matter if it's OpenBSD or FreeBSD.


----------



## mfaridi (Oct 5, 2010)

I go and chagne IP of OpenBSD installed in VirtualBox and change it to 192.168.0.95 with 255.255.255.0 netmask and I set gateway , but when I run ping 192.168.0.95 in FreeBSD box I see this error 

```
ping: sendto: Host is down
ping: sendto: Host is down
ping: sendto: Host is down
ping: sendto: Host is down
```
and I can not connect with ssh


----------



## da1 (Oct 5, 2010)

routing table problems maybe ?


----------



## Savagedlight (Oct 5, 2010)

mfaridi said:
			
		

> I use FreeBSD 8.1 AMD64 and I install VirtualBox and Install OpenBSD with Virtualbox . during installation I use normal or default networking my openBSD system IP is
> 10.2.2.10 and my FreeBSD IP is 192.168.0.90 , how I can ssh from FreeBSD to OpenBSD installed in Virtualbox , I use default setting of VirtualBox for networking and it is NAT ,



Let's see if I understand this post correctly..
You use FreeBSD as the host OS. This host OS has the IP 10.2.2.10.
Virtualbox runs on this host OS.
OpenBSD is installed as a *V*irtual *M*achine in Virtualbox, and has the IP 192.168.0.90. It is using the NAT feature of Virtualbox, so all traffic leaving the host OS from this VM has the source address 10.2.2.10.

You're wondering why the host OS is unable to connect to the virtual machine?

First thing which comes to my mind: Can you post the output from the following command so we can better see what your configuration is like?
`$ ifconfig -a`


----------



## kpa (Oct 5, 2010)

I think you can't communicate with the guest OS in VirtualBox if the guest uses NAT networking, bridged setting should work.


----------



## Galactic_Dominator (Oct 5, 2010)

kpa said:
			
		

> I think you can't communicate with the guest OS in VirtualBox if the guest uses NAT networking, bridged setting should work.



No you can do it, but it a lot easier to just bridge it, otherwise you have to edit Vbox's port forwarding setup and you run into restrictions like only one VM can have port 22 forwarded to it, etc.


----------



## wblock@ (Oct 6, 2010)

From earlier this year, a link to an article showing port forwarding in VirtualBox: http://forums.freebsd.org/showpost.php?p=81368&postcount=11

For me, it's easier to edit the XML file--once the layout is known--than give the convoluted VBoxManage commands.


----------



## mfaridi (Oct 6, 2010)

Thanks all guys , I change NAT to bridge and I give OpenBSD new IP and I can ssh , but I must check port forwarding in VirtualBox next time .


----------

