NoMachine Terminal Server Node - Installation and Configuration Guide (v.6)
|
It is possible to welcome users when session is started by issuing a greeting message, either only the first time the user logs in or every time the user connects to the Terminal Server Node. Update the node configuration file by writing the text of your message in any of the following keys: NodeFirstLoginGreeting "Welcome to your first NoMachine session"
NoMachine provides an instant messaging tool, named whiteboard which allows also drawing and sharing files with connected users and fast-track access to file transfer. To access it, connect to the user's desktop and from the Monitor (!M icon) in your system tray click on 'Show the whiteboard'. Note that if multiple users are connected at the same time to the same session, they will all see the message.
As an alternative, it's possible to issue a dialog in the connected sessions to show a custom message by sending it from command line. Sending a message to all running sessions:
NX Protocol SSH Protocol
Protocol to be used for server-node connections has to be defined while adding the Terminal Server Node to the Enterprise Terminal Server. Use the NX protocol It's possible to change the listen port for nxd, in this case it will be necessary to add the Terminal Server Node by specifying the port. On the Enterprise Terminal Server host, execute:
You can change port for nxd or in the server configuration file by editing this key: Restarting the nxd service is necessary to make this change effective:
Use the SSH protocol In order to use the SSH protocol, it's necessary to add the Terminal Server Node by specifying the protocol, and in some cases the port. If port is not specified, the default port 22 is used. Execute on the Enterprise Terminal Server host:
Each session is uniquely identified by a session id (which can look like: B253864E822F5A235825F3AB8853AF00) and a display id (e.g.,1002). A session on the NoMachine Terminal Server Node can be in any of the following statuses: Sessions on the Terminal Server Node can be monitored and managed on the Enterprise Terminal Server.
Pre-requisite to connecting by NoMachine is that a desktop environment is installed on the system even if the host is headless or it's not started in graphics mode. During its installation, NoMachine detects the default desktop environment set on the system and configures the node accordingly. Path and command to start the system desktop environment is defined in the node configuration file by the DefaultDesktopCommand key. The Terminal Server Node is able to detect GNOME, Unity, KDE, LXDE and Xfce (since NoMachine v. 6.7). If you have a different desktop environment, it's necessary to edit the DefaultDesktopCommand key accordingly. For example to run MATE: or to run Pantheon: If there are multiple desktop environments installed, you can specify in the same key the desktop to be launched. For example if you have KDE, GNOME and Xfce installed installed on Ubuntu 16.04 and want users to be able to run new virtual KDE desktops, set the configuration key to: If you want they create new GNOME virtual desktops instead, set: or for creating Xfce virtual desktops:
The server configuration and the node configuration provide a number of keys that can be activated to execute a custom script upon a certain event. In case of Terminal Server Node, only scripts related to login events can be set in server.cfg. Scripts related to session events have to be set in the node.cfg. A number of parameters can be specified for each script. Scripts set on the Terminal Server Node are executed on that host and apply only to those users who are connecting to it.
(*) 'main session id' and 'main session type' parameters are available only when the user connects to an already running virtual desktop (session shadowing). They indicate respectively the id and type of the session to which the user is connected with his/her own session qualified by 'session id' and 'session type'. A further key in the node configuration file (available since v. 6.3.6), allows to run a custom script triggered on change resolution events (resize of the remote screen). The related key is: Note that the order of parameters is relevant. For example, a custom script to be run on node event 'UserScriptBeforeSessionStart' should use the $2 variable to retrieve username and $4 to retrieve display. Pre-requisites to run custom scripts Custom scripts set-up in node.cfg are executed by the nxnode program, which is run as the connected user. Place the script in a directory that is accessible by the node, i.e. accessible by the connected user(s). By default if the execution of the scripts fails, the nxserver and nxnode will terminate. This means that the user's session will not start. You can override this behavior by forcing exit 0 inside the custom script and let the session start even if the custom script is failed.
In order to limit the number of virtual desktops on this Terminal Server Node, it's advisable to use profile rules. They have to be executed on the Enterprise Terminal Server. Note that the server.cfg file on the Terminal Server Node provide the following keys:
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Disconnecting or Terminating Virtual Desktops Automatically
To disconnect a virtual desktop or custom sessions after a certain time of inactivity, uncomment and set a proper timeout value, in seconds, in the following node configuration key. For example, if you want to terminate sessions after 10 minutes of inactivity you need to 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 sessions connected to a virtual desktop (sharing of the virtual desktop), virtual desktops with X11 vector graphics disabled and connections to the physical desktop set instead:
DisplayAgentExtraOptions "-timeout 600"
| 9. Device Sharing, Copy&Paste and File Transfer | |
The Terminal Server Node allows users to access and share their devices and resources from local to remote and vice-versa. Disks, printers, USB devices and more can be connected inside the session to easily access them from both client and server side. At present device sharing is not available with web sessions and is only available in connections by NoMachine client.
Two-way copy and paste is fully supported. Web sessions implement the NoMachine virtual clipboard which allows copying text from/to the session running in the browser and the local computer.
Download/upload files from the session to the local computer and vice-versa is also fully supported in client and web sessions, as well as drag and drop of a file from remote to local and from local to remote.
By default device sharing, copy&paste and file transfer are always permitted. You can however completely disable any of these services or disable it only partially, for example to prevent users from sharing their local printer in the NoMachine session but permitting them to use the remote printer.
Limiting or forbidding device sharing, copy and paste and file transfer can be done on the Enteprise Terminal Server by means of profile rules. Please refer to the Enterprise Terminal Server guide here: https://www.nomachine.com/all-documents for detailed instructions.
| 10. Multimedia and Session Recording | |
| 10.1. Supporting Audio and Microphone |
On Linux, NoMachine audio framework is integrated with PulseAudio sound server. If PulseAudio is not available on the system, NoMachine is able to use ALSA (Advanced Linux Sound Architecture). This is automatically managed by the NoMachine server so that multimedia support can work out of the box without the need for any configuration. If both PulseAudio and Alsa are available, the administrator might want to configure the node to use one or the other.
Disabling or Setting Audio Support
To disable audio and microphone support, uncomment and set the AudioInterface key to 'disabled' in the node configuration file:
AudioInterface disabled
On Linux it is possible to define whether PulseAudio Server or ALSA has to be used by setting AudioInterface key to 'pulseaudio' or 'alsa' respectively. For example:
AudioInterface pulseaudio
| 10.2. Recording your Screen |
NoMachine can record in a video all activity made inside the session or on the desktop. To start the recording of the session, users should open the NoMachine menu inside the session (ctrl+alt+0) and click on the 'Recording' button icon to access the Recording panel. From this panel it's possible to open the recording bar, change audio and video quality and open the recording directory to access all recorded files. Session recording is not available with sessions on the web.
To record activity made on the desktop, start the recording from the !M icon menu in the system tray of the Terminal Server Node host and show the Recording bar from there. Desktop activities can also be registered on the physical desktop without the need to be connected via NoMachine.
Recorded files are saved by default in WebM format and can be played back directly with NoMachine or any other player supporting that format. Video streams can be encoded only with VP8 or H.264 when supported. Recorded files are saved by default on the user's device in the NoMachine directory under the 'Documents' directory.
Disabling session recording
To prevent users from recording their session activities, edit the node configuration to set:
EnableSessionRecording 0
Disabling desktop recording
To prevent users from recording desktop activities, even when physically logged into the Terminal Server Node host, edit the node configuration to set:
EnableLocalRecording 0
| 11. Automatic Updates | |
The Terminal Server Node, as well as the other NoMachine client and server products, periodically checks NoMachine repositories (by default every two days) to verify if updates are available and will prompt a dialog informing the user that a new version is available.
It will never automatically update the current installation. Also the download in background of a new software version will not lead to an automatic update of the current installation.
A separate guide which deals specifically with all the possible options for the automatic software updates is available on the web site in this section:
https://www.nomachine.com/all-documents
| 12. Logging Facilities | |
Two separate guides, available in the Documents section on the NoMachine web site (https://www.nomachine.com/all-documents) provide step-by-step instructions for that.
|
|||
|
|
|||
| When debug mode is enabled, nxserver.log may increase consistently. It's suggested to keep debug level only for the time necessary to reproduce the problem and collect logs. | |||
| 12.1. Using the System Logging Facilities |
By default the nxserver and nxnode programs log to the file defined in the SystemLogFile key in their configuration files (server.cfg and node.cfg).
It's possible to configure these applications to log to the system log file instead. Edit the server.cfg and node.cfg files, uncomment and set:
EnableSyslogSupport 1
Then restart the server and all services to make the change effective:
| nxserver --restart |
| 12.2. Redirecting Logs to a Custom File |
You can redirect logs of nxserver and nxnode programs to a custom file by uncommenting and setting the path to that file in the SystemLogFile key available in the server and node configuration files. By default this key is set to:
SystemLogFile /usr/NX/var/log/nxserver.log
Change it to point to a different file, for example:
SystemLogFile /tmp/NX.log
|
|||
|
|
|||
| The custom file must be accessible (writable) to the 'nx' user and to the connected user. | |||
| 12.3. Configuring the Automatic Clean-up of Session Directories |
In its default configuration, the Terminal Server Node removes the session directory once the session has been correctly terminated. Sessions directories are stored in the /usr/NX/var/log/node/ directory.
You can preserve them, for example for log purposes, by uncommenting and disabling the following key in the node configuration file. In this case, the session directory is renamed as T-C*:
SessionLogClean 0
|
|||
|
|
|||
| While investigating an issue affecting a session on the Terminal Server Node, logs from that host are usually needed. | |||
| 12.4. NoMachine Log Rotation |
NoMachine supports log rotation for its log files since v. 6.5.6. Once activated, in the default configuration, logs are rotated once per month when they exceed 100MB. If not otherwise specified, NoMachine preserves up to seven rotated files and deletes the oldest ones.
Rotated logs are saved in the BaseDirectory/NX/var/log/logrotate directory, in a default installation: /usr/NX/var/log/logrotate.
To activate log rotation:
| /etc/NX/nxserver --logrotateadd OPTION |
| OPTION can be any of the following: --rotate VALUE, specify the maximum number of rotated files to be preserved in the logrotate directory. When this number is exceeded, the oldest files are deleted. --timeinterval TIME, specify the frequency of log rotation. Frequency can be specified in seconds or by using the 'Daily', 'Weekly', 'Monthly', or 'Yearly' keyword. Rotate logs when the interval of time and the minimum log size is reached. --minsize VALUE, specify the minimum file size for rotating logs according to the given interval of time. If the minimum size is not reached, logs are not rotated. Value is by default in kilobytes, add M or G to set it in megabytes or gigabytes respectively. --size VALUE, specify the minimum file size for applying log rotation as soon as the file size is reached, regardless of the frequency set for log rotation. --compress yes|no, by default each log file is compressed as a gz archive, use '--compress no' to not compress it. --destination PATH, provide an alternative path where to store the rotated files. |
| If OPTION is not specified, the default settings will be applied. |
By default, log rotation is applied to all NoMachine log files. It's possible to specify which log file should be under log rotation:
| /etc/NX/nxserver --logrotateadd LOG OPTIONS |
| LOG can be any of the following file names: nxserver.log nxerror.log nxd.log nxservice.log (on Windows only) nxwebclient.log nxhtd-error.log nxhtd-access.log |
| If OPTION is not specified, the default settings will be applied. |
To edit parameters set for log rotation:
| /etc/NX/nxserver --logrotateedit LOG OPTION |
| To list current settings for log rotation: |
| /etc/NX/nxserver --logrotatelist |
| To delete all settings for log rotation: |
| /etc/NX/nxserver --logrotatedel |
| To delete log rotation settings for a specific log file: |
| /etc/NX/nxserver --logrotatedel LOG |
Some examples:
| Rotate all logs monthly (the minimum size is the default 100MB): |
| /etc/NX/nxserver --logrotateadd --timeinterval Monthly |
| Rotate only nxserver.log (which usually has the most relevant size) weekly if it exceeds the default size of 250MB: |
| /etc/NX/nxserver --logrotateadd nxserver.log --timeinterval Weekly --minsize 250M |
| Rotate nxserver.log when it exceeds 250MB: |
| /etc/NX/nxserver --logrotateadd nxserver.log --size 250M |
| Rotate the given logs weekly when they exceed 250MB and save the rotated files in a specific path: |
| /etc/NX/nxserver --logrotateadd nxserver.log --timeinterval Weekly --minsize 250MB --destination /var/log/ |
It's possible to force log rotation at any moment. This doesn't require to enable it. To apply log rotation to all files or to a given log only:
| /etc/NX/nxserver --logrotate LOG OPTIONS |
| OPTION can be any of the following options: --compress yes|no, by default the log file is compressed as gz archive, use '--compress no' to not compress it. --destination PATH, provide an alternative path where to store the rotated files. |
|
|||
|
|
|||
| To debug a problem easily reproducible, it could be helpful to clean up logs with 'nxserver --logrotate', activate the debug log level with 'nxserver --debug --enable all', reproduce the problem, collect logs with 'nxserver --debug --collect' and finally restore informational log level with 'nxserver --debug --disable all'. | |||



