Page 1 of 1

Cannot connect to Guest using SSH or Putty

Posted: 6. Jul 2012, 10:32
by rats
Hi,

I have a problem connecting via Putty or ssh to an Ubuntu 10.04 server running as a guest on VirtualBox.

I have a new install of Ubuntu 10.04 server with VBox running on a Dell PowerEdge T-100 server. The Dell has 4 GD of RAM. I have installed Ubuntu 10.04 Server as a VM on VBox. The current network settings for the guest are:
  • Attached to: Bridged Adapter
    Name: eth0
    Adapter Type: Intel Pro/1000 MT Desktop
    Promiscuous Mode: Deny
    Cable connected
Both the Host and Guest installs are new and clean- no apps or services were installed, VBox and OpenSSH were installed using app-get install after Ubuntu was installed.

The default Firewall embedded in Ubuntu has not been activated on either the Host of Guest.

The Host, Guest and other computers are all on the same subnet- 172.16.0.nnn and all have static IPs.

OpenSSH Host and Client are installed and running on both the Host and Guest.
I can ping the Guest from any computer on the LAN and the Guest can ping any computer on the LAN.

I can connect to the Host from a Windows box using either Putty or ssh.
I CANNOT CONNECT TO THE GUEST FROM EITHER THE HOST OR THE WINDOWS USING EITHER PUTTY OR SSH. And therein lies my problem.

I have looked at a lot “How To’s” and forum postings and it appears there are two ways to setup the Guest to allow connections via Putty and ssh. One way, and my preference, is the setup I show above. The other way is to use a NAT adapter and Port Forwarding.

I have tried both ways with basically the same results.

Connecting from the Windows box to the Guest’s IP I get a message: “Network error: Software caused connection abort.

Connecting from the Host to the Guest’s IP I get a message: “Connection reset by peer”.

I do not know what to do next to get this working. Any and all suggestions will be greatly appreciated.

Thanks.

Re: Cannot connect to Guest using SSH or Putty

Posted: 6. Jul 2012, 12:51
by Martin
If you can ping your guest then most probably the OpenSSH in the guest is not configured correctly to listen on the right IP address / interface.

Re: Cannot connect to Guest using SSH or Putty

Posted: 6. Jul 2012, 13:09
by rats
Thanks for the quick reply Martin.

Does VBox change the SSH configuration? Both the Host and the Guest were installed from the same iso so I think the configuration should be the same for each of them. But, I will look at it.

Thanks again,

Re: Cannot connect to Guest using SSH or Putty

Posted: 6. Jul 2012, 14:30
by rats
Martin, you are my hero of the day. Your reply was 99.5% correct.

OpenSSH did not need to be re-configured, it needed to be replaced.

I ran some tests on the configuration and everything checked out OK. But I still could not connect.

I then tried to login to SSH on the VM from the VM (ssh -v localhost). This displayed a long debugging report. At the very last line of the report was the line "Read from socket failed: Connection reset by peer". I thought to myself I have wasted enough time on this problem. Why not just remove OpenSSH and re-install it. So, that is what I did, I removed OpenSSH Server, Client and SSH. Then I re-booted the VM.

When the login screen came up I went to a Windows computer on the LAN, opened Putty and connected to the VM. No more problem.

It took me longer to write the post asking for help than it did to fix the problem. I have been wrestling with this problem off and on for a week. It really feels good to have it solved.

Thanks for your help.