Hi Mike,
2011/7/29 Mike Gabriel <mike.gabriel@das-netzwerkteam.de>:
The connecting stuff is a bit tricky...
- x2gostartagent will try to detect a free server-side port >30000. This port is put into the session database table. (Make sure you do not have other server-side stuff running that claims ports between 30000 and 30000++. [...] - x2goclient now tries to set up a forwarding tunnel from client to server (-L 30000:localhost:30015) - if the local port 30000 (the first one in the above expression) is already in use, it simply selects another port. Each selected port is probed before usage. That is done by x2goclient.
OK, will this also work if the server starts x2goclient while an incoming tunnel is active? Example:
Client CA connects to server SA. No other sessions are running on either, so ssh on CA forwards local port 30001 to remote port 30001 on SA. Server SA registers server side port 30001 in the session database.
Server SA starts an x2goclient session to server SB, where no sessions are running. Will x2goclient on server SA then detect that port 30001 is already in use on SA?
Let's say that SA does start a session to SB on 30001 (both sides). Client CA disconnects (suspends) SA and then resumes the suspended session on SA. That's the point where I ran into trouble with "the remote proxy closed the connection while negotiating …". Moving SB:s port range to a different one than SA worked around my problems.
I discovered the conflicts about a year ago and I've been using the workaround (separate port ranges for each server) ever since, perhaps unnecessarily with the latest x2go* versions.
x2goclient-cli does sometime leave ssh running on the client, I've added code to deal with it (see http://wiki.x2go.org/x2goclient-cli).
Cheers, Daniel