February 11, 2023

How to connect two NoMachine endpoints via proxy server

Having following endpoints:
- Ubuntu PC (1), which has only local address, with nomachine server installed
- Ubuntu server (obviously, with public ip)
- Another PC (2), connected to another local network, with nomachine client installed

How can I connect to PC 1 from PC 2, having them in different local networks?

Configuring local PCs

  1. Ensure that the NoMachine server on PC 1 is running and accessible from the local network.
  2. On PC 2, open the NoMachine client and click on the "New connection" button.
  3. In the Host field, enter the public IP address of the Ubuntu server.
  4. In the Username field, enter the username for the NoMachine server on PC 1.
  5. Click "Connect".
  6. If the Ubuntu server is configured correctly, you should now be able to access the desktop of PC 1 from PC 2.
Note: Before attempting to connect, you need to ensure that the firewall on the Ubuntu server is configured to allow incoming connections on the port used by NoMachine (default is 4000). Additionally, you may also need to configure port forwarding on your router to forward incoming connections to the NoMachine server on PC 1.

Configuring Ubuntu server for the remote connection

1. Install NoMachine on the Ubuntu server:

wget https://download.nomachine.com/download/6.10/Linux/nomachine_6.10.12_1_amd64.deb
sudo dpkg -i nomachine_6.10.12_1_amd64.deb
See downloads.nomachine.com for latest package version.

2. Start the NoMachine service:

sudo service nomachine start

3. Ensure that the firewall on the Ubuntu server allows incoming connections on the port used by NoMachine (default is 4000):

sudo ufw allow 4000

Configure port forwarding on your router to forward incoming connections to the NoMachine server on PC 1. The specific steps for this will depend on the router model you're using, but you can typically do this by accessing your router's web-based configuration page, navigating to the port forwarding section, and creating a new rule that forwards incoming traffic on port 4000 to the local IP address of PC 1.

Once these steps have been completed, you should be able to connect to PC 1 from PC 2 using the NoMachine client.