Knowledge Base
Searching in : Document
ID: DT07S00244
Version: NoMachine 8
Added on: 2022-09-14
Last Update: 2024-04-26
Print this article

Collect server and client logs manually

COLLECT AND SEND SERVER SIDE LOGS

1. How to Collect Server Side Logs


Server side logs have to be collected on the NoMachine host where the problem occurs:

  1. Standalone NoMachine Servers
    Follow instructions for the appropriate Operating System and execute them on the NoMachine Server host.
  2. Multi-node environments (CS + nodes)
    Depending on the problem, it may affect the main Cloud Server or any of the servers on the nodes. Follow instructions for the appropriate Operating System and execute them on the affected host(s).
  3. Multi-node environments (ETS + ETSN)
    In a similar way, when the problem may affect the Enterprise Terminal Server or Enterprise Terminal Server Cluster and/or any of the Enterprise Terminal Server Nodes, follow instructions for the appropriate Operating System and execute them on the affected host(s).

These are the general steps to collect and send logs:
1) On the server/node host set debug log level manually.
2) Reproduce the problem.
3) On the server/node host create the compressed archives of logs.
4) If requested, collect client side logs on the user's device.
5) Send the log archives to NoMachine Support Team by e-mail or ask Support to provide a space for uploading logs if size is too big for an e-mail attachment.

When the problem is easily reproducible or if the Support Team requested that, you may clean the server/node logs before starting the procedure to collect them. Execute, on Linux and macOS:

$ sudo /etc/NX/nxserver  --logrotate

on Windows:

> %ALLUSERSPROFILE%\NoMachine\nxserver\nxserver.exe  --logrotate

Logs on server/node host are the following.

Logs related to NoMachine sessions (user's log)
Logs related to NoMachine sessions are stored in the user's home:
nxserver and nxnode (running as the logged user) processes write logs on Linux and macOS in:
$HOME/.nx/nxserver.log
and on Windows in:
%USERPROFILE%\.nx\nxserver.log

Logs related to the Display Agent
Logs related to the NoMachine display agent in charge of managing the user's session are stored in the correspondent session directory created in the user's home/.nx/node/ directory.
In case of the login screen, the display agent is running as the display manager, logs will be on Linux in the home/.nx directory of the display manager. For example if the display manager is gdm, logs will be stored in the correspondent session directory in /var/lib/gdm/.nx. On macOS, they are stored in the correspondent session directory in /Library/Application\ Support/NoMachine/var/log/node and on Windows in %PROGRAMDATA%\NoMachine\var\log\.
The name of the session directory includes the display number and the session id (which can be retrieved by the 'nxserver --history' command). Depending on the status of session, it's prefixed by:
C- for Linux virtual desktops or connections to physical desktop, actually Connected
R- for Linux custom sessions actually connected
T- for sessions Terminated
F- for sessions terminated abnormally

Logs related to NoMachine operations
Logs related to other operations (e.g. user's login/logout; start and stop of services etc ...), executed by NoMachine processes running as 'nx' user, 'SYSTEM' (on Windows) or 'root' (on Linux/macOS) are saved on Linux in:
/usr/NX/var/log/nxserver.log
on macOS:
/Library/Application\ Support/NoMachine/var/log/nxserver.log
and on Windows:
%PROGRAMDATA%\NoMachine\var\log\nxserver.log

Logs related to web sessions
The nxwebrunner process writes logs on Linux in:
/usr/NX/var/log/nxwebrunner.log
on macOS:
/Library/Application\ Support/NoMachine/var/log/nxwebrunner.log
and on Windows:
%PROGRAMDATA%\NoMachine\var\log\nxwebrunner.log

The nxwebplayer process on Linux writes log in:
/var/NX/nxhtd/.nx/nxserver.log
on macOS:
/Library/Application\ Support/NoMachine/var/nxhtd/.nx/nxserver.log
and on Windows:
%PROGRAMDATA%\NoMachine\var\log\nxserver.log

The nxhtd process (built-in web server running as nxhtd user) on Linux writes logs to:
/usr/NX/var/log/nxhtd.log
on macOS:
/Library/Application\ Support/NoMachine/var/log/nxhtd.log
and on Windows:
%PROGRAMDATA%\NoMachine\var\log\nxhtd.log

Rotated log files
Rotated files are saved in the NoMachine var/log/logrotate, on Linux:
/usr/NX/log/logrotate
on macOS:
/Library/Application\ Support/NoMachine/var/log/logrotate
and on Windows:
%PROGRAMDATA%\NoMachine\var\log\logrotate on Windows

1.1. Server on Linux

Step 1 - Set debug level in server.cfg and node.cfg
Edit /usr/NX/etc/server.cfg, remove the # from the key name (uncomment) and set the following:
SessionLogLevel 7

If the problem affects web sessions, set also:
WebSessionLogLevel 7

Edit /usr/NX/etc/node.cfg, remove the # and set the following:
SessionLogLevel 7
and:
SessionLogClean 0

It's NOT necessary to restart the server or the NoMachine services, except if this has been requested by the Support Team.

Step 2 - Reproduce the problem

Connect to the NoMachine server and reproduce the problem.

Once reproduced:
- collect server side logs.
- collect client side logs if requested.

Step 3 - Collect server side logs on the remote computer
3.1. Create a compressed tar.gz archive of the /usr/NX/var/log directory:

$ sudo tar cvfz NoMachine-log.tar.gz /usr/NX/var/log

3.2. Create a compressed tar.gz archive of the user's home/.nx directory:

$ sudo tar -cvp --exclude 'cache*' --exclude 'images' --exclude 'temp'    $HOME/.nx  | gzip -c >user_nxdir.tar.gz

In case of debug for web sessions, compress and send also the /var/NX/nxhtd/.nx directory:

$ sudo tar -cvp  /var/NX/nxhtd/.nx  | gzip -c >nxhtd_nxdir.tar.gz

Step 4 - Collect client side logs on user's device
Inside the NoMachine session, open the menu panel by ctrl+alt+0 or click on the page peel at the top right corner of the window. Open 'Connection' and click on 'Take the logs' button on the left and choose where to save logs. A copy of the session directory is created to store logs and named as session name plus date. Compress it to create the log archive to be sent to Support Team.

As an alternative to be used for example to debug a problem which causes a session freeze, follow manual instructions to gather client logs.

Step 5 - Send the server logs archives to the Support Team
Send the log archives as e-mail attachment. Please be sure to include ID of the inquiry to the subject of your e-mail or request for a temporary upload space if the size of the archives is too large.

1.2. Enterprise Terminal Server Node (Linux)

Step 1 - Set debug level in server.cfg and node.cfg
Edit /usr/NX/etc/server.cfg, remove the # from the key name (uncomment) and set the following:
SessionLogLevel 7

Edit /usr/NX/etc/node.cfg, remove the # from the key name and set the following:
SessionLogLevel 7
and:
SessionLogClean 0

Step 2 - Reproduce the problem
Connect to the NoMachine server and reproduce the problem.

Step 3 - Collect server side logs on the node
3.1. Create a compressed tar.gz archive of the /usr/NX/var/log directory:

$ sudo tar cvfz NoMachine-log.tar.gz /usr/NX/var/log

3.2. Create a compressed tar.gz archive of the user's home/.nx directory:

$ sudo tar -cvp --exclude 'cache*' --exclude 'images' --exclude 'temp'    $HOME/.nx  | gzip -c >nxdir.tar.gz


Step 4 - Collect client side logs on user's device
Inside the NoMachine session, open the menu panel by ctrl+alt+0 or click on the page peel at the top right corner of the window. Open 'Connection' and click on 'Take the logs' button on the left and choose where to save logs. A copy of the session directory is created to store logs and named as session name plus date. Compress it to create the lo

As an alternative to be used for example to debug a problem which causes a session freeze, follow manual instructions to gather client logs.

Step 5 - Send the log archives to the Support Team
Send the log archives as e-mail attachment. Please be sure to include ID of the inquiry to the subject of your e-mail or request for a temporary upload space if the size of the archives is too large.

1.3. Server on macOS

Step 1 - Set debug level in server.cfg and node.cfg
Edit /Applications/NoMachine.app/Contents/Frameworks/etc/server.cfg, remove the # from the key name (uncomment) and set the following:
SessionLogLevel 7

If the problem affects web sessions, set also:
WebSessionLogLevel 7


Edit /Applications/NoMachine.app/Contents/Frameworks/etc/node.cfg, remove the # from the key name and set the following:
SessionLogLevel 7
and:
SessionLogClean 0

It's NOT necessary to restart the server or the NoMachine services, except if this has been requested by the Support Team.

Step 2 - Reproduce the problem
Connect to the NoMachine server and reproduce the problem.

Step 3 - Collect server side logs on the remote computer
3.1. Create a compressed tar.gz archive of the /Library/Application Support/NoMachine/var/log directory:
Navigate with the Finder till the /Library/Application Support/NoMachine/var/log directory. Compress this folder: control-click or right-click the folder and then choose 'Create Archive' from the pop-up menu.

3.2. Create also a compressed tar.gz archive of the user's home/.nx directory:

As an alternative, you can create the archives from command line:

$ sudo tar cvfz NoMachine-log.tar.gz "/Library/Application Support/NoMachine/var/log"
$ sudo tar -cvp --exclude 'cache*' --exclude 'images' --exclude 'temp' $HOME/.nx | gzip -c >nxdir.tar.gz

In case of debug for web sessions, compress and send also the /var/NX/nxhtd/.nx directory:

$ sudo tar -cvp  /Library/Application\ Support/NoMachine/var/nxhtd/.nx | gzip -c >nxhtd_nxdir.tar.gz

Step 4 - Collect client side logs on user's device
Inside the NoMachine session, open the menu panel by ctrl+alt+0 or click on the page peel at the top right corner of the window. Open 'Connection' and click on 'Take the logs' button on the left and choose where to save logs. A copy of the session directory is created to store logs and named as session name plus date. Compress it to create the lo

As an alternative to be used for example to debug a problem which causes a session freeze, follow manual instructions to gather client logs.

Step 5 - Send the log archives to the Support Team
Send the log archives as e-mail attachment. Please be sure to include ID of the inquiry to the subject of your e-mail or request for a temporary upload space if the size of the archive is too large.

1.4. Server on Windows

Step 1 - Set debug level in server.cfg and node.cfg
Copy the InstallationDirectory/NoMachine/etc/server.cfg file in a temporary folder and open the file with an editor like WordPad. This is necessary for being able to edit the file.

Edit the copy of the server.cfg file, remove the # from the key name (uncomment) and set the following:
SessionLogLevel 7

If the problem affects web sessions, set also:
WebSessionLogLevel 7

Copy the modified server.cfg file to InstallationDirectory/NoMachine/etc/server.cfg. Administrative privileges are required.

Copy the InstallationDirectory/NoMachine/etc/node.cfg file in a temporary folder and open the file with an editor like WordPad. This is necessary for being able to edit the file.

Edit the copy of the node.cfg file, remove the # from the key name and set the following:
SessionLogLevel 7
and:
SessionLogClean 0

Copy the modified node.cfg file to InstallationDirectory/NoMachine/etc/node.cfg. Administrative privileges are required.

It's NOT necessary to restart the server or the NoMachine services, except if this has been requested by the Support Team.

Step 2 - Reproduce the problem
Connect to the NoMachine server and reproduce the problem.

Step 3 - Create the compressed server side logs archives
3.1. Create a compressed archive of the NoMachine's /var/log directory

The NoMachine /var/log directory is:
%PROGRAMDATA%/NoMachine/var/log on Windows Vista, 7, 8, 8.1,10 and 11.

To compress it, right-click the file or folder, point to Send To, and then click Compressed (zipped) Folder.

3.2. Create a compressed tar.gz archive of the user's home/.nx directory:
The .nx folder is hidden. To find it, write %USERPROFILE%\.nx in the address bar or the file browser.

Windows set-up log files for NoMachine
When the problem is related to the installation, consider that Windows write a system installation log for the NoMachine program in:
%USERPROFILE%/AppData/Local/Temp/Setup Log...

Step 4 - Collect client side logs on user's device
Inside the NoMachine session, open the menu panel by ctrl+alt+0 or click on the page peel at the top right corner of the window. Open 'Connection' and click on 'Take the logs' button on the left and choose where to save logs. A copy of the session directory is created to store logs and named as session name plus date. Compress it to create the lo

As an alternative to be used for example to debug a problem which causes a session freeze, follow manual instructions to gather client logs.

Step 5 - Send the log archives to the Support Team
Send the logs archive as e-mail attachment. Please be sure to include ID of the inquiry to the subject of your e-mail or request for a temporary upload space if the size of the archive is too large.

1.5. Enabling Debug for the 'nxserver --daemon' Process (already running)

The 'nxserver --daemon' process is in charge of specific operations like to detect the physical display, start/stop the NoMachine web server nxhtd, create new virtual desktops on Linux and more. Enabling this debug mode doesn't require to restart the server. The 'daemon' option can be used in conjuction with the other --enable/--disable options of the 'nxserver --debug' command.

Linux and macOS

To enable this debug on Linux and macOS, open a terminal and execute:

$ sudo /etc/NX/nxserver --debug --enable daemon

If you are the root user, run the command above without 'sudo'.

To disable this debug mode:

$ sudo /etc/NX/nxserver --debug --disable  daemon

Windows

To enable this debug on Windows, open a CMD console as administrator:

> %ALLUSERSPROFILE%\NoMachine\nxserver\nxserver.exe  --debug  --enable daemon

To disable the debug mode:

> %ALLUSERSPROFILE%\NoMachine\nxserver\nxserver.exe --debug --disable daemon

COLLECT AND SEND CLIENT SIDE LOGS

2. How to Collect Client Logs from Users' Devices


When the connection terminates with an error, the client shows a dialog with a short error message and allows to save logs of that problem into a directory.
In this case:

  • Save client logs when prompted to do it.
  • Compress the directory containing logs.
  • Send the archive to NoMachine Support Team by e-mail.

When the connection doesn't terminate with an error but shows an unexpected behavior to be investigated (e.g. black or frozen screen, wrong keyboard mapping etc ...) the client cannot issue the dialog to save error logs. In this case, or if requested by the NoMachine Support Team, you have to retrieve logs.

If the client is responsive, inside the NoMachine session, open the menu panel by ctrl+alt+0 or click on the page peel at the top right corner of the window. Open 'Connection' and click on 'Take the logs' button on the left and choose where to save logs. A copy of the session directory is created to store logs and named as session name plus date. Compress it to create the log archive to be sent to Support Team.

As an alternative, to be used for example to debug a problem which causes a session freeze, collent client logs manually.
Be sure that the Don't delete log files on exit checkbox is selected in UI -> Settings -> Player -> Security panel before launching the client to reproduce the problem. Do not close the client once problem has been reproduced.

Collecting client side logs manually
- launch the NoMachine UI on the user's computer from Programs or Menu
- click on Settings -> Player -> Security
- check Don't delete log files on exit option
- Connect to the server and reproduce the problem.
- Compress the user's home/.nx directory containing logs.
- Send the compressed logs archive to NoMachine Support Team by e-mail.

If the user instead runs sessions via web, launch the web session in debug mode as explained in the dedicated paragraph.

2.1. Client on Linux

Create a compressed tar.gz archive of the .nx directory in the user's home on his/her computer:

$ tar -cvp --exclude 'cache*' --exclude 'images' --exclude 'temp'   $HOME/.nx | gzip -c >nxdir.tar.gz
or, if you are not the owner of this user's home, run the command with sudo:
$ sudo tar -cvp --exclude 'cache*' --exclude 'images' --exclude 'temp' $HOME/.nx | gzip -c >nxdir.tar.gz

2.2. Client on macOS

Create a compressed archive of the .nx directory in the user's home.

Navigate with the Finder till the .nx directory. To reduce the size of the archive, remove cache, images and recording sub-directories under .nx before creating the compressed folder.

Compress this folder: control-click or right-click the folder and then choose 'Create Archive' from the pop-up menu.

As an alternative, you may create a tar.gz archive from command line. Run in a console:

$ tar -cvp --exclude 'cache*' --exclude 'images' --exclude 'temp'  $HOME/.nx  | gzip -c >nxdir.tar.gz
or, if you are not the owner of this user's home, run the command with sudo:
$ sudo tar -cvp --exclude 'cache*' --exclude 'images' --exclude 'temp' $HOME/.nx | gzip -c >nxdir.tar.gz

2.3. Client on Windows

Create a compressed archive of the .nx directory in the user's home.

The .nx folder is hidden. To find it, write the following in the address bar or the file browser: %USERPROFILE%\.nx

As an alternative, you may navigate through the computer folder till the user's home and digit .nx in the navigation toolbar to reach this hidden folder. Path can be similar to: C:/Users/nomachine/.nx

To reduce the size of the archive, remove cache, images and recording sub-directories under .nx before creating the compressed folder.

Then compress the .nx directory: right-click the file or folder, point to Send To, and then click Compressed (zipped) Folder.

Provide also the nxtrace.log if present. The nxtrace.log file is generated only in case of a sudden termination of any of the NoMachine programs. It's stored in:
%PROGRAMDATA%/NoMachine/var/log on Windows Vista, 7, 8, 8.1, 10 and 11.

You may also search it on your computer by using the Windows tool: use the Search box on the Start menu to find programs, type there nxtrace.log to locate this file.

2.4. Client on Android Tablets/Smartphones

Please refer to instructions here:
https://www.nomachine.com/AR04M00843

2.5. Client on iOS Devices

Please refer to instructions here:
http://www.nomachine.com/AR07N00897

2.6. Browser (Web Sessions)

Logs are stored in the browser's local storage, so the user's browser needs to have Local Storage support. If yes:

Step 1 - Point your browser to the webplayer application and run it in debug mode:
https://server:port/?logging=start

For example:
https://testdrive.nomachine.com:4443/?logging=start

Step 2- Log-in to NoMachine and perform all steps requested to reproduce the problem.

Once the problem is reproduced, retrieve logs by typing in the browser's navigation bar:
https://server:port/?logging=get

For example:

For example:
https://testdrive.nomachine.com:4443/?logging=get

This will disconnect the session and display the logs page.

Step 4 - Click on the 'Download' button in the upper right corner of the page to download and save the log file.

Step 5 - Send the log file to NoMachine Support Team by e-mail. Please be sure to include ID of the enquiry in the subject of your e-mail.

For turning off the debug mode, type in the browser's navigation bar the action to stop the debug mode, for example:

For turning off the debug mode, type in the browser's navigation bar the action to stop the debug mode, for example: https://testdrive.nomachine.com:4443/?logging=stop

3. How to Locate the Connection Settings File (.nxs)


Configuration of the client's session (namely the connection file .nxs) is stored by default in /Documents/NoMachine.

To verify where the session files are effectively saved, run the NoMachine UI and click on Settings -> Player -> Folders. Check path set for 'Connections and recordings'.

OTHERS

4. How to Gather a Stacktrace


In many cases a core file debugged outside of the original environment doesn't provide all the necessary information. That's why it's important to gather the stacktrace onsite and send it to the Support Team for analysis.

4.1. On Linux

Please refer to instructions here for debugging a core file onsite:
https://www.nomachine.com/AR09L00810

To know which application has generated the core, run from a console:

file PATH_TO_CORE_FILE

4.2. On macOS

On macOS you need to reetrieve stacks automatically generated by the system.

Diagnostic reports are stored in:
a) ~/Library/Logs/DiagnosticReports
and:
b) /Library/Logs/DiagnosticReports
Note that path a) and b) are different.

Stacks for NoMachine programs are prefixed with 'nx', retrieve them from directories a) and b) if any and send the diagnostic reports as e-mail attachment.

4.3. On Windows

In case of a sudden termination, NoMachine programs generate on Windows the nxtrace.log file.

This file is placed in the following directory:
%PROGRAMDATA%/NoMachine/var/log on Windows Vista, 7, 8, 8.1, 10 and 11

Otherwise you may search for nxtrace.log on your computer by using the Windows tool: use the Search box on the Start menu to find programs, type there nxtrace.log to locate this file.

5. How to Debug a CPU Consuming Process on Linux


Please refer to instructions here:
https://www.nomachine.com/AR09L00809

6. How to Debug the NoMachine Monitor on Linux


Please refer to instructions here:
https://www.nomachine.com/AR03O00922

7. Troubleshooting


Troubleshooting issues caused by system resources exceeded on Linux
https://www.nomachine.com/AR04O00927

Troubleshooting LDAP and PAM issues on Linux for connections by NX protocol
https://www.nomachine.com/AR08M00857

Troubleshooting NoMachine in a Active Directory Domain
https://www.nomachine.com/AR04O00925

Troubleshooting problems when enabling VirtualGL support for NoMachine virtual desktops
https://www.nomachine.com/AR04Q01024

How to solve 'session negotiation failed, application terminated prematurely'
https://www.nomachine.com/AR08N00898

Troubleshooting microphone issues in KDE 4
https://www.nomachine.com/AR11P01006

Troubleshooting audio problems in NoMachine sessions on CentOS/RHEL
https://www.nomachine.com/AR10Q01048

Troubleshooting automatic updates
https://www.nomachine.com/AR03Q01021