Knowledge Base
Searching in : Article
ID: AR02N00877
Applies to: NoMachine Server
Added on: 2016-02-18
Last Update: 2023-05-10

The server.cfg and node.cfg files explained

THE CONFIGURATION FILES ON THE INSTALLATION HOST

Server.cfg and node.cfg are the configuration files for tuning the NoMachine server's behavior (and also for NoMachine Enterprise Terminal Server Node for installations on remote nodes in Enterprise Terminal Server multi-node environments). They are provided with the installation of a NoMachine package for server side including the free version.

The server.cfg and/or node.cfg files are placed in :

/usr/NX/etc/on Linux

C:\Program files\NoMachine\etc\server.cfg for 64bit packages on 64bit systems
and C:\Program files (x86)\NoMachine\etc\server.cfg for 32bit packages on Windows 64bit systems

/Applications/NoMachine.app/Contents/Frameworks/etc/server.cfg on macOS.

Settings in the server.cfg file

The server.cfg file rules the general behavior of the server, for example it defines: 

- Enabling/disabling requesting the desktop owner's authorization to connect to someone else's desktop.
- Maximum number of connections and virtual desktops allowed on the server host.
- Allowing/Forbidding users to connect using an account with administrative privileges
- The load-balancing algorithm to be used for choosing the remote node in case of an Enterprise Terminal Server multi-node environment.
- Limiting the connection protocol to NX or SSH only etc ...

and so on.

Settings in server.cfg applies to all users and are overridden by profile rules when set.

 

Settings in the node.cfg file

The node.cfg file allows to configure behaviors specific for the host where it's installed. For example:

- The system command to start the desktop environment on Linux.
- Enabling/disabling services such as sharing devices, printers, file transfer and USB devices forwarding
- Enabling/disabling the X11 vector graphics mode and the VirtualGL support for NoMachine Linux virtual desktops
- Enabling/disablink the blanking of the physical screen when somebody is connected etc...

Settings in the node.cfg file applies to all users accessing this host. Some of them are strictly dependent on the host environment. E.g the installation procedure configures the command to start the desktop environment on Linux according to the default desktop set on the system; the same is for audio support (PulseAudio or Alsa or PipeWire for connections to physical desktop).

Some notes:

(1) about custom scripts

Both server.cfg and node.cfg provide a set of keys to execute custom scripts triggered on server or node events respectively. The main difference is that scripts executed on the server are run as 'nx' user and apply globally to all users. They require access permissions for the nx user and for example cannot access a user's home directory. Scripts executed on the node instead, are run as the logged-in user and have full access to all resources of this user.


(2) about the 'AvailableSessionTypes' key

The AvailableSessionTypes key is present in both server.cfg and node.cfg and permits to define which types of session will be made available to end-users. When server.cfg and node.cfg are on the same host, the list of session types must be the same in both keys. These keys are automatically populated at installation time. If a new session type is added later, they have to be edited manually. Restart the server to make this change effective.

Settings in the AvailableSessionTypes key are overriden by profile rules when set.

 

THE CONFIGURATION FILES IN A MULTINODE ENVIRONMENT

In case of a multinode environment there is a server.cfg and a node.cfg file on the main server host and on each of the remote nodes.

Custom values can be set on the main server and will apply to the whole multi-node system or can be set on a specific node and will apply to this node only. Custom limits can be set also on the main server and on each of the remote nodes.

If access to localhost is disabled on the main server, settings in node.cfg on the main server will be ignored and only settings in the node.cfg file on the remote node(s) will apply.

Settings in server.cfg on the main server, instead, are always taken in account, even when sessions are not started on its host.
 

Most common cases:

(1) Set different limits to number of connections or virtual desktops on the remote nodes

Limit the global number of virtual desktops to for example 100 in the server.cfg file on the main server (VirtualDesktopsLimit 100).
You can then limit the number of virtual desktops on a per-node basis by setting it in the server.cfg file of each node.

Sum of values set on all remote nodes must not be higher than the value set in the main server.cfg, 100 in this case.

See https://www.nomachine.com/AR08M00858 for more details on this example.
 

(2) Configure different services on each node

Services like printer sharing, USB support, file transfer can be set individually on each node. Edit node.cfg on each of the node hosts and for example enable printers on the remote node A and disable them on the remote node B.


(3) Limit copy&paste operations on specific nodes only

Allow full copy and paste operations in the server.cfg file on the main server (EnableClipboard both), and edit the server.cfg of the remote node where you want to restrict this ability.
 

TIP

A more efficient way to perform custom configurations in case of multi-node environments is to use profile rules. See the server administrator's guide for your server available in the 'Installation' section at: https://www.nomachine.com/all-documents.

 

(4) Custom scripts in multinode environments

- Custom scripts related to login events have to be placed in the server.cfg file on the main server host.

- Custom scripts related to session events (included session failure) have to be placed in the server.cfg file on each of the remote nodes.

- Custom scripts related to user events (create, delete, enable, disable) have to be placed in the server.cfg file on the main server host.

 

(5) The AvailableSessionTypes key in multinode environments

The AvailableSessionTypes key is present in the server.cfg and node.cfg file on the main server host and on each remote node. In case of a multinode environment the AvailableSessionTypes key in the server.cfg file on the main server host must list all types of sessions available on all nodes. When the user connects an the load-balancing mechanism is used, the main server will select the node in the pool of those nodes which has the requested session type.

On each node, set the AvailableSessionTypes key to provide the list of session types available for the node.

The AvailableSessionTyps keys are automatically populed at installation time. If a new session type is added later:

- Edit the AvailableSessionTyps key manually.

- If the remote node is already added to the main server, run this command on the main server:

For v. 8 
nxserver --configupdate
 
For previous versions:
nxserver --nodeupdate

- Finally, restart the server to make changes effective.
 

Profile rules, when set, override settings of the AvailableSessionTypes key.