Page 1 of 1

Ubuntu Server SSH Networking Issues

Posted: 5. May 2010, 23:06
by themidiman
I thought I had this working correctly at one time but now I'm confused. Ubuntu Server installs just fine with the NAT option for eth0. During install it looks as though apt runs just fine which tells me that it's communicating on the network. Ideally I'd like to be able to communicate via SSH client on my Win 7 host so I can use Ubuntu Server as a local test server environment, but I can never get it to communicate to the host OS. I've tried enabling all 4 network interfaces to see if I can get a valid IP address I can SSH to. If I leave it at NAT, the guest OS can communicate to the Internet but I can't get my HOST environment to SSH into it. The IP range it is assigned via DHCP is in the 10.0.x.x range. I can apt-get and ping the Internet just fine but not the host OS. At one time if I could get a 192.168.x.x address via another network setup that used to work but now I must be doing something wrong. What's the correct procedure to getting this to work? What options should I use? Is one interface enough or should I use two? What's the best way?

Thx in advance.

Re: Ubuntu Server SSH Networking Issues

Posted: 5. May 2010, 23:57
by Perryg
If you have a router in the network set the network adapter to use bridged, if not then set the network adapter to use host-only. If you need the internet on the guest add a second adapter set to NAT.

You will need to run ifconfig -a on the Linux guest and ipconfig /all on the Windows host to see what the network subnets are, but it should be 192.168.56.x

Re: Ubuntu Server SSH Networking Issues

Posted: 6. May 2010, 06:10
by Hachiman
themidiman wrote: Ideally I'd like to be able to communicate via SSH client on my Win 7 host so I can use Ubuntu Server as a local test server environment, but I can never get it to communicate to the host OS.
If you need communicate with your guest with NAT networking you need define port-forwarding rule. (please see http://www.virtualbox.org/manual/ch06.html#natforward for more details)

Re: Ubuntu Server SSH Networking Issues

Posted: 7. May 2010, 21:10
by themidiman
You will need to run ifconfig -a on the Linux guest and ipconfig /all on the Windows host to see what the network subnets are, but it should be 192.168.56.x
Yes! Thank you. This is what my host shows for ifconfig on the host-only interface which is currently eth0:
eth0   Link encap:Ethernet HWaddr <Mac Address>
       inet addr:192.168.56.101 Bcast:192.168.56.255 Mask:255.255.255.0


On my network interfaces in Win7 control panel for VirtualBox host only Network, the IP address is: 192.168.56.1

So if I try to start up a ssh connection on my client I tried each of those addresses in the host field to try it out and I get "host is unreachable" for either one. What am I doing wrong? Which one should I be trying to connect to? 56.101 or 56.1?

Re: Ubuntu Server SSH Networking Issues

Posted: 7. May 2010, 21:25
by Perryg
Since Win 7 is the host and has the .1 then to connect to the guest (from the host) you would use .101
Make sure that ssh is installed on the guest and also make sure that you do not have a firewall problem.

Re: Ubuntu Server SSH Networking Issues

Posted: 7. May 2010, 21:47
by themidiman
Perryg wrote:Since Win 7 is the host and has the .1 then to connect to the guest (from the host) you would use .101
Make sure that ssh is installed on the guest and also make sure that you do not have a firewall problem.
I thought it was the .101 address which is why I'm mystified. Inside my guest I have double-checked the ssh process installed and running, I have ufw disabled, and I've also temporarily disabled my firewall in the host for the purposes of connecting to the guest and I'm still getting "host unreachable". Any other ideas?

Thank you very much!

Re: Ubuntu Server SSH Networking Issues

Posted: 7. May 2010, 21:58
by Perryg
Don't know what to tell you. I just tried and it connects perfectly.
I use putty as my client on Windows 7 (host) and have openssh server installed on the Ubuntu 10.04 (guest).

Re: Ubuntu Server SSH Networking Issues

Posted: 7. May 2010, 22:21
by themidiman
I've been using SSH Secure Shell Client for Windows (the last free for educational institutions version released), so to rule out the possibility of software client variability I tried downloading PuTTY. I can connect to remote servers, but to the VBox guest I still can't connect. I'm guessing it has something to do with Windows. I'll try the NAT route and see how that goes.

Thanks for your help thus far.