NoMachine is designed to work out-of-the-box on headless machines provided a desktop environment is installed.
On Linux, NoMachine is able to detect when the X server is not running and run its own virtual display, which is an embedded X server. This ability, enabled by default in the free version, can be activated also in the commercial versions (see https://www.nomachine.com/FR10L02842).
Nevertheless, in some cases users can experience problems when connecting to the remote host, like black screen or slowness, bad render of objects or even stuck on a fixed resolution. These behaviours can be triggered by multiple factors, such as the GPU model, the software driver, the Operating System and the program which uses the GPU for rendering.
A common solution, valid for all the supported Operating Systems, is to adopt a fake display dongle (also called 'dummy dongle') inserted in the video card port to simulate the presence of a screen and force the system to take full advantage of the GPU as if a real monitor is connected. In case of a Linux host it's necessary to reboot the machine or restart the display manager to make this operative.
Other possible solutions for Linux machines are:
1) Setup Xorg for working in headless mode
1.1) For NVIDIA GPUs and proprietary driver only, another possibility is to configure X.org to run headless (use --allow-empty-initial-configuration)
1.2) Install a Xorg dummy driver
1.3) Create fake EDID (Extended Display Identification Data) and use it in Xorg.conf (EDID are stored in the monitor and read out by the GPU when monitor is connected)
2) Use a X virtual framebuffer
A specific case which leads to black screen on Linux is when the X server is running but it is not rendering because the video card is turned off. In this case NoMachine doesn't use its own virtual display because it detects that the X server running.
Besides the solutions above, another possibility is to stop the X server manually, in order to make NoMachine using its own display service.
Use the proper command to stop the X server accoding to your display manager, for example:
sudo systemctl stop lightdm
sudo systemctl stop gdm
sudo systemctl stop sddm
or, if you don't know which is, use the "display-manager" alias:
sudo systemctl stop display-manager
and restart the NoMachine server:
sudo /etc/NX/nxserver –restart
At this point NoMachine will create its own virtual framebuffer and you should be able to connect and see the desktop.
If the Linux system doesn't have systemd (e.g. RHEL 6 and earlier versions), reboot the machine at runlevel 3:
sudo init 3