[HOWTO] Remote plotting and farming over the internet, Ubuntu edition

If you want to manage your plotter, farmer, or harvester over the internet from anywhere in the world, this how-to is here for you.

You can also use this how-to to manage them locally as this is a preferable way to manage many devices. It’s faster because you can manage any number of your devices from a single main device. And it also works without any monitor/dummy attached.

In any of your plotter, farmer, or harvester, that you want to manage remotely, please follow these steps:

  1. Install RDP server (I recommend RDP over VNC even though it’s not supported on Wayland yet since VNC can’t work with login/lock screen, thus very unsecured, and VNC can’t work without monitor/dummy attached also):
sudo apt install xrdp
sudo adduser xrdp ssl-cert
  1. Setup your RDP(remote) session to have the same GUI as when you use your PC locally. Otherwise, your RDP session would revert back to vanilla GNOME which is the worst DE of all (IMHO). Open the terminal and enter this code line by line:
cat <<EOF > ~/.xsessionrc
export GNOME_SHELL_SESSION_MODE=ubuntu
export XDG_CURRENT_DESKTOP=ubuntu:GNOME
export XDG_CONFIG_DIRS=/etc/xdg/xdg-ubuntu:/etc/xdg
EOF
  1. Install ZeroTier (you can skip the whole ZeroTier section and go to step 8 if you only want to manage your plotting and farming locally):
curl -s https://install.zerotier.com | sudo bash
  1. Open the terminal then enter this code to check whether ZeroTier is running correctly:
sudo zerotier-cli info

If everything works fine, it should show you the node ID and the online status. If you want to use the GUI for ZeroTier on Linux, check this repository.

  1. Create your ZeroTier’s network ID at ZeroTier Central. Then, set your network as a private network and note down your network ID and LAN IP.

  2. Join your network by opening the terminal and enter this code:

sudo zerotier-cli join your_network_id

You will also have to allow the connection in the web central.

  1. Allow RDP port from your ZeroTier’s LAN IP (step 5) in your firewall rules(you better enable the firewall if you want to operate your device over the internet):
sudo ufw allow from your_zerotier_lan_ip to any port 3389

You can also use the GUI to manage your firewall, please install GUFW by searching for firewall in Ubuntu Software Center or entering this code in the terminal:

sudo apt install gufw

However, it seems there’s a bug that the GUI won’t open in the RDP session as reported here.

  1. If you also want to manage your plotter, farmer, and harvester in your local network through RDP, add this rule to your firewall:
sudo ufw allow from your_local_lan_ip to any port 3389

You can find your local LAN IP in your router settings. For me, it’s 192.168.0.0/24 where /24 means the last 0 (XXX.XXX.X.0) can be any number / any device in my local network.

You can RDP connect to any number of your devices locally based on their local IP address.

  1. Log out or reboot the system to finish your RDP setup.

  2. Install ZeroTier client on your remote device and join the network (skip this if you don’t use over the internet connection).

  3. Install the RDP client on your remote device. In Windows, it’s installed by default (Remote Desktop Connection). On Linux, you can use Remmina. On Android, use this RDP client from MS.

  4. Remotely connect to your device in the RDP client by using the node’s ZeroTier IP address (you can find all the specific node/device IPs in the web central) for an over the internet connection. Or use your device’s local IP address for a local network connection.

Please note that:

  1. You can’t remotely connect multiply devices to the same host/server simotiously. The last connected remote device will be kicked out of the RDP session and a new remote device will get to control the host.

  2. The local session and remote session can’t be logged in at the same time. Otherwise, whoever logged in the last will only get a black screen and a full system reboot will be required. There’s a hack around for this but I do not recommend it as the desktop will be extremely buggy to the point that it’s unusable.

  3. I consider this method to be the best way of remote controlling my device since it doesn’t require me to log in to my Google account on several devices like I would have to with Chrome Remote Desktop.

I hope this helps :sweat_smile:

2 Likes

I stopped reading at RDP. You want to remote manage a Linux machine? Ssh, and screen is about all you need.

2 Likes

:sweat_smile:

I share this how-to for the people like me who do not prefer CLI. SSH doesn’t replace a full functional GUI for me.

2 Likes