views:

8569

answers:

4

Host system is Vista, guest named BoxInABox is Debian lenny. The guest is configured in VirtualBox settings to use NAT.

To set up port forwarding for ssh into the guest, I followed the directions at this link: http://mydebian.blogdns.org/?p=148. On the host I did:

vboxmanage setextradata BoxInABox "VBoxInternal/Devices/pcnet/0/LUN#0/Config/ssh/HostPort" 2222 vboxmanage setextradata BoxInABox "VBoxInternal/Devices/pcnet/0/LUN#0/Config/ssh/GuestPort" 22 vboxmanage setextradata BoxInABox "VBoxInternal/Devices/pcnet/0/LUN#0/Config/ssh/Protocol" TCP

and restarted the guest. Now if I do nmap -p 2222 on the host I can see that the port is "open", but when I try this on the guest host:

ssh -p 2222 localhost

I get this: ssh_exchange_identification: Connection closed by remote host

I don't really know how to diagnose this any further. ssh to localhost on the guest works just fine.

*edited: I actually did try this on the host, not the guest as originally typo'd.

A: 

This might help?

http://support.microsoft.com/kb/926179

Anthony :-) CodersBarn.com

IrishChieftain
'fraid not. IPSec doesn't come into my scenario, as far as I can see, and the cited kb article is about Windows servers behind NAT-T. In this case it's a Debian guest. I did try it though, since it's just a registry edit -- no change.
Joe
+1  A: 

update: Thing to try:

  • Try port forwarding for other protocol. say http.
  • Stop the ssl demon and see if the error message change ( will give you hint if you arrive at the guest ).
  • Use wireshark on the guest to see if packets arrive.
  • Cancel the upvote. It will return your question to the unanswered list. There will be more chance for fresh replies.

before update:

when I try this on the guest:

ssh -p 2222 localhost I get this:

ssh_exchange_identification: Connection closed by remote host

You should try the ssh command from the host and not from the guest. On the guest probably port 22 will work.

Igal Serban
Good catch, I meant "when I try this on the host" and that's what I did.
Joe
A: 

I think this is an sshd error. Check the /etc/hosts.allow and /etc/hosts.deny files on your server and correct them according to your needs. Then restart sshd.

StarWind Software
A: 

Found it.

You need to reboot the Virtual box and then enable the Vista firewall to allow port 2222. this worked for me. Repeat for other ports.

Good Luck!

Roel