Why does ThinLinc try to connect to a different IP address than the one specified?

After installing a new ThinLinc server and connecting to it for the first time, you may encounter an error message like this:

2023-05-30_13:43:42

Looking at the logs, you might find that the ThinLinc client is attempting to connect to an IP address other than the one entered in the client interface. This is often a private (non-routable) IP, which may be unreachable from the network you are on. Where is this IP address coming from, and why is ThinLinc attempting to connect to it?

When establishing a connection to a ThinLinc server, the client connects in three steps, as shown in the following diagram:

The final connection in the diagram - the one to the agent - relies on the agent reporting its own IP address or hostname correctly to the client. This is true even if the ThinLinc master and agent are on the same machine. This value can be set manually in the configuration using the /vsmagent/agent_hostname parameter, however if this parameter is empty, it will default to the IP address of the server’s primary interface.

In many cases, this IP address will be correct and the connection will succeed. However in some cases, it will result in an incorrect value. Two common cases where this can occur are:

  • the ThinLinc server has multiple network interfaces, and the desired interface is not the primary one
  • the ThinLinc server only has one interface, but it has been assigned a private IP address

The second scenario is especially common with cloud-based providers, where the public IP address entered in the client is actually assigned to a separate network gateway, and not to the server itself. In either case, setting the parameter /vsmagent/agent_hostname to the correct IP address or hostname should resolve the issue:

tl-config /vsmaget/agent_hostname=<valid_hostname>
2 Likes