This episode trains diagnosis of VNC/RDP connections: checking ports with ss -tulpn and firewall rules, monitoring vncserver -list and journalctl, and solutions for black screens, color corruption, slow refreshes, and input that doesn't work.

No matter how tidy your configuration is, at some point a connection will fail. Episode 20 trains you to become a detective: reading symptoms, checking the right layers, and solving problems with sequential steps — not by guessing.
You'll learn the main diagnostic tools (ss -tulpn, firewall, vncserver -list, journalctl), proper client-server tests, and then a solution map for the four most common problems: black screens, color corruption, slow refreshes, and input that doesn't work.
The first step is always confirming that the service is really listening on the expected port:
ss -tulpn | grep -E ":(5900|5901|3389)"The ss -tulpn | grep -E ":(5900|5901|3389)" command shows the processes listening on the VNC and RDP ports. If the port doesn't appear, the service is dead or failed to start — move on to the service check.
If the port appears but the connection still fails, suspect the firewall. Check the rule status on both sides:
sudo ufw status verbose
sudo firewall-cmd --list-allRemember from episode 16: test from another machine, not from the server itself. nc -zv is the fastest tool to separate network problems from application problems:
nc -zv 192.168.1.20 5901For TigerVNC, look at the list of running sessions:
vncserver -listvncserver -list shows the active displays. If the expected display isn't there, the session failed to be created — the common causes are xstartup or the password.
systemd services store all their logs in the journal. For an active service, read the logs live:
journalctl -u vncserver@:1 -fFor x11vnc and xrdp, change the unit name to match each service. journalctl -u vncserver@:1 -f displays new log lines as they appear — the best way to see the error that occurs exactly when a connection opens.
Manually run VNC sessions write logs to ~/.vnc/:
tail -20 ~/.vnc/host:1.logErrors like "unable to connect" or "Authentication failed" almost always appear here before you start guessing the cause.
When everything fails, run this sequence from the client machine:
ping -c 3 192.168.1.20
nc -zv 192.168.1.20 5901
vncviewer 192.168.1.20:5901ping fails → network or routing problem.ping succeeds, nc fails → port closed (firewall or dead service).nc succeeds, viewer fails → authentication or protocol problem.The nc -zv command is the most important marker: once the port accepts TCP connections, the problem is no longer on the network.
Info
Write down the result of every step. "Ping works, port is open, but authentication fails" already narrows the problem to the password or passwd file — far faster than changing configuration at random.
A black screen on connection almost always comes from two sources: a display problem or an authentication problem.
-display and -auth guess are correct, and the shared display is really active.~/.vnc/xstartup — the file must be executable and call an installed desktop.echo $DISPLAY
ls -la ~/.vnc/xstartupWrong or "broken"-looking colors are usually caused by a depth mismatch between server and viewer. Set the depth explicitly on both sides:
vncserver -kill :1
vncserver :1 -geometry 1920x1080 -depth 24
vncviewer 192.168.1.20:5901If colors are still wrong after setting the depth, try a different encoding in the viewer — sometimes certain encodings render colors imperfectly on older machines.
The screen works but the refresh feels choppy. Causes and fixes:
-ncache 10 in x11vnc.The cursor shows but clicks and keystrokes have no effect. Possible causes:
enable-view-only.setxkbmap (episode 11).x11vnc -display :0 -rfbauth /etc/x11vnc.pass -viewonlyIf the server was deliberately run with -viewonly, all connections can only view. Remove that option to allow control again.
Episode 20 trained systematic diagnosis: checking ports with ss -tulpn and the firewall, monitoring sessions with vncserver -list and journalctl, running proper client-server tests, and solving black screens, color corruption, slow refreshes, and input that doesn't work.
Key takeaways:
ss -tulpn, then test from the client with nc -zv.vncserver -list and journalctl reveal problems on the server side.nc succeeding means the problem moved from the network to the application.In the next episode, episode 21, we look to the future: modern tools and roadmap — TigerVNC 1.16 with w0vncserver, x11vnc 0.9.17, TightVNC 2.8.88, and GNOME Remote Desktop 50.x, complete with a migration map from older tools. See you there!