A common problem when remotely connecting to PCs on different networks is that various remote desktop software packages are blocked due to security risks.
A nice way to replicate the functionality of these packages when connecting to Linux-based systems is to connect to the remote computer using SSH (connecting to a VPN if necessary) and then connect using VNC. However, the standard way to use VNC is to create a virtual desktop to work on the PC instead of viewing the actual desktop of the currently logged-in user ("scraping" the display).
In order to mirror the actual desktop and deal with the login screen, the following instructions might be useful as a good basic starting point. As always, there are multiple ways to set up something like this, but I found the following to be quite simple to use overall . Note that I have also included all the necessary links to the useful sites that I found along the way.
Make sure that the following is done before starting:
- Installed on Windows: Putty, VNC Viewer (e.g. TightVNC)
- Installed on Ubuntu: lightdm, xdotool, TigerVNC Server (tutorial here for setting up the VNC server - don't forget to modify ~/.vnc/xstartup as described here)
- IP address of the remote Ubuntu PC
- Required network ports are open (e.g. 22 and 5900)
- SSH is configured on the Ubuntu PC (for Ubuntu 20.04, there is a tutorial here)
- Root user is set up on the Ubuntu PC (tutorial here)
- lightdm is being used instead of gdm3 for the login screen (tutorial here)
Connect to the VPN network using the desired client (e.g. Fortclient) on your Windows PC. Once sure that the Ubuntu PC is at the login screen (wait a minute or so), do the following:
- Open Putty on the Windows PC and SSH into the Ubuntu PC using the hostname and port (e.g. hostname: email@example.com, port: 22)
- Login using your standard user password and then execute (type then press Enter):