Page 1 of 1

Cant connect from another pc to Guest OS installed on VBOX

Posted: 13. Feb 2014, 18:43
by Blendi
Hello Everybody.

I am getting ready for a project and I need support from people that have more experience.

I have a Lenovo X220 windows 7 where VBOX is installed and hosts 2 Virtual machines, Red hat 6.4 with respective IPs --> 192.168.2.81 and 192.168.2.82 I want to connect to These two machines via SSH and I have used NAT Network with Port Forwarding Option. I have forwarded all connection comming to port 22001 to 192.168.2.81:22 and 22002 to 192.168.2.82. So now form the Host OS windows 7 if I try to connect to 127.0.0.1:22001 and 127.0.0.1:22002 I will connect to the virtual machines.

I tried to connect from another PC that is at the same subnet that my Lenovo Laptop is (192.168.1.0) writing my Lenovo IP address followed by the port 22001 like 192.168.1.3:22001 but this time I am not ale to connect to the machine. All Firewalls are down.

I wonder if I do something wrong or I have the wrong concept about Port Forwarding???

Later I changed the network type and I fixed all the issues.

Does anybody know if it is possible to connect from another PC to Guest OS that are hosted to another PC via SSH connection?

Thank you in Advance

Re: Cant connect from another pc to Guest OS installed on VB

Posted: 13. Feb 2014, 19:40
by mpack
Is there some reason you can't just use bridged networking?

Re: Cant connect from another pc to Guest OS installed on VB

Posted: 14. Feb 2014, 00:58
by Blendi
Because I am using the Laptop in different locations with different network IPs. So at home I will have ip 192.168.1.3 and at my company I will have 10.20.36.65 IP. Inside the virtualbox I have installed 2 Oracle database in RAC on Redhat 32bit OS. When I start Redhat dataases wont work because IP are different than the one I have declared while Oracle database was installed. Currently I am using Bridged Adaptor and when I connect to company network or other network different than my home subnet I use Host-Only option.

I just wonder if there is a way to connect to Guest system from another physical machine via ssh
picture1.PNG
picture1.PNG (9.18 KiB) Viewed 1108 times
So as you can se in the picture in VBOX Network Settings I have forwarded all traffic coming to port 22001 to 192.168.2.81:22 and all traffic coming to port 22002 to 192.168.2.82:22 and I am expecting that when I type on putty 192.168.1.3:22001 I will connect to first Redhat server and 192.168.1.3:22002 I will connect to second Redhat server. Please Correct me if I have understand wrong NAT configuration in VBOX.

So to conclude it if the above was going to work for me I would just create some rules and everything would be easier. :)

Again thank you for your help.

Re: Cant connect from another pc to Guest OS installed on VB

Posted: 14. Feb 2014, 01:21
by Perryg
Normally when using a laptop that is carried to different locations you would use a combination of VBox NAT and Host-only. The VBox NAT is to be able to get the Internet and the Host-Only is for host to guest communication.

Re: Cant connect from another pc to Guest OS installed on VB

Posted: 14. Feb 2014, 08:47
by BillG
File sharing through NAT is limited. By design, NAT is a one-way address translation process (so that private machines can initiate connections to "foreign" or public servers but public machines cannot initiate a connection to private machines behind NAT).