This article refers to a problem that originally arose on Raspberry but the steps described can be applied to other platforms running a Linux distribution.
It frequently happens that linux-headers are not installed on the OS deployed on Raspberry PI Compute Module. Linux-headers are necessary to compile NoMachine USB drivers. If such headers are missing, the USB kernel driver (nxusb.ko) cannot be compiled during the installation of the NoMachine software. As a consequence, when you connect from your Raspberry, or when you connect to a Raspberry, you will not be able to connect USB devices in the NoMachine session.
The following instructions will explain which are the necessary steps to manually compile the NoMachine USB kernel driver.
1) Check if your Raspberry PI has linux-headers installed by running in a console:
dpkg -l | grep linux-headers-$(uname -r)
– for Linux OS based on Debian distribution.
rpm -qa | grep kernel-devel-$(uname -r)
– for Linux OS based on RPM distribution.
2) If the above command doesn’t return any result, install the linux headers if they are available for your kernel version.
Otherwise, if linux-headers are installed, compare their version with the kernel version and ensure that versions matches.
You can retrieve the kernel version by running this command:
If version of kernel and linux-headers is different, you will need to upgrade or downgrade either the kernel or the Linux kernel headers to ensure that they both are the same version.
3) Once you have ensured to have the proper version of linux-headers, check if this directory exists:
If it doesn't exists, create the following symbolic link:
sudo ln -fs /usr/src/linux-headers-$(uname -r) /lib/modules/$(uname -r)/build – for Linux OS based on Debian distribution.
sudo ln -fs /usr/src/kernel/$(uname -r)* /lib/modules/$(uname -r)/build – for Linux OS based on RPM distribution.
4) Install binutils and gcc, if you don't have them yet. They are necessary for compiling nxusb.ko.
5) Now, you need to compile nxusb.ko manually (the automatic compilation is done only during the installation of NoMachine). To do that, become the root user and compile:
cd /usr/NX/share/src/nxusb && make -f Makefile
(be sure to be root when launching the 'make' command, do not execute it with sudo!)
6) Once nxusb.ko has been succesfully compiled, you need to copy kernel object to drivers directory and restart NoMachine:
sudo cp -arp /usr/NX/share/src/nxusb/nxusb.ko /usr/NX/bin/drivers/
sudo /usr/NX/bin/nxserver --restart
If you have the Enterprise Client, just copy kernel objects.
You should now be able to forward USB devices inside the NoMachine session.
Connect by NoMachine to your desktop. Open the NoMachine menu panel inside the session (ctrl+alt+0) and click on 'Devices' and then on 'Connect a USB device': your USB devices will be listed there, choose which device to forward.