From ANDREW.ERICKSON@student.csn.edu  Thu Nov  5 00:17:17 2026
Received: (at submit) by bugs.x2go.org; 4 Nov 2026 23:17:20 +0000
X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on
	ymir.das-netzwerkteam.de
X-Spam-Level: **
X-Spam-Status: No, score=2.1 required=3.0 tests=BAYES_00,DKIM_SIGNED,
	DKIM_VALID,DKIM_VALID_AU,DMARC_PASS,FORGED_SPF_HELO,GOOG_REDIR_NOTRDNS,
	HTML_MESSAGE,RCVD_IN_DNSWL_BLOCKED,RCVD_IN_ZEN_BLOCKED_OPENDNS,
	SPF_HELO_PASS,URIBL_BLOCKED,URIBL_DBL_BLOCKED_OPENDNS,URI_DOTEDU,
	URI_DOTEDU_ENTITY autolearn=no autolearn_force=no version=4.0.0
Received: from DM1PR04CU001.outbound.protection.outlook.com (mail-centralusazlp170100005.outbound.protection.outlook.com [IPv6:2a01:111:f403:c111::5])
	by ymir.das-netzwerkteam.de (Postfix) with ESMTPS id E7C0C5DA4D
	for <submit@bugs.x2go.org>; Thu,  5 Nov 2026 00:17:16 +0100 (CET)
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=bJqB4dx1uPYaFzb2+Ab97X0xUVIEoqH4scYr3kvQczZc7ags1G3sEg5uG5evVq2Q+weQjXkgbm2ySZ2WA+w6b3UKI0wEbYY9OoOroJTY0vjPJjUda92HK3KmJxuYzEWBi6vmfeei7Pcz6rpFAxTSXktMxdNUvI8lWttDfEng3Cw0KnrTBCMzn9ckJId7njf2dM4eSnpOOedThjwdsW5X2Kr7LWjMzFWJPGeFgvMguNoUzc+4YpQiwdfFdSvKvJaxuCGqf6zYFcaI8Mxt5grGv32a68D23fMz9nDikSML3e1LIeYVUlwQABy7pMa4TZGLz+FBl5UPKNST4nelTF972Q==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001; h=From:Date:Subject:Message-ID:MIME-Version;
 bh=eEIsA/tzLH7P3N8PLACGsjYEBU/U3HsYxVJWA1cZsJw=;
 b=svOFzOgaAVvHUHbagT/HLBTOArMK74MTbFjj5NAgu0SfCtRcghowtjJNBODldEc/DiN0G0IsVIDQjFW7x3l/xsvY5oAIWlCjeomHoeoJOKbI5L3pte0mVdblV7tKLsxk9/SIwoPuT5UESpilzUSEOwwNGc/kTFAY+7s+jgNK005xEOV9dzisg/bFrosT/5A8SDd5wbroefr44Dvnu50w+TPyyWOzxxLg9Bgk9d233p35nj7GVavWpWyJNhjMCRgPOI/lwccapbPgSIM3hCX3bCrNY3YvzZIRNuj7My6vOtJXd+Cf6LgJW3/ZSyr3MnwCxpl7nCpMGtx6xxeeuuJsmw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=student.csn.edu; dmarc=pass action=none
 header.from=student.csn.edu; dkim=pass header.d=student.csn.edu; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=student.csn.edu;
 s=selector2;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=eEIsA/tzLH7P3N8PLACGsjYEBU/U3HsYxVJWA1cZsJw=;
 b=Rg6lbB6brU5ZKQKptpVnxVeCEGNy8rcZ7L9PaebRtof+qDy4S9zDXjNeyIsJsjzJZ9MsmqHUIhjtraVelaKER4tGuGefCbQ0yzEDvUO5SW1kiHQLhOwkYnUpnIBJL7LSnwS4fX7E58Y9+Ccnx92m1fO7w0cYtEI5HEkVoq0IOFw=
Received: from CH3PR05MB10278.namprd05.prod.outlook.com
 (2603:10b6:610:15b::22) by DS0PR05MB9568.namprd05.prod.outlook.com
 (2603:10b6:8:131::15) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.569.12; Wed, 4 Nov
 2026 23:14:17 +0000
Received: from CH3PR05MB10278.namprd05.prod.outlook.com
 ([fe80::e271:281e:ae27:ba19]) by CH3PR05MB10278.namprd05.prod.outlook.com
 ([fe80::e271:281e:ae27:ba19%6]) with mapi id 15.21.0592.009; Wed, 4 Nov 2026
 23:14:17 +0000
From: ANDREW ERICKSON <ANDREW.ERICKSON@student.csn.edu>
To: "submit@bugs.x2go.org" <submit@bugs.x2go.org>
Subject: X2Go Client (Macos): Invalid localhost port 65536 due to port
 detection failure on MacOS Tahoe
Thread-Topic: X2Go Client (Macos): Invalid localhost port 65536 due to port
 detection failure on MacOS Tahoe
Thread-Index: AQHdbLIR7wCbdZHD1Uy+Wchmdpr2Og==
Date: Wed, 4 Nov 2026 23:14:17 +0000
Message-ID:
 <CH3PR05MB10278D2DC8F7CD5E584477B7DB8682@CH3PR05MB10278.namprd05.prod.outlook.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
msip_labels:
authentication-results: mx.microsoft.com 1; dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=student.csn.edu;
x-ms-publictraffictype: Email
x-ms-traffictypediagnostic: CH3PR05MB10278:EE_|DS0PR05MB9568:EE_
x-ms-office365-filtering-correlation-id: fcc5c0ed-bafd-4429-3122-08df3ac9597a
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam:
 BCL:0;ARA:13230040|366016|23010399003|376014|1800799024|786006|6133799003|10067099003|261102123227099003|18002099003|8096899003|38070700021|261028144727099003|56012099006|11063799006|261022105027099003|261022113327099003|261026140227099003|261026121527099003|261021121427099003|261021135927099003|261022075727099003;
x-microsoft-antispam-message-info:
 5dgKwS7hWB1qU5azMSWhmIaovlZebqMtPwFSvLy8HrsEY7qv0LTwH+sLdixC84zBlgTgKGanEJS6j2btNB/c8vJHnY9RHMU/GfZvqIKcEU8btAb/P9redFuzCca6mx8HVrjDKq3HVNe4EDfUIQjvHUxfmv18Lk2wzudHbrigbBsHGRNjm3a11VTyXX1uubV8XaIHofrcJTKXC6gztMAvX0l1SKLjgltrxLsq+PD+zsJvMpId4KrxzKSCofRNm31nJ3BDjtTXxAXHQ+Kw4cnLAK/KlyyQZn94SBW5VVkh9Bng67cGFLw4sZORYbvmh2pfO48kLOiDakIUszmyDGbgK9YZomu0QsaXMUMr3pdhS826J5me6gwcqKCxRyXtAVzQLLrPQGWeXlH7SkrWd2T0e35/MT4bXZBZ3g+jnKs+DjAvyzTXBMFGX3ADghXHf7FNLQsraBFboA+CsUyXhSfsm7dJE+H0cgjbHcviab2CybMO2Z/tEHMxpXeqfEBxcFNQsTjZ61o15Ttkc06Q+G2zW4115Tc+9dwIu0TSP3fTG7Qw6tMDuOcsR4/YhpqUZsQPzV7XfGNFOYtav28lGxZ46EpsZQ92apad2ffOURQ7DP0vQJZOkJp4Xy2MdE64pS8h1jifxscRMQ3QO236VQktQAf7LPaxzK2A3y9KUanSkLg=
x-forefront-antispam-report:
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CH3PR05MB10278.namprd05.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(366016)(23010399003)(376014)(1800799024)(786006)(6133799003)(10067099003)(261102123227099003)(18002099003)(8096899003)(38070700021)(261028144727099003)(56012099006)(11063799006)(261022105027099003)(261022113327099003)(261026140227099003)(261026121527099003)(261021121427099003)(261021135927099003)(261022075727099003);DIR:OUT;SFP:1101;
x-ms-exchange-antispam-messagedata-chunkcount: 1
x-ms-exchange-antispam-messagedata-0:
 =?Windows-1252?Q?mpT7G4lXJA37uaJDKN1YDuf57/ioI7DWpn/Psh51Di/x0c6AUaEBeLRk?=
 =?Windows-1252?Q?FtUAFL31iw7Xa58v/uas4FJJdIdqCTRzCDAiVm7PSI2l/DUpR64zpKSG?=
 =?Windows-1252?Q?JdGG0Ahu0TNW3Ox/KkYnkyvt2wqay2ddXaKbc364XKqUKIo3wcFr/knu?=
 =?Windows-1252?Q?0kJxN8xvh74qZnogcph2SLyb6sTzZDmvlv+65WMVcLdkDl6w+2CQWOPp?=
 =?Windows-1252?Q?Icr/IIdkhqPgPnZcaRO6bB+OXzsX2dOHUzlQ+6rkMQXEGVMSh9wRGeqH?=
 =?Windows-1252?Q?Pj6FIQRn31UxqWNNPJuFw5noDNK4LEwwhiFTykyGQofOs7xqXXqBFhSz?=
 =?Windows-1252?Q?X+/8haM65PC0WeiFOJUK6yzKF5irYx4kSkX2vOs2ogaMNcgg9IdscDf3?=
 =?Windows-1252?Q?iU5gfiVhTsf1km28A4sLTA4/HW5HfxGdGTepeTQYC7CpU85q8dlPuEeG?=
 =?Windows-1252?Q?DNgq8cHaSNb2caxxzSapesZ+Ezo7MypaIO6oQOss0pijmrKzRE/lAnsH?=
 =?Windows-1252?Q?2W3tZcXbjbA+/Gb/1B3usyGXR0XGZEb64w50lB7Cv7ar/zgpgYC/LB66?=
 =?Windows-1252?Q?ymlU9s+f5ZRlKTEwj54iUKZtyBu5YQ2aMTqBCRGVDr3FkAgkJRhEFYuI?=
 =?Windows-1252?Q?xf+zLXFI2Vm51YC/f5LseiUfI9h/RBL48hG0D62emcZV84GHW17OCEh1?=
 =?Windows-1252?Q?ovo49prMopX3OHIfZB/zO0TOlulD94XasKX67TXjWGopOq7YsUzOgsGG?=
 =?Windows-1252?Q?bNw6QDtZ1e0nQeqkOW/irmsOBbVyaljNVQYenPyG0UsAsU76Jv8+oGkc?=
 =?Windows-1252?Q?v9NjXbyjFKEWa/KEjiJWMvO/kDIceO8ti7sSEgUAiZ07i/4ZX+5gVxlu?=
 =?Windows-1252?Q?ZXDN8vgh6GDh3e7cVIvxVcfA6nHGBMvRG8GJFnIHq763HwclDN1hIfNn?=
 =?Windows-1252?Q?QdksUi9nXGIV13gVvdywNoTgX9DAPeyCEisUOoIEt04U1DAQo2tq/bE7?=
 =?Windows-1252?Q?VzI1tSZ/6xAJk9OKsB8pSGCvg/Im8dvWcNXC8ww8e/Zl7FVY8YgPzgEP?=
 =?Windows-1252?Q?6WeHJJ88l0JAtnGcLuGYNqh/VNnxVVwcJWTZ5SVo1C8wOmjVq/c7Mwy6?=
 =?Windows-1252?Q?hhIzgAPdVkMAgyfJq4yglZqlyw4ao4QTr3BILMUQu8CUcXc1jEY7tB3+?=
 =?Windows-1252?Q?HrtAU8hIN8wAIzpxR6fX6Idc6RP0wpgluQGayTvnKfR1o4LbuA0S5YTR?=
 =?Windows-1252?Q?D1d0Ut0KL9xbYtdfwV3tQemMaYQQBtw3USv0ngxUYb+VGnhvuKcjrTX8?=
 =?Windows-1252?Q?WhkYnCk8jtpcFxkl3/pCoTbF+2rdbEQqQnaZ/22TGV4nzWFw1DumM1tC?=
 =?Windows-1252?Q?k4tmVPXuC0oDzeIciwfq9q0209Da+OLt4dY8MpBFRI5LoGGhN1CqpKSL?=
 =?Windows-1252?Q?2cjA1p4cslQYjP7m63Cx+pu8VVSmxBzY+Hc8LciLXujt6hLIPR16TI6n?=
 =?Windows-1252?Q?bgoALPVZJQzUKJ7teXFoE2JwxPcZaUC9fGFQT1qwE4kWjR9v1Deq84nf?=
 =?Windows-1252?Q?vA4P9UzlFFcte4OSovSQ/pK4uSDN82qxY4AxTKBzYDGkFQN+Dh2iYyvY?=
 =?Windows-1252?Q?BwXbbEpZ/q/K3XipaqcH48yR1PvixZrHUXximRKy1NB75bWBbjN/2Flw?=
 =?Windows-1252?Q?+tXtov2TYo62KRe/1+2cT11+MVk2Et6xWR42es41D7MpGucfCudAT0F2?=
 =?Windows-1252?Q?vjSNxJu/VUQWDnY9f+wad+Zca1+UckMIcT6NYF6VXvCEwkhab/jXNwH/?=
 =?Windows-1252?Q?7edHXqOaEzNgbIJ3DBrjEq13uPA7sUb2zV61RVLWgXnio9pt3Q2pnOhy?=
 =?Windows-1252?Q?qjxHiWR9q2Ic4A=3D=3D?=
Content-Type: multipart/alternative;
	boundary="_000_CH3PR05MB10278D2DC8F7CD5E584477B7DB8682CH3PR05MB10278na_"
MIME-Version: 1.0
X-OriginatorOrg: student.csn.edu
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-AuthSource: CH3PR05MB10278.namprd05.prod.outlook.com
X-MS-Exchange-CrossTenant-Network-Message-Id: fcc5c0ed-bafd-4429-3122-08df3ac9597a
X-MS-Exchange-CrossTenant-originalarrivaltime: 04 Nov 2026 23:14:17.3504
 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: df35d574-9fba-48ce-a073-737868d77a48
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: N5BgjfhneoA9gI3x4Mk0fazxOu/Z644gQx4bPtTiCqOctqjLj2o4SWYL1Atnrnn0E+gbpIzIcmL3VKGezcDmN9MP1giZbqLFDHCdx3l7WMY=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR05MB9568

--_000_CH3PR05MB10278D2DC8F7CD5E584477B7DB8682CH3PR05MB10278na_
Content-Type: text/plain; charset="Windows-1252"
Content-Transfer-Encoding: quoted-printable

Package: X2go 4.1.2.3
Also on 4.1.2.2
MacOS Tahoe 26.7.2
Qt 4.8.7, Qt 5.15.9

Hello,

I recently ran into an issue connecting to our college's Linux server with =
X2go, it seemed like it was trying to connect to invalid TCP ports.  Chat G=
PT assisted in patching and getting it working for me, and I am providing t=
he summary here:

X2Go on macOS Tahoe =96 Troubleshooting Summary and Fix
1. The original problem
I was unable to connect to my college's Linux server (bellagio.csn.edu<http=
://bellagio.csn.edu/>) using X2Go Client on my MacBook Air.
My configuration was:
Component
Version
macOS
Tahoe 26.7.2
X2Go Client
4.1.2.2
NXProxy
3.5.99.20
XQuartz
2.8.6
Mac architecture
Apple Silicon (ARM64)
The connection worked successfully from my Windows computer, and SSH connec=
tions from my Mac also worked.
The original X2Go error was:

Info: Connecting to remote host 'localhost:65536'.

Port 65536 is invalid because the maximum TCP port is 65535.
2. Root cause
We investigated the X2Go Client 4.1.2.2 source code and eventually reproduc=
ed the problem independently.
The relevant function was:

bool ONMainWindow::isServerRunning(int port)
{
    QTcpSocket tcpSocket(0);
    tcpSocket.connectToHost("127.0.0.1", port);

    if (tcpSocket.waitForConnected(1000))
    {
        tcpSocket.close();
        return true;
    }

    return false;
}

This function determines whether a local TCP port is already occupied.
However, our testing on macOS Tahoe demonstrated unexpected Qt behavior: QT=
cpSocket::waitForConnected() reported successful connections to ports where=
 no listening service existed.
We verified this using a standalone Qt test and compared it against Python =
socket tests and lsof.
As a result, X2Go incorrectly believed that every candidate local port was =
occupied.
Its port-selection loop kept incrementing until it reached 65536.
We reproduced the same problem with X2Go Client 4.1.2.3, so simply upgradin=
g the client wasn't sufficient.
3. The actual fix we applied
We installed X2Go Client 4.1.2.3 through MacPorts and modified its source c=
ode.
Change 1: Replace the port availability test on macOS.
Instead of using QTcpSocket::connectToHost(), we used QTcpServer::listen().
The replacement code was:

#ifdef Q_OS_DARWIN
    // Determine port availability by binding a local listening socket.
    if (port < 1 || port > 65535)
        return true;

    QTcpServer tcpServer;

    if (tcpServer.listen(QHostAddress::LocalHost,
                         static_cast<quint16>(port)))
    {
        tcpServer.close();
        return false;
    }

    return true;
#else
    QTcpSocket tcpSocket(0);
    tcpSocket.connectToHost("127.0.0.1", port);

    if (tcpSocket.waitForConnected(1000))
    {
        tcpSocket.close();
        return true;
    }

    return false;
#endif

The new implementation attempts to bind and listen on the candidate port:

  *
If binding succeeds, the port is available.
  *
If binding fails, the port is treated as unavailable.

This avoids the unexpected connection-test behavior we observed on macOS.
Change 2: Prevent invalid TCP port selection.
We also modified the graphics-port selection loop.
Original:

localGraphicPort =3D resumingSession.grPort;
int iport =3D localGraphicPort.toInt() + 1000;

while (iport =3D=3D resumingSession.sndPort.toInt() ||
       iport =3D=3D resumingSession.fsPort.toInt() ||
       isServerRunning(iport))
    ++iport;

localGraphicPort =3D QString::number(iport);

Patched:

localGraphicPort =3D resumingSession.grPort;
int iport =3D localGraphicPort.toInt() + 1000;

while (iport <=3D 65535 &&
       (iport =3D=3D resumingSession.sndPort.toInt() ||
        iport =3D=3D resumingSession.fsPort.toInt() ||
        isServerRunning(iport)))
    ++iport;

if (iport > 65535)
{
    QMessageBox::critical(
        this,
        tr("X2Go Client"),
        tr("No available local TCP port could be found for this session.")
    );
    return;
}

localGraphicPort =3D QString::number(iport);

This ensures X2Go never attempts to use a port outside the valid TCP range.
4. Additional macOS Tahoe workaround
There was a separate compatibility issue involving XQuartz.
Starting with macOS 26.4, Apple changed the location of the XQuartz display=
 socket.
Our college provided a launcher that worked around this by:

  1.
Detecting the active XQuartz socket.
  2.
Creating a temporary symbolic link under /tmp/launchXXXXXX.
  3.
Setting the DISPLAY environment variable to the compatible path.
  4.
Launching X2Go Client.
  5.
Cleaning up the temporary directory afterward.

We retained this workaround and used it when launching our patched client.
5. Successful result
Resolved
We rebuilt the patched X2Go Client 4.1.2.3 through MacPorts and tested the =
staged application before installing or replacing anything.
The successful debug log showed:

Starting tunnel via SshProcess object 2:
"localhost":50729 -> "localhost":51729

Then:

Direct tunnel: waiting for connections on "localhost":51729

And finally:

Info: Connecting to remote host 'localhost:51729'.
Info: Connected to remote proxy on FD#5.

The client successfully connected to the college Linux server and launched =
Geany.
No changes to the college Linux server were necessary.
6. Final working setup
We copied the patched application to:

~/Applications/X2Go Client Patched.app

We also created a desktop launcher:

~/Desktop/X2Go-Tahoe.command

The launcher automatically applies the XQuartz compatibility workaround and=
 starts the patched client.
The original college-provided launcher and original X2Go installation were =
left intact.
Final summary
Problem
Resolution
macOS Tahoe changed XQuartz socket location
College-provided launcher creates compatibility symlink
Qt port detection incorrectly reported ports as occupied
Replaced connection-based test with QTcpServer::listen() on macOS
X2Go selected invalid port 65536
Added TCP port-range validation
X2Go timed out connecting to NXProxy
Resolved by selecting a valid local tunnel port
Original installation needed to be preserved
Created separate patched application and desktop launcher
The key technical fix was replacing X2Go's macOS QTcpSocket::waitForConnect=
ed() port-availability check with QTcpServer::listen().
One maintenance note: the fix was applied to our MacPorts source build, not=
 upstream X2Go. A future MacPorts upgrade may overwrite it, so keep a copy =
of the patched source and original backup (onmainwindow.cpp.pre-darwin-port=
fix).
This is also a useful bug report to share with the X2Go developers and your=
 college IT department, particularly because we reproduced the problem on b=
oth 4.1.2.2 and 4.1.2.3.





--_000_CH3PR05MB10278D2DC8F7CD5E584477B7DB8682CH3PR05MB10278na_
Content-Type: text/html; charset="Windows-1252"
Content-Transfer-Encoding: quoted-printable

<html>
<head>
<meta http-equiv=3D"Content-Type" content=3D"text/html; charset=3DWindows-1=
252">
<style type=3D"text/css" style=3D"display:none;"> P {margin-top:0;margin-bo=
ttom:0;} </style>
</head>
<body dir=3D"ltr">
<div class=3D"elementToProof" style=3D"margin: 0px; font-family: Aptos, Apt=
os_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-=
size: 12pt; color: rgb(0, 0, 0);">
Package: X2go 4.1.2.3</div>
<div class=3D"elementToProof" style=3D"margin: 0px; font-family: Aptos, Apt=
os_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-=
size: 12pt; color: rgb(0, 0, 0);">
Also on 4.1.2.2</div>
<div class=3D"elementToProof" style=3D"margin: 0px; font-family: Aptos, Apt=
os_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-=
size: 12pt; color: rgb(0, 0, 0);">
MacOS Tahoe 26.7.2</div>
<div class=3D"elementToProof" style=3D"margin: 0px; font-family: Aptos, Apt=
os_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-=
size: 12pt; color: rgb(0, 0, 0);">
Qt 4.8.7, Qt 5.15.9</div>
<div class=3D"elementToProof" style=3D"margin: 0px; font-family: Aptos, Apt=
os_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-=
size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div class=3D"elementToProof" style=3D"margin: 0px; font-family: Aptos, Apt=
os_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-=
size: 12pt; color: rgb(0, 0, 0);">
Hello,</div>
<div class=3D"elementToProof" style=3D"margin: 0px; font-family: Aptos, Apt=
os_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-=
size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div class=3D"elementToProof" style=3D"margin: 0px; font-family: Aptos, Apt=
os_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-=
size: 12pt; color: rgb(0, 0, 0);">
I recently ran into an issue connecting to our college's Linux server with =
X2go, it seemed like it was trying to connect to invalid TCP ports.&nbsp; C=
hat GPT assisted in patching and getting it working for me, and I am provid=
ing the summary here:</div>
<div class=3D"elementToProof" style=3D"margin: 0px; font-family: Aptos, Apt=
os_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-=
size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div class=3D"elementToProof" style=3D"text-align: left; text-indent: 0px; =
margin: 0px; font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, C=
alibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<b>X2Go on macOS Tahoe =96 Troubleshooting Summary and Fix</b></div>
<div class=3D"elementToProof" style=3D"text-align: left; text-indent: 0px; =
margin: 0px; font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, C=
alibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<b>1. The original problem</b></div>
<div class=3D"elementToProof" style=3D"text-align: left; text-indent: 0px; =
margin: 1em 0px; font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontServic=
e, Calibri, Helvetica, sans-serif; font-size: 12pt;">
<span style=3D"color: rgb(0, 0, 0);">I was unable to connect to my college'=
s Linux server (</span><span style=3D"color: rgb(17, 85, 204);"><code><a hr=
ef=3D"http://bellagio.csn.edu/" target=3D"_blank" id=3D"OWA34de93d2-cbed-49=
1e-9461-ff3635854771" class=3D"x_OWAAutoLink" title=3D"http://bellagio.csn.=
edu/" rel=3D"noopener noreferrer" data-auth=3D"NotApplicable" data-saferedi=
recturl=3D"https://www.google.com/url?q=3Dhttp://bellagio.csn.edu/&amp;sour=
ce=3Dgmail&amp;ust=3D1793913693495000&amp;usg=3DAOvVaw0XdJ7pdKzDzRas7_d_vgJ=
H" data-linkindex=3D"0" style=3D"color: rgb(17, 85, 204); margin: 0px;">bel=
lagio.csn.edu</a></code></span><span style=3D"color: rgb(0, 0, 0);">)
 using X2Go Client on my MacBook Air.</span></div>
<div class=3D"elementToProof" style=3D"text-align: left; text-indent: 0px; =
margin: 1em 0px; font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontServic=
e, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
My configuration was:</div>
<table style=3D"text-align: left; text-indent: 0px;">
<tbody>
<tr>
<th style=3D"text-align: left; text-indent: 0px;">
<div class=3D"skipProofing" style=3D"text-align: left; text-indent: 0px; ma=
rgin: 1em 0px; font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService,=
 Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Component</div>
</th>
<th style=3D"text-align: left; text-indent: 0px;">
<div class=3D"skipProofing" style=3D"text-align: left; text-indent: 0px; ma=
rgin: 1em 0px; font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService,=
 Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Version</div>
</th>
</tr>
<tr>
<td style=3D"text-align: left; text-indent: 0px;">
<div class=3D"skipProofing" style=3D"text-align: left; text-indent: 0px; ma=
rgin: 1em 0px; font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService,=
 Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
macOS</div>
</td>
<td style=3D"text-align: left; text-indent: 0px;">
<div class=3D"skipProofing" style=3D"text-align: left; text-indent: 0px; ma=
rgin: 1em 0px; font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService,=
 Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Tahoe 26.7.2</div>
</td>
</tr>
<tr>
<td style=3D"text-align: left; text-indent: 0px;">
<div class=3D"skipProofing" style=3D"text-align: left; text-indent: 0px; ma=
rgin: 1em 0px; font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService,=
 Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
X2Go Client</div>
</td>
<td style=3D"text-align: left; text-indent: 0px;">
<div class=3D"skipProofing" style=3D"text-align: left; text-indent: 0px; ma=
rgin: 1em 0px; font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService,=
 Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
4.1.2.2</div>
</td>
</tr>
<tr>
<td style=3D"text-align: left; text-indent: 0px;">
<div class=3D"skipProofing" style=3D"text-align: left; text-indent: 0px; ma=
rgin: 1em 0px; font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService,=
 Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
NXProxy</div>
</td>
<td style=3D"text-align: left; text-indent: 0px;">
<div class=3D"skipProofing" style=3D"text-align: left; text-indent: 0px; ma=
rgin: 1em 0px; font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService,=
 Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
3.5.99.20</div>
</td>
</tr>
<tr>
<td style=3D"text-align: left; text-indent: 0px;">
<div class=3D"skipProofing" style=3D"text-align: left; text-indent: 0px; ma=
rgin: 1em 0px; font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService,=
 Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
XQuartz</div>
</td>
<td style=3D"text-align: left; text-indent: 0px;">
<div class=3D"skipProofing" style=3D"text-align: left; text-indent: 0px; ma=
rgin: 1em 0px; font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService,=
 Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
2.8.6</div>
</td>
</tr>
<tr>
<td style=3D"text-align: left; text-indent: 0px;">
<div class=3D"skipProofing" style=3D"text-align: left; text-indent: 0px; ma=
rgin: 1em 0px; font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService,=
 Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Mac architecture</div>
</td>
<td style=3D"text-align: left; text-indent: 0px;">
<div class=3D"skipProofing" style=3D"text-align: left; text-indent: 0px; ma=
rgin: 1em 0px; font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService,=
 Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Apple Silicon (ARM64)</div>
</td>
</tr>
</tbody>
</table>
<div class=3D"elementToProof" style=3D"text-align: left; text-indent: 0px; =
margin: 1em 0px; font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontServic=
e, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
The connection worked successfully from my Windows computer, and SSH connec=
tions from my Mac also worked.</div>
<div class=3D"elementToProof" style=3D"text-align: left; text-indent: 0px; =
margin: 1em 0px; font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontServic=
e, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
The original X2Go error was:</div>
<pre class=3D"elementToProof" style=3D"margin-right: 0px; margin-left: 0px;=
"><div class=3D"elementToProof" style=3D"direction: ltr; text-align: left; =
text-indent: 0px; white-space: pre-wrap; margin: 0px; font-family: Aptos, A=
ptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; fon=
t-size: 12pt; color: rgb(0, 0, 0);"><code>Info: Connecting to remote host '=
localhost:65536'.</code></div></pre>
<div class=3D"elementToProof" style=3D"text-align: left; text-indent: 0px; =
margin: 1em 0px; font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontServic=
e, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Port <code>65536</code> is invalid because the maximum TCP port is <code>65=
535</code>.</div>
<div class=3D"elementToProof" style=3D"text-align: left; text-indent: 0px; =
margin: 0px; font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, C=
alibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<b>2. Root cause</b></div>
<div class=3D"elementToProof" style=3D"text-align: left; text-indent: 0px; =
margin: 1em 0px; font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontServic=
e, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
We investigated the X2Go Client 4.1.2.2 source code and eventually reproduc=
ed the problem independently.</div>
<div class=3D"elementToProof" style=3D"text-align: left; text-indent: 0px; =
margin: 1em 0px; font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontServic=
e, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
The relevant function was:</div>
<pre class=3D"elementToProof" style=3D"margin-right: 0px; margin-left: 0px;=
"><div class=3D"elementToProof" style=3D"direction: ltr; text-align: left; =
text-indent: 0px; white-space: pre-wrap; margin: 0px; font-family: Aptos, A=
ptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; fon=
t-size: 12pt; color: rgb(0, 0, 0);"><code>bool ONMainWindow::isServerRunnin=
g(<wbr>int port)=0A=
{=0A=
 &nbsp; &nbsp;QTcpSocket tcpSocket(0);=0A=
 &nbsp; &nbsp;tcpSocket.connectToHost(&quot;127.<wbr>0.0.1&quot;, port);=0A=
=0A=
 &nbsp; &nbsp;if (tcpSocket.waitForConnected(<wbr>1000))=0A=
 &nbsp; &nbsp;{=0A=
 &nbsp; &nbsp; &nbsp; &nbsp;tcpSocket.close();=0A=
 &nbsp; &nbsp; &nbsp; &nbsp;return true;=0A=
 &nbsp; &nbsp;}=0A=
=0A=
 &nbsp; &nbsp;return false;=0A=
}</code></div></pre>
<div class=3D"elementToProof" style=3D"text-align: left; text-indent: 0px; =
margin: 1em 0px; font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontServic=
e, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
This function determines whether a local TCP port is already occupied.</div=
>
<div class=3D"elementToProof" style=3D"text-align: left; text-indent: 0px; =
margin: 1em 0px; font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontServic=
e, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
However, our testing on macOS Tahoe demonstrated unexpected Qt behavior: <c=
ode>QTcpSocket::waitForConnected()</code> reported successful connections t=
o ports where no listening service existed.</div>
<div class=3D"elementToProof" style=3D"text-align: left; text-indent: 0px; =
margin: 1em 0px; font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontServic=
e, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
We verified this using a standalone Qt test and compared it against Python =
socket tests and
<code>lsof</code>.</div>
<div class=3D"elementToProof" style=3D"text-align: left; text-indent: 0px; =
margin: 1em 0px; font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontServic=
e, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
As a result, X2Go incorrectly believed that every candidate local port was =
occupied.</div>
<div class=3D"elementToProof" style=3D"text-align: left; text-indent: 0px; =
margin: 1em 0px; font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontServic=
e, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Its port-selection loop kept incrementing until it reached <code>65536</cod=
e>.</div>
<div class=3D"elementToProof" style=3D"text-align: left; text-indent: 0px; =
margin: 1em 0px; font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontServic=
e, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
We reproduced the same problem with X2Go Client 4.1.2.3, so simply upgradin=
g the client wasn't sufficient.</div>
<div class=3D"elementToProof" style=3D"text-align: left; text-indent: 0px; =
margin: 0px; font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, C=
alibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<b>3. The actual fix we applied</b></div>
<div class=3D"elementToProof" style=3D"text-align: left; text-indent: 0px; =
margin: 1em 0px; font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontServic=
e, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
We installed X2Go Client 4.1.2.3 through MacPorts and modified its source c=
ode.</div>
<div class=3D"elementToProof" style=3D"text-align: left; text-indent: 0px; =
margin: 1em 0px; font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontServic=
e, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Change 1: Replace the port availability test on macOS.</div>
<div class=3D"elementToProof" style=3D"text-align: left; text-indent: 0px; =
margin: 1em 0px; font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontServic=
e, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Instead of using <code>QTcpSocket::connectToHost()</code>, we used <code>QT=
cpServer::listen()</code>.</div>
<div class=3D"elementToProof" style=3D"text-align: left; text-indent: 0px; =
margin: 1em 0px; font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontServic=
e, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
The replacement code was:</div>
<pre class=3D"elementToProof" style=3D"margin-right: 0px; margin-left: 0px;=
"><div class=3D"elementToProof" style=3D"direction: ltr; text-align: left; =
text-indent: 0px; white-space: pre-wrap; margin: 0px; font-family: Aptos, A=
ptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; fon=
t-size: 12pt; color: rgb(0, 0, 0);"><code>#ifdef Q_OS_DARWIN=0A=
 &nbsp; &nbsp;// Determine port availability by binding a local listening s=
ocket.=0A=
 &nbsp; &nbsp;if (port &lt; 1 || port &gt; 65535)=0A=
 &nbsp; &nbsp; &nbsp; &nbsp;return true;=0A=
=0A=
 &nbsp; &nbsp;QTcpServer tcpServer;=0A=
=0A=
 &nbsp; &nbsp;if (tcpServer.listen(<wbr>QHostAddress::LocalHost,=0A=
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbs=
p; &nbsp; static_cast&lt;quint16&gt;(port)))=0A=
 &nbsp; &nbsp;{=0A=
 &nbsp; &nbsp; &nbsp; &nbsp;tcpServer.close();=0A=
 &nbsp; &nbsp; &nbsp; &nbsp;return false;=0A=
 &nbsp; &nbsp;}=0A=
=0A=
 &nbsp; &nbsp;return true;=0A=
#else=0A=
 &nbsp; &nbsp;QTcpSocket tcpSocket(0);=0A=
 &nbsp; &nbsp;tcpSocket.connectToHost(&quot;127.<wbr>0.0.1&quot;, port);=0A=
=0A=
 &nbsp; &nbsp;if (tcpSocket.waitForConnected(<wbr>1000))=0A=
 &nbsp; &nbsp;{=0A=
 &nbsp; &nbsp; &nbsp; &nbsp;tcpSocket.close();=0A=
 &nbsp; &nbsp; &nbsp; &nbsp;return true;=0A=
 &nbsp; &nbsp;}=0A=
=0A=
 &nbsp; &nbsp;return false;=0A=
#endif</code></div></pre>
<div class=3D"elementToProof" style=3D"text-align: left; text-indent: 0px; =
margin: 1em 0px; font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontServic=
e, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
The new implementation attempts to bind and listen on the candidate port:</=
div>
<ul style=3D"text-align: left;">
<li style=3D"font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, C=
alibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); margin=
-left: 15px;">
<div class=3D"elementToProof" role=3D"presentation" style=3D"text-align: le=
ft; text-indent: 0px; margin: 1em 0px;">
If binding succeeds, the port is available.</div>
</li><li style=3D"font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontServi=
ce, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); m=
argin-left: 15px;">
<div class=3D"elementToProof" role=3D"presentation" style=3D"text-align: le=
ft; text-indent: 0px; margin: 1em 0px;">
If binding fails, the port is treated as unavailable.</div>
</li></ul>
<div class=3D"elementToProof" style=3D"text-align: left; text-indent: 0px; =
margin: 1em 0px; font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontServic=
e, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
This avoids the unexpected connection-test behavior we observed on macOS.</=
div>
<div class=3D"elementToProof" style=3D"text-align: left; text-indent: 0px; =
margin: 1em 0px; font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontServic=
e, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Change 2: Prevent invalid TCP port selection.</div>
<div class=3D"elementToProof" style=3D"text-align: left; text-indent: 0px; =
margin: 1em 0px; font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontServic=
e, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
We also modified the graphics-port selection loop.</div>
<div class=3D"elementToProof" style=3D"text-align: left; text-indent: 0px; =
margin: 1em 0px; font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontServic=
e, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Original:</div>
<pre class=3D"elementToProof" style=3D"margin-right: 0px; margin-left: 0px;=
"><div class=3D"elementToProof" style=3D"direction: ltr; text-align: left; =
text-indent: 0px; white-space: pre-wrap; margin: 0px; font-family: Aptos, A=
ptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; fon=
t-size: 12pt; color: rgb(0, 0, 0);"><code>localGraphicPort =3D resumingSess=
ion.grPort;=0A=
int iport =3D localGraphicPort.toInt() + 1000;=0A=
=0A=
while (iport =3D=3D resumingSession.sndPort.toInt(<wbr>) ||=0A=
 &nbsp; &nbsp; &nbsp; iport =3D=3D resumingSession.fsPort.toInt() ||=0A=
 &nbsp; &nbsp; &nbsp; isServerRunning(iport))=0A=
 &nbsp; &nbsp;++iport;=0A=
=0A=
localGraphicPort =3D QString::number(iport);</code></div></pre>
<div class=3D"elementToProof" style=3D"text-align: left; text-indent: 0px; =
margin: 1em 0px; font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontServic=
e, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Patched:</div>
<pre class=3D"elementToProof" style=3D"margin-right: 0px; margin-left: 0px;=
"><div class=3D"elementToProof" style=3D"direction: ltr; text-align: left; =
text-indent: 0px; white-space: pre-wrap; margin: 0px; font-family: Aptos, A=
ptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; fon=
t-size: 12pt; color: rgb(0, 0, 0);"><code>localGraphicPort =3D resumingSess=
ion.grPort;=0A=
int iport =3D localGraphicPort.toInt() + 1000;=0A=
=0A=
while (iport &lt;=3D 65535 &amp;&amp;=0A=
 &nbsp; &nbsp; &nbsp; (iport =3D=3D resumingSession.sndPort.toInt(<wbr>) ||=
=0A=
 &nbsp; &nbsp; &nbsp; &nbsp;iport =3D=3D resumingSession.fsPort.toInt() ||=
=0A=
 &nbsp; &nbsp; &nbsp; &nbsp;isServerRunning(iport)))=0A=
 &nbsp; &nbsp;++iport;=0A=
=0A=
if (iport &gt; 65535)=0A=
{=0A=
 &nbsp; &nbsp;QMessageBox::critical(=0A=
 &nbsp; &nbsp; &nbsp; &nbsp;this,=0A=
 &nbsp; &nbsp; &nbsp; &nbsp;tr(&quot;X2Go Client&quot;),=0A=
 &nbsp; &nbsp; &nbsp; &nbsp;tr(&quot;No available local TCP port could be f=
ound for this session.&quot;)=0A=
 &nbsp; &nbsp;);=0A=
 &nbsp; &nbsp;return;=0A=
}=0A=
=0A=
localGraphicPort =3D QString::number(iport);</code></div></pre>
<div class=3D"elementToProof" style=3D"text-align: left; text-indent: 0px; =
margin: 1em 0px; font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontServic=
e, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
This ensures X2Go never attempts to use a port outside the valid TCP range.=
</div>
<div class=3D"elementToProof" style=3D"text-align: left; text-indent: 0px; =
margin: 0px; font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, C=
alibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<b>4. Additional macOS Tahoe workaround</b></div>
<div class=3D"elementToProof" style=3D"text-align: left; text-indent: 0px; =
margin: 1em 0px; font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontServic=
e, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
There was a separate compatibility issue involving XQuartz.</div>
<div class=3D"elementToProof" style=3D"text-align: left; text-indent: 0px; =
margin: 1em 0px; font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontServic=
e, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Starting with macOS 26.4, Apple changed the location of the XQuartz display=
 socket.</div>
<div class=3D"elementToProof" style=3D"text-align: left; text-indent: 0px; =
margin: 1em 0px; font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontServic=
e, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Our college provided a launcher that worked around this by:</div>
<ol start=3D"1" style=3D"text-align: left;">
<li style=3D"font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, C=
alibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); margin=
-left: 15px;">
<div class=3D"elementToProof" role=3D"presentation" style=3D"text-align: le=
ft; text-indent: 0px; margin: 1em 0px;">
Detecting the active XQuartz socket.</div>
</li><li style=3D"font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontServi=
ce, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); m=
argin-left: 15px;">
<div class=3D"elementToProof" role=3D"presentation" style=3D"text-align: le=
ft; text-indent: 0px; margin: 1em 0px;">
Creating a temporary symbolic link under <code>/tmp/launchXXXXXX</code>.</d=
iv>
</li><li style=3D"font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontServi=
ce, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); m=
argin-left: 15px;">
<div class=3D"elementToProof" role=3D"presentation" style=3D"text-align: le=
ft; text-indent: 0px; margin: 1em 0px;">
Setting the <code>DISPLAY</code> environment variable to the compatible pat=
h.</div>
</li><li style=3D"font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontServi=
ce, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); m=
argin-left: 15px;">
<div class=3D"elementToProof" role=3D"presentation" style=3D"text-align: le=
ft; text-indent: 0px; margin: 1em 0px;">
Launching X2Go Client.</div>
</li><li style=3D"font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontServi=
ce, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); m=
argin-left: 15px;">
<div class=3D"elementToProof" role=3D"presentation" style=3D"text-align: le=
ft; text-indent: 0px; margin: 1em 0px;">
Cleaning up the temporary directory afterward.</div>
</li></ol>
<div class=3D"elementToProof" style=3D"text-align: left; text-indent: 0px; =
margin: 1em 0px; font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontServic=
e, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
We retained this workaround and used it when launching our patched client.<=
/div>
<div class=3D"elementToProof" style=3D"text-align: left; text-indent: 0px; =
margin: 0px; font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, C=
alibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<b>5. Successful result</b></div>
<div class=3D"elementToProof" style=3D"text-align: left; text-indent: 0px; =
margin: 0px; font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, C=
alibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Resolved</div>
<div class=3D"elementToProof" style=3D"text-align: left; text-indent: 0px; =
margin: 1em 0px; font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontServic=
e, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
We rebuilt the patched X2Go Client 4.1.2.3 through MacPorts and tested the =
staged application before installing or replacing anything.</div>
<div class=3D"elementToProof" style=3D"text-align: left; text-indent: 0px; =
margin: 1em 0px; font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontServic=
e, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
The successful debug log showed:</div>
<pre class=3D"elementToProof" style=3D"margin-right: 0px; margin-left: 0px;=
"><div class=3D"elementToProof" style=3D"direction: ltr; text-align: left; =
text-indent: 0px; white-space: pre-wrap; margin: 0px; font-family: Aptos, A=
ptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; fon=
t-size: 12pt; color: rgb(0, 0, 0);"><code>Starting tunnel via SshProcess ob=
ject 2:=0A=
&quot;localhost&quot;:50729 -&gt; &quot;localhost&quot;:51729</code></div><=
/pre>
<div class=3D"elementToProof" style=3D"text-align: left; text-indent: 0px; =
margin: 1em 0px; font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontServic=
e, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Then:</div>
<pre class=3D"elementToProof" style=3D"margin-right: 0px; margin-left: 0px;=
"><div class=3D"elementToProof" style=3D"direction: ltr; text-align: left; =
text-indent: 0px; white-space: pre-wrap; margin: 0px; font-family: Aptos, A=
ptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; fon=
t-size: 12pt; color: rgb(0, 0, 0);"><code>Direct tunnel: waiting for connec=
tions on &quot;localhost&quot;:51729</code></div></pre>
<div class=3D"elementToProof" style=3D"text-align: left; text-indent: 0px; =
margin: 1em 0px; font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontServic=
e, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
And finally:</div>
<pre class=3D"elementToProof" style=3D"margin-right: 0px; margin-left: 0px;=
"><div class=3D"elementToProof" style=3D"direction: ltr; text-align: left; =
text-indent: 0px; white-space: pre-wrap; margin: 0px; font-family: Aptos, A=
ptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; fon=
t-size: 12pt; color: rgb(0, 0, 0);"><code>Info: Connecting to remote host '=
localhost:51729'.=0A=
Info: Connected to remote proxy on FD#5.</code></div></pre>
<div class=3D"elementToProof" style=3D"text-align: left; text-indent: 0px; =
margin: 1em 0px; font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontServic=
e, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
The client successfully connected to the college Linux server and launched =
Geany.</div>
<div class=3D"elementToProof" style=3D"text-align: left; text-indent: 0px; =
margin: 1em 0px; font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontServic=
e, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
No changes to the college Linux server were necessary.</div>
<div class=3D"elementToProof" style=3D"text-align: left; text-indent: 0px; =
margin: 0px; font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, C=
alibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<b>6. Final working setup</b></div>
<div class=3D"elementToProof" style=3D"text-align: left; text-indent: 0px; =
margin: 1em 0px; font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontServic=
e, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
We copied the patched application to:</div>
<pre class=3D"elementToProof" style=3D"margin-right: 0px; margin-left: 0px;=
"><div class=3D"elementToProof" style=3D"direction: ltr; text-align: left; =
text-indent: 0px; white-space: pre-wrap; margin: 0px; font-family: Aptos, A=
ptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; fon=
t-size: 12pt; color: rgb(0, 0, 0);"><code>~/Applications/X2Go Client Patche=
d.app</code></div></pre>
<div class=3D"elementToProof" style=3D"text-align: left; text-indent: 0px; =
margin: 1em 0px; font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontServic=
e, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
We also created a desktop launcher:</div>
<pre class=3D"elementToProof" style=3D"margin-right: 0px; margin-left: 0px;=
"><div class=3D"elementToProof" style=3D"direction: ltr; text-align: left; =
text-indent: 0px; white-space: pre-wrap; margin: 0px; font-family: Aptos, A=
ptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; fon=
t-size: 12pt; color: rgb(0, 0, 0);"><code>~/Desktop/X2Go-Tahoe.command</cod=
e></div></pre>
<div class=3D"elementToProof" style=3D"text-align: left; text-indent: 0px; =
margin: 1em 0px; font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontServic=
e, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
The launcher automatically applies the XQuartz compatibility workaround and=
 starts the patched client.</div>
<div class=3D"elementToProof" style=3D"text-align: left; text-indent: 0px; =
margin: 1em 0px; font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontServic=
e, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
The original college-provided launcher and original X2Go installation were =
left intact.</div>
<div class=3D"elementToProof" style=3D"text-align: left; text-indent: 0px; =
margin: 0px; font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, C=
alibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<b>Final summary</b></div>
<table style=3D"text-align: left; text-indent: 0px;">
<tbody>
<tr>
<th style=3D"text-align: left; text-indent: 0px;">
<div class=3D"skipProofing" style=3D"text-align: left; text-indent: 0px; ma=
rgin: 1em 0px; font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService,=
 Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Problem</div>
</th>
<th style=3D"text-align: left; text-indent: 0px;">
<div class=3D"skipProofing" style=3D"text-align: left; text-indent: 0px; ma=
rgin: 1em 0px; font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService,=
 Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Resolution</div>
</th>
</tr>
<tr>
<td style=3D"text-align: left; text-indent: 0px;">
<div class=3D"skipProofing" style=3D"text-align: left; text-indent: 0px; ma=
rgin: 1em 0px; font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService,=
 Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
macOS Tahoe changed XQuartz socket location</div>
</td>
<td style=3D"text-align: left; text-indent: 0px;">
<div class=3D"skipProofing" style=3D"text-align: left; text-indent: 0px; ma=
rgin: 1em 0px; font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService,=
 Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
College-provided launcher creates compatibility symlink</div>
</td>
</tr>
<tr>
<td style=3D"text-align: left; text-indent: 0px;">
<div class=3D"skipProofing" style=3D"text-align: left; text-indent: 0px; ma=
rgin: 1em 0px; font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService,=
 Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Qt port detection incorrectly reported ports as occupied</div>
</td>
<td style=3D"text-align: left; text-indent: 0px;">
<div class=3D"skipProofing" style=3D"text-align: left; text-indent: 0px; ma=
rgin: 1em 0px; font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService,=
 Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Replaced connection-based test with <code>QTcpServer::listen()</code> on ma=
cOS</div>
</td>
</tr>
<tr>
<td style=3D"text-align: left; text-indent: 0px;">
<div class=3D"skipProofing" style=3D"text-align: left; text-indent: 0px; ma=
rgin: 1em 0px; font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService,=
 Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
X2Go selected invalid port 65536</div>
</td>
<td style=3D"text-align: left; text-indent: 0px;">
<div class=3D"skipProofing" style=3D"text-align: left; text-indent: 0px; ma=
rgin: 1em 0px; font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService,=
 Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Added TCP port-range validation</div>
</td>
</tr>
<tr>
<td style=3D"text-align: left; text-indent: 0px;">
<div class=3D"skipProofing" style=3D"text-align: left; text-indent: 0px; ma=
rgin: 1em 0px; font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService,=
 Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
X2Go timed out connecting to NXProxy</div>
</td>
<td style=3D"text-align: left; text-indent: 0px;">
<div class=3D"skipProofing" style=3D"text-align: left; text-indent: 0px; ma=
rgin: 1em 0px; font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService,=
 Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Resolved by selecting a valid local tunnel port</div>
</td>
</tr>
<tr>
<td style=3D"text-align: left; text-indent: 0px;">
<div class=3D"skipProofing" style=3D"text-align: left; text-indent: 0px; ma=
rgin: 1em 0px; font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService,=
 Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Original installation needed to be preserved</div>
</td>
<td style=3D"text-align: left; text-indent: 0px;">
<div class=3D"skipProofing" style=3D"text-align: left; text-indent: 0px; ma=
rgin: 1em 0px; font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService,=
 Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Created separate patched application and desktop launcher</div>
</td>
</tr>
</tbody>
</table>
<div class=3D"elementToProof" style=3D"text-align: left; text-indent: 0px; =
margin: 1em 0px; font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontServic=
e, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
The key technical fix was replacing X2Go's macOS <code>QTcpSocket::waitForC=
onnected()</code> port-availability check with
<code>QTcpServer::listen()</code>.</div>
<div class=3D"elementToProof" style=3D"text-align: left; text-indent: 0px; =
margin: 1em 0px; font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontServic=
e, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
One maintenance note: the fix was applied to our MacPorts source build, not=
 upstream X2Go. A future MacPorts upgrade may overwrite it, so keep a copy =
of the patched source and original backup (<code>onmainwindow.cpp.pre-darwi=
n-<wbr>portfix</code>).</div>
<div class=3D"elementToProof" style=3D"text-align: left; text-indent: 0px; =
margin: 1em 0px; font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontServic=
e, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
This is also a useful bug report to share with the X2Go developers and your=
 college IT department, particularly because we reproduced the problem on b=
oth 4.1.2.2 and 4.1.2.3.</div>
<div class=3D"elementToProof" style=3D"direction: ltr; text-align: left; te=
xt-indent: 0px; margin: 0px; font-family: Aptos, Aptos_EmbeddedFont, Aptos_=
MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(=
0, 0, 0);">
<br>
</div>
<div class=3D"elementToProof" style=3D"text-align: left; margin: 0px; font-=
family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica,=
 sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div class=3D"elementToProof" style=3D"margin: 0px; font-family: Aptos, Apt=
os_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-=
size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div class=3D"elementToProof" style=3D"font-family: Aptos, Aptos_EmbeddedFo=
nt, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; c=
olor: rgb(0, 0, 0);">
<br>
</div>
</body>
</html>

--_000_CH3PR05MB10278D2DC8F7CD5E584477B7DB8682CH3PR05MB10278na_--

