Page 1 of 1

port forwarding connection reset problem

Posted: 29. Sep 2009, 15:38
by smaring
Host: Win XP running VB 3.0.6 in NAT mode
Guest: Ubuntu 9.04

I'm running dynamic port forwarding on my guest over an ssh connection ala "ssh -C -D 1080 me@externalserver", which effectively creates a SOCKS5 proxy listening on 1080 on the guest. I can configure Firefox within the guest to confirm the successful operation of the proxy.

My Host has been configured as follows for this VM:

Code: Select all

      <ExtraDataItem name="VBoxInternal/Devices/pcnet/0/LUN#0/Config/socks/HostPort" value="1566"/>
      <ExtraDataItem name="VBoxInternal/Devices/pcnet/0/LUN#0/Config/socks/GuestPort" value="1080"/>
      <ExtraDataItem name="VBoxInternal/Devices/pcnet/0/LUN#0/Config/socks/Protocol" value="TCP"/>
When I try to configure my Firefox proxy on my host for localhost:1566 I always get a "Connection reset by peer"

Running Wireshark on my guest confirms the receipt of traffic from 10.0.2.2 to 10.0.2.15 on port 1080

No firewall is running on the Host.

What is my problem?

Re: port forwarding connection reset problem

Posted: 29. Sep 2009, 16:29
by smaring
I tried setting up ssh port forwarding and I am experiencing the same sort of problem with that ... no response back to the putty session.

I have a question. Why is the source 10.0.2.2? I don't see that interface on my host or my guest.

Also, I'm configured for NAT, but my host interface is:

Ethernet adapter VirtualBox Host-Only Network:

Connection-specific DNS Suffix . :
Description . . . . . . . . . . . : VirtualBox Host-Only Ethernet Adapter
Physical Address. . . . . . . . . : 08-00-27-00-80-97
Dhcp Enabled. . . . . . . . . . . : No
IP Address. . . . . . . . . . . . : 192.168.56.1
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . :

Re: port forwarding connection reset problem

Posted: 8. Oct 2009, 00:53
by Cypriot
Hi There i am having the same problem please help..

I have installed Ubuntu on windows7 x64 with VBOX 3.0.8 on NAT mode.

my problem is when i try to connect to 2222 by typing on internet explorer 192.168.1.100:2222 it is working ok
but when i try to connect 192.168.1.100:8000 it is not connecting
The connection was reset
The connection to the server was reset while the page was loading.


<ExtraDataItem name="VBoxInternal/Devices/pcnet/0/LUN#0/Config/guestssh/Protocol" value="TCP"/>
<ExtraDataItem name="VBoxInternal/Devices/pcnet/0/LUN#0/Config/guestssh/GuestPort" value="22"/>
<ExtraDataItem name="VBoxInternal/Devices/pcnet/0/LUN#0/Config/guestssh/HostPort" value="2222"/>
<ExtraDataItem name="VBoxInternal/Devices/pcnet/0/LUN#0/Config/web/Protocol" value="TCP"/>
<ExtraDataItem name="VBoxInternal/Devices/pcnet/0/LUN#0/Config/web/GuestPort" value="80"/>
<ExtraDataItem name="VBoxInternal/Devices/pcnet/0/LUN#0/Config/web/HostPort" value="8000"/>


Where am i going wrong ????? please help.

Re: port forwarding connection reset problem

Posted: 8. Oct 2009, 03:58
by Perryg
@Cypriot
Your other posts have been deleted for cross posting. Please read the Forum Posting Guide.
Any more will result in a warning.

Re: port forwarding connection reset problem

Posted: 8. Oct 2009, 10:53
by Cypriot
Sorry about this i am using the forum first time i wont do it again .

Re: port forwarding connection reset problem

Posted: 8. Oct 2009, 17:36
by smaring
well ... I changed to an e1000 interface and suddenly I can at least connect via ssh! woohoo! might be some sort of bug with pcnet in 3.0.6 ... who knows

so, now, I have this for my extra data ...

Code: Select all

Key: VBoxInternal/Devices/e1000/0/LUN#0/Config/ssh/Protocol, Value: TCP
Key: VBoxInternal/Devices/e1000/0/LUN#0/Config/ssh/GuestPort, Value: 22
Key: VBoxInternal/Devices/e1000/0/LUN#0/Config/ssh/HostPort, Value: 2222
Key: VBoxInternal/Devices/e1000/0/LUN#0/Config/proxy/Protocol, Value: TCP
Key: VBoxInternal/Devices/e1000/0/LUN#0/Config/proxy/GuestPort, Value: 1080
Key: VBoxInternal/Devices/e1000/0/LUN#0/Config/proxy/HostPort, Value: 1566
BUT ... I am STILL getting connection resets from the guest when I try to connect to my proxy on port 1566.

I ran Wireshark in the guest and compared a successful local proxy connection to one from the host. The host is getting a [RST, ACK] for every [SYN] packet it sends.

I'm now suspicious that this is either an sshd config or iptables issue in my Ubuntu instance. Although, my sshd config looks pretty clean and Firestarter is not yelling at me about blocking any packets. In fact, I'm wide open to 10.0.2.2, as far as I can tell.

I'm still stumped on this one ...

[SOLVED] Re: port forwarding connection reset problem

Posted: 8. Oct 2009, 18:07
by smaring
yeah ... my problem was in the application layer; I figured as much since my ssh connection was working

I didn't read the man page for ssh closely enough with regard to dynamic port forwarding. It says that the default behavior of the "-D" or "DynamicForward" option is to bind to localhost, FOR LOCAL USE ONLY, if the binding host is not specified!

so ....

I did this ...

ssh -C -D *:1080 me@myserver

and I can now proxy from my host to port 1566! :D

-Steve Maring