Are you sure that the nxserver was restarted?
After executing the restart command sudo /etc/NX/nxserver --restart
if you connect to the host it should show the message: “Cannot detect any display running. Do you want NoMachine to create a new display and proceed to connect to the desktop?”. When you click on “Yes” it should create a new display.
Have you made all the steps and then it shows the black screen? If yes, it could be because of a wrong DefaultDesktopCommand value. What is your output of the command grep DefaultDesktopCommand /usr/NX/etc/node.cfg
? If you installed KDE Plasma you should have: DefaultDesktopCommand “/usr/bin/startkde”. You can change it by editing the key value in the /usr/NX/etc/node.cfg file.
You can find here more info about connecting to headless systems: https://www.nomachine.com/AR06N00891.