How to enable the auto-disconnect feature in NoMachine
Administrators can configure NoMachine to auto-disconnect, terminate or disconnect virtual desktops on Linux automatically after some time of inactivity. (To set automatic termination of virtual desktop sessions, see the article: https://www.nomachine.com/AR08M00854.)
The auto-disconnect feature can be activated by enabling the following key in the node configuration file (/usr/NX/etc/node.cfg)
DisplayServerExtraOptions "-timeout s"
where s is the timeout in seconds. The minimum timeout is 60 seconds.
For example, to disconnect all sessions after 10 minutes of inactivity, set:
DisplayServerExtraOptions "-timeout 600"
If the NoMachine display agent doesn't receive any input from the user in the given timeout, it will either disconnect or terminate the session. Termination of the session will be carried out if the session is not persistent or no X application is connected to the display. Otherwise the agent will disconnect the session so that the X applications will be left running.
Note that the DisplayServerExtraOptions key is only for virtual desktops or custom sessions with X11 vector graphics enabled (default).
For web sessions, or sessions sharing a virtual desktop (shadowing) or when X11 vector graphics is disabled or when connecting to the physical desktop, the timeout option has to be added to the DisplayAgentExtraOptions key in node.cfg:
DisplayAgentExtraOptions "-timeout 600"
