Migrate from x11vnc to tigervnc

I’ve decided to migrate from x11vnc to tigervnc since tigervnc may be more optimized. The script that was used previously can be slightly adapted. start-tigervnc.sh #!/bin/bash VNC_PASS=/home/jerry/.vnc/passwd LOG_FILE=/var/log/tigervnc.log USER_XAUTH="/home/jerry/.Xauthority" LIGHTDM_XAUTH="/var/lib/lightdm/.Xauthority" LIGHTDM_STATE="/var/run/lightdm/root" # Function to find the active display and its Xauthority file find_active_display() { if [ -f /var/run/lightdm/root/:1 ]; then echo ":1 $LIGHTDM_XAUTH" # Check for greeter (:0, no user logged in) elif [ -f /var/run/lightdm/root/:0 ]; then echo ":0 $USER_XAUTH" fi } stop_vnc() { pkill -9 -f "x0vncserver" 2>/dev/null while pgrep -f "x0vncserver" >/dev/null; do sleep 1 done pkill -9 -f "X0tigervnc" 2>/dev/null while pgrep -f "X0tigervnc" >/dev/null; do sleep 1 done } start_vnc() { local display=$1 local xauth_file=$2 # Get current display and Xauthority XAUTHORITY="$xauth_file" x0vncserver -display "$display" -rfbauth $VNC_PASS -rfbport 5900 -localhost no >> $LOG_FILE 2>&1 & } read display xauth_file < <(find_active_display) start_vnc "$display" "$xauth_file" inotifywait -m "$LIGHTDM_STATE" -e create -e delete -e modify | while read -r directory events filename; do echo "Detected change in $directory: $filename ($events)" >&2 stop_vnc sleep 0.5 read display xauth_file < <(find_active_display) if [ -n "$display" ] && [ -n "$xauth_file" ]; then start_vnc "$display" "$xauth_file" fi done systemd unit: ...

August 29, 2025

x11vnc setup

On Zorin OS, GNOME is the default desktop interface and GDM is the default greeter (login screen). It seems that GDM will always attach to :0 which is display 0, thus when I had my x11vnc service running, it will always work. But in my new installation, Debian 13 with LightDM, each screen (desktop and login) is attached to different display. If a user is logged in and then he performs a “Lock Screen”, there will be two instances, which causes the current connection to black screen as it’s attached to the desktop screen. ...

August 22, 2025

Understanding systemd

Today, I’ve learnt more about systemd on Linux. I saw that it can be separated into user based or system based and there are three locations to save these services into: /etc/systemd/system - ROOT /usr/lib/systemd/system - ROOT but for package manager /usr/lib/systemd/user - User In order to work with root services, one must use sudo systemctl and to work with user services, use systemctl --user. User services will run when a user is logged in, so for any GUI software, it’s best to use the user services. ...

August 22, 2025

Debian 13 Installation

Installing Debian 13 on Mini Server Last Friday night, I stayed up really late just to install Debian 13 as the main OS for my mini server. Choosing a new Installation Disk But before that process, I wanted to use the Lexar SSD that is kept in my cupboard which was used as the main OS in the second hand PC I bought previously. I did manage to get it up and that very old Windows booted. I wanted to format it. In the midst of that, I thought why not also reapply the thermal paste so to fix that damn temperature issue. ...

August 19, 2025

Home Assistant

In the past, I’ve saw this service. I looked at the documentations and I have no clue what I can do with it. Besides, at that time I was still living with my parents and the only thing I had was just a computer and there wasn’t any smart devices available for me to play with. Fast foward till today, living under my own home with a few smart devices, I can now self-host this and create various controls for the devices such as AC, Fan, Air Purifier and Smart Plugs. ...

August 20, 2023