How to configure NoMachine for using IPv6 in web sessions
The NoMachine web server, nxhtd, and the web player are configured by default to listen for IPv4 only. It's possible to configure them to listen for IPv6 instead. Changes are required in the configuration file of nxhtd, web.cfg, and in the server.cfg file.
Instructions
1) Stop the NoMachine web server.
You can do this via UI -> Settings -> Server -> Ports by selecting the nxhtd service and click on 'Configure'. In the next panel, click on 'Stop'.
Otherwise you can do that via command line.
On Linux an macOS:
$ sudo /etc/NX/nxserver --stop nxhtd
On Windows:
> %ALLUSERSPROFILE%\NoMachine\nxserver\nxserver.exe --stop nxhtd
2) Configure nxhtd to listen only for IPv6. Since nxhtd is based on Apache, the same instructions apply.
The configuration file of nxhtd is web.cfg:
on Linux -> /usr/NX/etc/web.cfg
on macOS -> /Applications/NoMachine.app/Contents/Frameworks/etc/web.cfg
on Windows -> C:\Program files\etc\web.cfg (for 64bit packages on 64bit systems)
Edit web.cfg and change these keys from:
Listen 0.0.0.0:4443 https
<VirtualHost 0.0.0.0:4443>
to:
Listen [::]:4443 https
<VirtualHost [::]:4443>
If you want to use both IPv6 and IPv4, set:
Listen *:4443 https
<VirtualHost *:4443>
Ref. https://httpd.apache.org/docs/2.4/bind.html
3) This is not requested if both IPv4 and IPv6 are allowed.
Configure the web player to use only IPv6 by editing the server configuration file:
on Linux -> /usr/NX/etc/server.cfg
on macOS -> /Applications/NoMachine.app/Contents/Frameworks/etc/server.cfg
on Windows -> C:\Program files\etc\server.cfg (for 64bit packages on 64bit systems)
Edit server.cfg and change this section from:
Section "Server"
Name "Connection to localhost"
Host 127.0.0.1
Protocol NX
Port 4000
Authentication password
EndSection
to:
Section "Server"
Name "Connection to localhost"
Host "::1"
Protocol NX
Port 4000
Authentication password
EndSection
3) This is not requested if both IPv4 and IPv6 are allowed.
Edit the list of known hosts for IPv6 only (for connections by NX protocol, default)
on Linux -> /var/NX/nxhtd/.nx/config/hosts.crt
on macOS -> /Library/Application\ Support/NoMachine/var/nxhtd/.nx/config/hosts.crt
on Windows -> %PROGRAMDATA%/NoMachine/nxhtd/.nx/config/hosts.crt
Edit hosts.crt and change from:
Host:127.0.0.1
to
Host:::1
4) Start nxhtd. From the UI or from command line.
On Linux an macOS:
$ sudo /etc/NX/nxserver --start nxhtd
On Windows:
> %ALLUSERSPROFILE%\NoMachine\nxserver\nxserver.exe --start nxhtd
Notes
1) Instructions above must be applied to each NoMachine server machine where the webplayer and nxhtd are running. 2) See https://kb.nomachine.com/AR06P00984 for using the SSH protocol.
3) The nxd daemon accepting connections by NX protocol listens for both IPv4 and IPv6
