Session Start: Mon Aug 17 12:51:17 2015 Session Ident: #x2go 03[12:51] * Now talking in #x2go 03[12:51] * Topic is 'X2Go is a suite to build Linux based terminal farms. The channel's language is English. For further info on X2Go please visit: http://www.x2go.org.' 03[12:51] * Set by MeinNameIstRetro on Wed Jun 24 22:59:11 2015 01[12:51] good afternoon 01[12:57] is there someone listening ? [12:57] sometimes, yes... 01[12:57] ;-) 01[12:58] ok. first I have to say this is my first contact with x2go development. Althought I use x2go for a long time, and vefore I was using nx. 01[12:58] so please be pationt with me. 01[12:59] patient [13:00] ok? 01[13:00] as I read, it is neccessary to edit the x2gostartagent, SSH_Port=30000 parameter for each host on the network, in order to be able to connect to multiple hosts from one windows client (multiple instances of the X2go client) 01[13:01] I have written a small patch for the x2gostartagent, to set the SSH_Port depending on the last octet of the servers IP Adress. 01[13:01] I konw that might not be perfect, but should avoid collisions on class C-Networks [13:02] hum [13:02] is it necessary to edit x2gostartagent? that sounds wierd 01[13:02] I can provide the patch ( a few lines) - but I havent set up GIT, so maybe someone more experienced than me can review and possibly propose the patch on git. [13:02] well we're probably using a fixed port number 01[13:03] Ionic - yes [13:03] but wouldn't the client also need a change? 01[13:03] Port is fixed to 30001 - and is later checked in the script if it is free 01[13:03] Ionic, no 01[13:03] no, client dont need to change [13:03] hmhmhm 01[13:04] I tested (well, others tested that before) 01[13:04] and its working 01[13:05] althought I dont know if there will be any side - effects - but there should nor be some. Because the Script x2gostartagent try to find a free port beginning from port 30001 [13:05] so, why would you need to change that starting port in the first place? 01[13:06] because You cant use multiple client sessions on windows if the servers use all the same port [13:06] well each session must use a different port which is also registered in the DB, right? 01[13:06] no 01[13:07] it is the reverse port 01[13:08] the problem is well aware, and already known and tested. But users have to edit x2gostartagent manually, after each update [13:09] well I'm not aware of it, at least not until now 01[13:09] so I suggest to start to search for a free port from 30.000 + last octet of the IP adress - to avoid possible conflicts in most cases. 01[13:10] Ionic, one momet, I will give You the link to the post [13:10] the last octet isn't really a good fingerprint 01[13:12] https://www.mail-archive.com/x2go-user@lists.berlios.de/msg00547.html 01[13:12] check this out 01[13:13] I know, using the last octet is not perfect. [13:13] oh that's old 01[13:13] But unless there is a better solution, it will avoid collisions in most cases 01[13:14] but we only have lets say 40.000 Ports available, so it is not possible to map 256*256*256*256 IP4 Adresses to Ports ... 01[13:14] yes, it is old, but still true [13:14] I still don't understand why that is, though 01[13:14] me neither [13:14] does the client connect back to the server? [13:14] err 01[13:14] because it should be able to handle the same port from different hosts [13:14] other way around [13:14] does the server connect back to the client? 01[13:15] I dont know. [13:15] AFAIK the client (nxproxy) connects to the server [13:15] well, but naturally [13:15] if you have two sessions on the same port, that won't work 01[13:15] Well, it is like it is. I cant dig too deep, thats just my workaround, until something better comes up. [13:15] there's a more subtle problem to that 01[13:15] but it bores me, to apply my patch on each upgrade of x2go servewr [13:16] I understand that, I'm just not sure that's the best way to go... 01[13:16] hm. at least it is a bullet prooved solution in a class C net - what is the majority I guess [13:16] the real culprit lies in forwarding fixed ports in the first part 01[13:16] and it does not harm [13:17] that depends, your solution will also break easily 01[13:17] not easily. It CAN break. But on the other hand, all Servers starting on 30000 will brake for sure. [13:17] let's say you have a server with ending in .50, so the first port that gets used will be 30051 (or so) 01[13:18] right [13:18] the next one will be ending in .51 and thus start at 30052 01[13:18] correct [13:18] that'll work for the first session 01[13:18] yes 01[13:18] I know [13:18] but if you start a second session on server1, you won't be able to use the first (and only) session on server2, because it uses 30052 01[13:18] yes, I know 01[13:19] but that problem cant be solved, since the servers dont know of each other [13:19] your solution might be better than what we currently have 01[13:19] if You come up with someting better - I would love it [13:19] well, other than adding random data to the starting port number instead of a guessable last octet of the IPv4 address [13:20] but I'm unhappy with both of them, because that shouldn't be a problem in the first place 01[13:20] yeah, You can add a random data. Or multiply the last octet with 16, so You can be able to use at least 16 sessions per host, thats a good idea [13:21] I would probably just a random integer between 1 and 500 or whatever 01[13:21] I agree. But its a quick patch, until You come up with something better [13:21] every time the script is ran [13:21] or hell maybe even a higher number 01[13:22] I have read the development issues - multiple windows sessions are #1 priority, so i guess my patch is only for the time beeing, until the perfect solution is available 01[13:22] Ionic, yes, i will calculate - give me a minute [13:22] weeeell, let's say it would be a great feature to have 01[13:23] ok, we can multiply the last octet with 128 01[13:23] 128 sessions per host should be enough ... 01[13:23] right ? [13:23] but I'm actually working on other stuff currently (or, sadly, for the most part nothing even x2go-related) 01[13:24] I can send You the patch. Its very short. I dont want to install all the git stuff for that few lines. [13:24] why would you think it's 128 sessions per host? :) [13:24] it's just one again 01[13:24] whatever - we have 128 ports [13:24] oh, wait, multiplication 01[13:25] yes. SSH_PORT = 30.000 + (128 x IP last octet) [13:25] could actually become a problem 01[13:25] why ? [13:25] 32640 + 30000 = 62640 01[13:25] right 01[13:25] and we have 64000 ports available [13:26] it's still below the 65535, so still working 01[13:26] right. I calculated factor 128 to be well below 65535 [13:27] but at that point, why not adding a random number between 1 and 30000 each time? [13:28] if you happen to be unfortunate enough to have to machines ending in the same octet, you'd be screwed with your approach 01[13:28] because the poirts below 30.000 may be used by other services. 01[13:28] above 30.000 its free [13:28] with randomization, you might be randomly screwed, but... [13:28] huh? 01[13:28] and a random number still can make collisions [13:28] 30000 + [some random number from 1 to 30000] 01[13:28] right. randomly screwed [13:28] sure [13:28] randomly screwed 01[13:29] but in the case 30.000 + (128 x octet) we have at least 128 ports "distance" between each host 01[13:29] so collision is not very likely [13:29] unless octet1 and octet2 is the same [13:29] (for two given hosts) 01[13:29] however - everything is better then all host using 30001 ;-) [13:29] randomization would avoid that problem 01[13:30] for class "C" nets, this will never happen. [13:30] yeah, but it's still easy to run into it for anything bigger [13:31] for instance, when working with VMs and internal networks, you typically assign a virtual network per machine and the ending octets will be the same 01[13:31] ok, however - I propose a patch like that. And as You said before - it should be solved in some other place later anyway. 01[13:32] I will finish the patch, with both varians : random and 128 ports "distance", and You can configure. 01[13:33] Would You be so kind and issue the patch on git ? [13:33] just pointing out that I'm more inclined to do randomization than apply your patch as-is and I don't want you to get mad at that [13:33] don't worry about the randomization part 01[13:33] I can send to Your email adress if You want. [13:33] sure, or to git-admin@x2go.org 01[13:33] ok, I will send it later today [13:33] preferably also CC'd to the mailing list 01[13:33] Oh, I am not mad at all. [13:33] actually, the "correct" way would to create a new bug report... [13:34] and also use "Tag: patch" 01[13:34] Yeah, I was afraid to "spam" the Bug & Mailinglist. So I politely ask before .... [13:35] nah, that's actually the prefered way [13:35] (I don't keep IRC logs for instance) 01[13:36] no problem. But our conversation was very productive, I haven thought of "more sessions to one host" . So the multiplier + randomisation is a good compromise [13:39] my top priority for the client is something rather unimportant to most users [13:39] getting PulseAudio support on OS X working and bundling the daemon with the client [13:39] I'm still hanging at the bundling stage which is non-trivial [13:40] and my top-top most priority is writing my bachelor's thesis, which doesn't leave me as much free time as I'd like... 01[13:42] ok Ionic, I understand ;-) however, it would be nice if my patch can make it through [13:42] sure, although I will probably only do randomization 01[13:42] I will give You both options, what can be configured.