ssh from FreeBSD to OpenBSD install in VirtualBox

mfaridi

Aspiring Daemon

Reaction score: 16
Messages: 716

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

Administrator
Staff member
Administrator
Moderator

Reaction score: 11,625
Messages: 37,973

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.
 
OP
mfaridi

mfaridi

Aspiring Daemon

Reaction score: 16
Messages: 716

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
Code:
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
 

Savagedlight

Well-Known Member

Reaction score: 100
Messages: 369

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 Virtual Machine 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

Beastie's Twin

Reaction score: 1,842
Messages: 6,318

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

Galactic_Dominator

Active Member

Reaction score: 37
Messages: 196

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.
 
OP
mfaridi

mfaridi

Aspiring Daemon

Reaction score: 16
Messages: 716

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