Page 1 of 1

SSH to forwarded port hangs in read()

Posted: 15. Mar 2010, 21:07
by ammons
I followed the user manual's instructions to set up SSH to an Ubuntu karmic guest by port forwarding. However, this command:

Code: Select all

% ssh -p 2222 ubuntu@localhost
hangs. It connects but hangs in a read(). The host runs version 3.1.4r57640 of VirtualBox on Mac OS X. It doesn't matter if I try to connect from the host or from another machine on the network.

From the guest's console, I can ssh to the guest itself on port 22, which demonstrates that the SSH daemon is running on the guest.

What am I doing wrong? I've attached the output of "VBoxManage getextradata" and "VBoxManage showvminfo"; please let me know if I should provide ore information.

Thanks.
--glenn

Re: SSH to forwarded port hangs in read()

Posted: 15. Mar 2010, 21:15
by baf
Switching network card type to an intel one instead might help.

Re: SSH to forwarded port hangs in read()

Posted: 15. Mar 2010, 21:39
by ammons
baf wrote:Switching network card type to an intel one instead might help.
Thanks for the suggestion. I tried all of the network cards, using "VBoxManage modifyvm foo --nictype1" and replacing "pcnet" with "e1000" in the "setextradata" keys where appropriate. All behaved the same way: ssh to the guest hangs in a read().

Regards.
--glenn

Re: SSH to forwarded port hangs in read()

Posted: 15. Mar 2010, 21:54
by baf
Try running ssh -dd -p xxxx localhost
and show that output. Also exactly which os x ?

Re: SSH to forwarded port hangs in read()

Posted: 15. Mar 2010, 22:02
by ammons
baf wrote:Try running ssh -dd -p xxxx localhost
and show that output. Also exactly which os x ?
I've attached the output of "ssh -vvv" (not "ssh -dd" because my SSH doesn't take that option). The exact command-line I used is at the top of the attachment.

The version of OS X is 10.5.8.

Thanks.
--glenn

Re: SSH to forwarded port hangs in read()

Posted: 15. Mar 2010, 22:07
by baf
First of all temporarily remove those id_rsa and id_dsa files as at least id_rsa looks corrupt , then retry that command again

Re: SSH to forwarded port hangs in read()

Posted: 15. Mar 2010, 22:15
by ammons
baf wrote:First of all temporarily remove those id_rsa and id_dsa files as at least id_rsa looks corrupt , then retry that command again
Same result:

Code: Select all

% ssh -vvv -p 2222 ubuntu@localhost
OpenSSH_5.2p1, OpenSSL 0.9.7l 28 Sep 2006
debug1: Reading configuration data /etc/ssh_config
debug2: ssh_connect: needpriv 0
debug1: Connecting to localhost [::1] port 2222.
debug1: connect to address ::1 port 2222: Connection refused
debug1: Connecting to localhost [fe80::1%lo0] port 2222.
debug1: connect to address fe80::1%lo0 port 2222: Connection refused
debug1: Connecting to localhost [127.0.0.1] port 2222.
debug1: Connection established.
debug1: identity file /Users/ammons/.ssh/identity type -1
debug1: identity file /Users/ammons/.ssh/id_rsa type -1
debug1: identity file /Users/ammons/.ssh/id_dsa type -1
Thanks.
--glenn

Re: SSH to forwarded port hangs in read()

Posted: 15. Mar 2010, 22:21
by baf
Any firewall running in the guest?

Re: SSH to forwarded port hangs in read()

Posted: 15. Mar 2010, 22:30
by ammons
baf wrote:Any firewall running in the guest?
Nope. This is a small Ubuntu karmic system, which I created with ubuntu-vm-builder:

Code: Select all

% sudo ubuntu-vm-builder kvm karmic --variant minbase --addpkg sudo --addpkg openssh-server --addpkg openssh-client --raw /tmp/ubuntu-karmic-bootstrap.raw
Thanks.
--glenn

Re: SSH to forwarded port hangs in read()

Posted: 16. Mar 2010, 05:05
by ammons
I'm a maroon: the network interface was not properly configured in the guest, probably because of broken udev rules. Thanks, baf, for your replies.

--glenn

Re: SSH to forwarded port hangs in read()

Posted: 28. Jun 2010, 19:41
by prashant31
Hey,
I am having the same issue, I could not able to connect to guest through ssh terminal.

ssh -p 2222 xxx@localhost
ssh: connect to host localhost port 2222: Connection refused

Where xxx is user id.

Can you help me in resolving this issue.
Find the getextradata and showvminfo in attachment.

Re: SSH to forwarded port hangs in read()

Posted: 28. Jun 2010, 22:36
by prashant31
I could able to get through it by using the following commands.

VBoxManage modifyvm "Ubuntu" --natpf1 "guestssh,tcp,,2222,,22"