How automatic reconnection works in NoMachine
NoMachine provides an automatic reconnection mechanism designed to help recover a session when a temporary connection loss occurs, for example, due to network instability. This article explains how automatic reconnection works, how users may configure it, and its limitations.
When a NoMachine connection is interrupted, the client can automatically attempt to reconnect without requiring the user to start a new connection manually. This behavior is referred to in the user interface as automatic reconnection. Automatic reconnection handles temporary disruptions, such as brief network outages, but it depends on specific conditions being met.
How automatic reconnection works
When the connection is lost for any reason, the NoMachine client will automatically retry the connection until the client's graphical interface remains open. Automatic reconnection is possible only if all of the following conditions are met:
- - The connection disruption reason lasts only for a few minutes.
- - The network connection becomes available again on the client.
- - The remote NoMachine server is reachable.
- - The server-side session is still active and accepting incoming connections.
-
- The server-side session must still exist and be in a state that allows reconnection. If the session was terminated,
logged out, or closed on the server, automatic reconnection is not possible.
If all conditions are met, the client reconnects automatically. If any conditions are not met, the user must reconnect manually.
Configuring automatic reconnection in NoMachine v9
Automatic reconnection is enabled by default in NoMachine v9, but it can be verified or adjusted by opening the NoMachine config file in ~/.nx/config/player.cfg. Check this option setting:
<option key="Automatically reconnect to the server" value="true" />
This option controls whether the client retries the connection automatically after a temporary disconnection. Editing this file is intended for advanced users. Note that changes to the configuration file require restarting the client to take effect.
What automatic reconnection does not do
The following considerations must be taken into account:
- - Automatic reconnection does not recreate a terminated session.
- - It does not reconnect if the server is unavailable or unreachable.
- - It does not reconnect if the server is restarted
- - It does not reconnect if the session was closed or the user was logged out on the server side.
- - It does not guarantee reconnection after system shutdowns or reboots.
The "Retry" button functionality
In particular, "retry" does not mean restore the previous session in all cases. "Retry" means that the client attempts to re-establish the connection when possible, subject to session state and authentication.
Differences between NoMachine v8 and v9
Automatic reconnection behavior has been changed in NoMachine v9, in order to better integrate with two-factor authentication, remove the need to keep an encrypted password in memory, and improve the Cloud Server authentication system. In order to add a further layer of security to the reconnection, we no longer use the user credentials, but connect and authenticate to the server through a security token. This token has a short expiration time, so in the case of closing the log and reopening it later, for example, the server rejects the automatic reconnection token authentication. In a future version, it will be possible to set the validity of the token generated by the server for the client, so that auto-reconnecting the session in the case of a connection failure is possible. This TokenExpiryTimeout key can be set in seconds, the default is 300.
Users running NoMachine v8 may experience different reconnection behavior depending on the operating system and network conditions. For the most reliable automatic reconnection behavior, upgrading to v9 is recommended.
Summary
Automatic reconnection in NoMachine helps recover connections after temporary interruptions, but it depends on the server-side session availability, network conditions, and authentication status. Understanding these limitations helps avoid confusion between retrying a connection and restoring a session.
