Knowledge Base
Searching in : Document
ID: DT07S00233
Version: NoMachine 8
Added on: 2022-09-13
Last Update: 2023-05-17
Print this article

Enabling and disabling the NoMachine device sharing services manually

Introduction

1. Device Sharing, Audio and Other Facilities

Services to forward devices like disks and printers, audio, transfer file and so on can be activated and deactivated through the Server UI. Right mouse click on the !M icon in the system tray, then click on 'Show Server status' and enter the 'Devices' panel.

Alternatively, administrators can configure them manually by editing the node configuration file on the NoMachine host where sessions will be be run.

The node configuration file is:
/usr/NX/etc/node.cfg on Linux
/Applications/NoMachine.app/Contents/Frameworks/etc/node.cfg on Mac
%PROGRAMFILES%\NoMachine\etc\node.cfg on Windows.

To change settings, in node.cfg identify the appropriate configuration key, remove the pre-pending # from the key name if present, and specify the new value. The name of the key for the specific service and the value to be set are reported in the correspondent configuration section of this guide.

There is no need to restart the server, changes will be effective at next session startup with the only exception of disabling or enabling the recording of the local desktop.

In case of multi-host environments, like Cloud Server and Enterprise Terminal Server setup, edit the node.cfg file on each hosts where you want to disable a device sharing. As an alternative to edit manually the cfg file, NoMachine Terminal Server and Enterprise Terminal Server permit to configure device sharing and other services like copy and paste operations via profile rules. The Cloud Server allows to create profiles and propagate them to its child server. Please refer to the Installation and configuration guide available for each product in the 'Installation' section at: https://www.nomachine.com/all-documents

TIP
In multi-node environments (i.e. Enterprise Terminal Server + Terminal Server Nodes and Cloud Server + NoMachine nodes), if changes are made on remote nodes, run the following command on the Enterprise Terminal Server to make changes made on the nodes effective:
sudo /etc/NX/nxserver --nodeedit NODE:PORT

In case of a Cloud Server it's preferable to identify the node by its uuid:
sudo /etc/NX/nxserver --nodeedit NODE_UUID

To list all the nodes and retrieve their UUID in case of Cloud Server nodes, use:
sudo /etc/NX/nxserver --nodelist

How to disable device sharing, audio and others

2. Disks

To disable exporting a disk from locale to remote and importing a remote disk to the local computer:
EnableDiskSharing none

To disable exporting a disk from locale to remote:
EnableDiskSharing server

To disable importing a remote disk to the local computer:
EnableDiskSharing client

3. Printers

To disable exporting a printer from locale to remote and importing a remote printer to the local computer:
EnablePrinterSharing none

To disable exporting a printer from locale to remote:
EnablePrinterSharing server

To disable importing a printer to the local computer:
EnablePrinterSharing client

4. USB Devices

To disable exporting a USB device from locale to remote and importing a remote USB device to the local computer:
EnableUSBSharing none

To disable exporting a USB device from locale to remote:
EnableUSBSharing server

To disable importing a remote USB device to the local computer:
EnableUSBSharing client

5. Network Ports

To disable connecting a network port from locale to remote and viceversa:
EnableNetworkSharing none

To disable connecting a network port from locale to remote:
EnableNetworkSharing server

To disable connecting a network port from remote to the local computer:
EnableNetworkSharing client

6. Smartcard Readers

To disable connecting a smartcard reader:
EnableSmartcardSharing 0

7. File Transfer

To disable transferring files from locale to remote and viceversa:
EnableFileTransfer none

To disable transferring files from locale to remote:
EnableFileTransfer server

To disable transferring files from remote to the local computer:
EnableFileTransfer client

8. Recording of the Local Desktop

To disable recording of the local desktop:
EnableLocalRecording 0

9. Session Recording

To disable recording of NoMachine session:
EnableSessionRecording 0

10. Automatic Session Recording

To disable the automatic session recording for all session types, execute on the server host the 'nxserver --recording no' command.

On Linux or macOS, open a terminal and execute:

$ sudo /etc/NX/nxserver --recording no  

On Windows, launch a CMD console as administrator and execute:

> %ALLUSERSPROFILE%\NoMachine\nxserver\nxserver.exe --recording no

11. Audio and Microphone

To disable both audio and microphone:
AudioInterface disabled

How to enable device sharing, audio and others

12. Disks

To enable exporting a disk from locale to remote and importing a disk to the local computer:
EnableDiskSharing both

To enable exporting a disk from locale:
EnableDiskSharing client

To enable importing a remote disk to the local computer:
EnableDiskSharing server

13. Printers

To enable exporting a printer from locale to remote and importing a remote printer to the local computer:
EnablePrinterSharing both

To enable exporting a printer from locale to remote:
EnablePrinterSharing client

To enable importing a remote printer to the local computer:
EnablePrinterSharing server

14. USB Devices

To enable exporting a USB device from locale to remote and importing a USB device to the local computer:
EnableUSBSharing both

To enable exporting a USB device from locale to remote:
EnableUSBSharing client

To enable importing a remote USB device to the local computer:
EnableUSBSharing server

15. Network Ports

To enable connecting a network port from locale to remote and viceversa:
EnableNetworkSharing both

To enable connecting a network port from locale to remote:
EnableNetworkSharing client

To enable connecting a network port from remote to the local computer:
EnableNetworkSharing server

16. Smartcard Readers

To enable connecting a smartcard reader:
EnableSmartcardSharing 1

17. File Transfer

To enable transferring files from locale to remote and viceversa:
EnableFileTransfer both

To enable transferring files from locale to remote:
EnableFileTransfer client

To enable transferring files from remote to the local computer:
EnableFileTransfer server

18. Recording of the Local Desktop

To enable recording of the local desktop:
EnableLocalRecording 1

19. Session Recording

To enable recording of the NoMachine session:
EnableSessionRecording 1

20. Automatic Session Recording and Permissions

To enable the automatic session recording for all session types, execute on the server host the 'nxserver --recording yes OPTIONS' command.

On Linux or macOS, open a terminal and execute:

$ sudo /etc/NX/nxserver --recording yes 

On Windows, launch a CMD console as administrator and execute:

> %ALLUSERSPROFILE%\NoMachine\nxserver\nxserver.exe yes

If no OPTIONS are specified, all types of sessions and for each user, are recorded from the begin to the end. The available OPTIONS to filter the automatic recording on per-session type, user, node basis and to fix a recording percentage are:
--type physical|virtual
--user USER_NAME
--group USER_GROUP_NAME
--guest
--node NODE:PORT (for multi-node environments only)
--nodegroup NODE_GROUP_NAME
--percentage %_OF_SESSION_TO_BE_RECORDED

The following key in server.cfg allows to define the type of authorization required:
AutomaticRecordingAuthorization 1: (default) the user can accept or refuse to allow NoMachine recording the session
AutomaticRecordingAuthorization 0: the user is informed that his/her session will be recorded and in which percentage
AutomaticRecordingAuthorization 2: the user can accept or refuse to allow NoMachine recording his/her session, but in this last case the session will be terminated.

By default, recorded files are saved in:
/usr/NX/var/recording/ on Linux
/Library/Application Support/NoMachine/var/recording
%PROGRAMDATA%/NoMachine/var/recording on Windows

21. Audio and Microphone

The configuration key to enable audio and microphone is:
AudioInterface

On Linux set:
AudioInterface pulseaudio
or: AudioInterface alsa

On Mac and Windows:
AudioInterface nxaudio

How to manage Copy&Paste

22. Enable/Disable Copy and Paste

Copy and paste operations can be limited or fully disabled in the server configuration file:
/usr/NX/etc/server.cfg on Linux
/Applications/NoMachine.app/Contents/Frameworks/etc/server.cfg on Mac
installationDirectory/NoMachine/etc/server.cfg on Windows.

To change settings, uncomment in server.cfg the configuration key and specify the new value.

To disable copying from locale and paste to remote and viceversa:
EnableClipboard none

To disable copying from locale and paste to remote:
EnableClipboard server

To disable copying from remote and paste to the local computer:
EnableClipboard client

To enable copying from locale and paste to remote and viceversa:
EnableClipboard both

To enable copying from locale and paste to remote:
EnableClipboard client

To enable copying files from remote and paste to the local computer:
EnableClipboard server

23. Limit the Amount of Data

By default, the clipboard buffer is unlimited, but it's possible to limit the amount of data that can be copied from the NoMachine session to the user's device and vice-versa. 

To limit the amount of data that can be copied from the session to the user's device, edit the node configuration file on the remote computer and set the appropriate value (in bytes) for this key:
ServerClipboardLimit

For example, to limit the amount of data that can be copied from remote to locale to 4MB, set:
ServerClipboardLimit 4194304

To limit the amount of data that can be copied from the user's device to the NoMachine session, set the ClientClipboardLimit key to the appropriate value.

Setting keys above to 0, means that no limits are applied (default).

Other

24. Profile Rules (Alternative for TS, ETS, ETSC and CSs)

NoMachine Terminal Server, Enterprise Terminal Server and Enterprise Terminal Server Cluster permit to configure device sharing and other services like copy and paste operations via profile rules.

Any of the Cloud Server products allows to create profiles and propagate them to its child servers.

Either choose to configure services via configuration files or via profiles.

This second method grants more flexibility, like the possibility to set rules on per-users basis or in case of multi-host environments, apply them to specific hosts only.

Please refer to the guide appropriated for your server type available in the 'Installation' section at: https://www.nomachine.com/all-documents