Using X2Go on macOS 26.4

macOS 26.4 made a change that broke the current version of the X2Go client. This page explains what happened and how to get X2Go working again.

If you're just looking to get X2Go working with SENS servers, this is covered on the X2Go page.

This page explains the problem in depth so that other solutions may be created.

Explanation

Before macOS 26.4, when a service like XQuartz requested that macOS create a socket for it with a randomized path, the socket was created in a directory under /private/tmp. macOS 26.4 changed the base directory for these sockets to /var/run.

This change causes a problem for version 4.1.2.2 of the macOS X2Go client because there is platform-specific code that only gets called if the DISPLAY environment variable (which contains the path to XQuartz’s socket) starts with one of two hard-coded values:

  • /private/tmp/com.apple.launchd
  • /tmp/launch

This logic may be found in Loop.cpp of nx-libs.

Workaround

Disclaimer

This workaround is provided for informational purposes only. The authors and publishers provide no warranties of any kind and shall not be held liable for any damages that may result from implementing this workaround.

To get the X2Go client working again, the XQuartz socket must be accessible from a path that the client expects XQuartz to use. One minimally-disruptive way to do this is to create a symlink to the socket with a path X2Go handles correctly, then update the DISPLAY environment variable so that X2Go uses that path instead.

A launcher application or script could do the following:

  1. Check if the DISPLAY environment variable is a path (i.e. begins with /). If so:
    1. Use the mktemp tool or a similar function to create a temporary directory whose path begins with /tmp/launch.
      • Verify that the directory is being created in a secure manner and has its permissions set so that only the owner may access its contents.
    2. Create a symlink inside the temporary directory to the socket specified by the DISPLAY environment variable.
    3. Set the DISPLAY environment variable to contain the symlink’s path.
  2. Run the x2goclient executable with the desired command-line arguments.
    • This executable is located in the Contents/MacOS directory inside of x2goclient.app.
    • Command-line options for the X2Go client may be listed by running x2goclient with the --help option.
  3. After X2Go closes, clean up the temporary directory.
    • Note: The contents of /tmp should also be cleaned up when the system boots and may be cleaned up periodically by a background service.

By performing this setup using a launcher, the user does not have to modify the configuration of macOS or XQuartz, which might disrupt other applications.