Written on December 11, 2020Achieved by November 30, 2020ArgetWARNING: If you use XWayland, STOP READING. You are out of luck. This tutorial is for XORG only.Linux offers multiple ways to connect and manage your desktop or machine. In previous tutorials, I mentioned how SSH could improve productivity by enabling a user to perform multiple tasks on different machines without having to walk over to that machine to do it, and how samba shares between users on the same network allow for collaboration without fancy software. Today, we focus on Virtual Network Consoles (VNCs), which allow you to run an "x session" remotely, complete with a GUI. First, we will download the X11VNC server from Synaptic. Open your mint menu, type "Package M" and click the result, which should resemble a teal icon with white arrows pointing in different directions. I keep Synaptic pinned to my menu. If you wish to do this, drag it from the results list with your mouse and place it in the left-most space of the menu until you see the icons move, then let your mouse click go. Enter your privileged password, then click "Authenticate". When Synaptic opens, click the "Search" icon on the top right portion of the window and type "x11vnc" in the query. Two results are shown in the example below. Click the white square next to "x11vnc" and select the option "Mark for Installation". It will offer to download the dependencies for you. Review the dependencies and click "Mark". Now click "Apply" on the top left of the window. You will be given a summary of the changes that will be made, as well as how much additional space will be taken up. If you're satisfied, click "Apply". The download window will appear, followed by the installation window. Click the "Details" chevron if you'd like to see how it's going. Now that you've installed X11VNC, you'll need to set credentials for it, much like you did with samba shares. Open a terminal, and type the following: x11vnc -storepasswdYou will then be asked to set a password. If you're wondering why I chose X11VNC, it's because I can use more complex passwords with it. The limit appears to be 20, as if I try 30 or longer, I get a double-return bug that implies the passwords I entered did not match. TightVNC truncates to 8. Type your desired password combination now. You can copy and paste the result from your password manager, and repeat the process when it asks you to verify. If you are asked to save the password to the default location, say yes. As the configuration currently stands, you will need to be logged into your PC in order to connect via VNC. This is simply unacceptable from a security standpoint, and I will insert some unorthodox advice that you may want to follow if you don't want to enable automatic login. Open a terminal and type the following command: sudo ln -sf ~/.vnc /usr/lib/vncThis will create a symlink to the VNC password so that when we create a service file for X11VNC to start automatically, it will let you log in through lightdm without a user x session. Now, we need to create that startup file. Open a terminal, and type the following, one at a time, entering your privileged password when prompted: cd /lib/systemd/systemsudo nano x11vnc.serviceYou will now be presented with what appears to be a simple word processor. Type the following into it. Use the arrow keys to navigate to the cursor position you seek. Nano doesn't word wrap, so if you notice a cutoff, adjust the window borders or reduce the text size by typing CTRL + [-] and it should all be visible. Here's what I typed (redactions made to preserve my security-minded choices):
[Unit]
Description="x11vnc"
Requires=display-manager.service
After=display-manager.service