x2go.xserver module

class x2go.xserver.X2GoClientXConfig(config_files=['/home/mike/.x2goclient/xconfig', '/etc/x2goclient/xconfig'], defaults={}, logger=None, loglevel=56)[source]

Bases: x2go.inifiles.X2GoIniFile

Configuration file based XServer startup settings for X2GoClient instances.

This class is needed for Windows systems and (maybe soon) for Unix desktops using Wayland.


Get an unused TCP/IP port for the to-be-launched X server and write it to the user’s X configuration file.

Parameters:xserver_name (str) – name of the XServer application

Retrieve the XServer configuration (from the xconfig file) for the given XServer application.

Parameters:xserver_name (str) – name of the XServer application
Returns:A Python dictionary containing the XServer’s configuration settings
Return type:list

Among the known XServers renders a list of XServers that are actually installed on the system.


Renders a list of XServers that are known to Python X2Go.


Returns a tuple of (<xserver_name>, <xserver_config>).

Returns:xserver_name>, <xserver_config>)
Return type:tuple

Returns the list of preferred XServer names (most preferred first).


Tries to render a list of running XServer processes from the system’s process list.


Store the Xserver configuration to the storage backend (i.e. on disk).

For writing the first of the config_files specified on instance construction that is writable will be used.

Returns:True if the user config file has been successfully written, False otherwise.
Return type:bool

Detect if an XServer launch is really needed (or if we use an already running XServer instance). Equals True if we have to launch an XServer before we can start/resume X2Go sessions.


Detect if there is an XServer (that is known to Python X2Go) installed on the system. Equals True if we have found an installed XServer that we can launch.

class x2go.xserver.X2GoXServer(xserver_name, xserver_config, logger=None, loglevel=56)[source]

Bases: gevent.threading.Thread

This class is responsible for starting/stopping an external XServer application.

X2Go applications require a running XServer on the client system. This class will manage/handle the XServer while your X2Go application is running.


Start this x2go.xserver.X2GoXServer thread. This will launch the configured XServer application.


A call to this method will stop the XServer application and do a cleanup afterwards.