Knowledge Base
Searching in : Article
ID: AR12J00658
Applies to: NoMachine Server
Added on: 2012-12-19
Last Update: 2026-05-22

What to do if USB support is disabled on Linux with NoMachine installed

If you have USB support disabled among the NoMachine services, it is likely that the USB module, nxusb.ko, has not been compiled on your Linux during the installation of NoMachine. Commands in this article are intended to be run from command line in a terminal opened on the machine where the session is run.

There are two ways to check whether it has been compiled or not

First way - You can verify it by typing the following in a command prompt:
ls -l /usr/NX/bin/drivers/

If the output is empty, it means that nxusb.ko is not compiled and installed. Otherwise, you should find it here: /usr/NX/bin/drivers/nxusb.ko

Second way - Alternatively, you can verify it by checking the install log file placed in the /usr/NX/var/log directory.

To separate usb install information use the following command:
cat /usr/NX/var/log/install.log | grep -i usb

If the module is not compiled,  the install log will report a similar message to this:
NX> 700 Compiling usb module.
NX> 700 Cannot compile USB module.
NX> 700 Support for USB forwarding over the network will not
NX> 700 be available.
NX> 700 To compile USB module be sure that Linux kernel headers
NX> 700 are available. You can then update this installation.
 

If USB device forwarding is not working or if the nxusb driver failed to compile or to install at the designated location, follow the procedure below.

Prerequisite is that the 'gcc' and 'make' programs are available on your system.

1) Check the gcc version
First, ensure that your GCC version matches the version used to build your kernel. Run the following commands:
cat /proc/version
gcc --version

If the versions are identical, everything is in perfect order. Otherwise upgrade or downgrade the gcc version.

2) Check if kernel headers are installed
Run command:
ls -l /lib/modules/$(uname -r)/build

If output is empty, kernel headers are not installed.

2.1) If the kernel headers are already installed
A mismatch in the kernel headers version could trigger the issue.

To reset your system headers and install missing dependencies, run the following commands.

On SUSE and other distributions using Zypper program:
sudo zypper refresh
sudo zypper install -t pattern devel_basis
sudo zypper install --force kernel-default-devel

On Red Hat and other RPM-based distributions using dnf:
sudo dnf check-update
sudo dnf groupinstall "Development Tools"
sudo dnf reinstall kernel-devel-$(uname -r)

On Ubuntu and other DEB-based distributions using apt-get:
sudo apt update
sudo apt install --reinstall linux-headers-$(uname -r)

2.2) Install the kernel headers if they are not installed

Retrieve the kernel version of your machine:
uname -r

Let's say that this command returns on Ubuntu 6.8.0-111-generic, download and install the kernel headers for such kernel version.

On SUSE and other distributions using Zypper program:
sudo zypper install kernel-default-devel

On Red Hat and other RPM-based distributions using dnf:
sudo dnf install kernel-devel-$(uname -r)

On Ubuntu and other DEB-based distributions using apt-get:
sudo apt-get install linux-headers-$(uname -r)


Then, ensure that you have all the necessary tools to compile: gcc and make. You can verify if they are present by running from command line.

On SUSE/Red Hat and other distributions using RPM, run:
rpm -qa | grep gcc

and:
rpm -qa | grep make
 

On Ubuntu and other distributions usinf DPKG, run:
sudo dpkg --get-selections | grep gcc

and
sudo dpkg --get-selections | grep make

If gcc and/or make are not present, you have to install them.

On SUSE and other distributions using Zypper:
sudo zypper install make gcc

On Red Hat and other RPM-based distributions:
sudo dnf install make gcc

On Ubuntu and other distributions using apt-get:
sudo apt-get install make gcc

 

When the environment is ready and you have acquired all the necessary packages, please do the following (assuming that NoMachine is installed in /usr/NX):

1. Navigate to /usr/NX/share/src/nxusb
cd /usr/NX/share/src/nxusb

2. Clean the build, run as non-privileged user:
make clean

3. Build the module as non-privileged user:
make

If the build fails due to permission problems, please run the following command:
sudo rm -rf /usr/NX/share/src/nxusb/include/linux

And then retry:
make


If there are still problems with permissions, run the compilation as root.
Do not use 'sudo make' because sudo drops the PWD environment variable and causes compilation problems! Use 'su' and then run 'make' command instead.

If it still doesn't work, try with a privileged user:
sudo make clean
sudo make -C /lib/modules/$(uname -r)/build M=$(pwd) modules

3.  Insert the module into the Linux Kernel
If the build completes successfully without errors, try to manually insert the kernel module:
sudo insmod nxusb.ko

4. When the module has been built and successfully loaded (with insmod command), copy it to the drivers directory:
sudo cp nxusb.ko /usr/NX/bin/drivers/

5. Clean the build directory
make clean

6. The module should be now in the /usr/NX/bin/drivers/ directory:
ls -l /usr/NX/bin/drivers/nxusb.ko


(*) Check if the module loads on the machine where it's compiled.

To do this start a NoMachine connection, open the NoMachine menu inside the session (ctrl+alt+0 or click on the page peel on the top right corner of the window) and open Devices -> Connect a USB device. Wait for 10 seconds, if there are available devices, they will appear. Then, open a terminal on the host where you compiled nxusb.ko and type:

lsmod | grep nxusb

If the output is not empty, for example:
$ lsmod | grep nxusb
nxusb                  36864  5

it means that the nxusb kernel has been compiled and loaded correctly on your machine.

Note that until the Devices -> Connect a USB device UI is opened, the nxusb module is not loaded, even if present.