Debian LXQT desktop environment (DE) doesn’t come with a pre-installed VNC server. I usually want to log into an existing Xsession, and X11VNC is the easiest VNC server I’ve found to do that. Others like TigerVNC or TightVNC were harder to configure to connect to existing X sessions.
So I did sudo apt install x11vnc net-tools and then made a VNC password using x11vnc -storepasswd. This created an encrypted VNC password file in /home/user/.vnc/passwd
pi@debian:/etc$ x11vnc -storepasswd #by leaving out a filepath, it defaults to the .vnc folder
Enter VNC password: #type password in here
Verify password: #re-type password
Write password to /home/pi/.vnc/passwd? [y]/n y
Password written to: /home/pi/.vnc/passwd
Then created a service file in /etc/systemd/system named x11vnc.service and filled it with the following:
[Unit]
Description=Start x11vnc
After=multi-user.target
[Service]
Type=simple
User=pi
export DISPLAY=:0
ExecStartPre=/bin/sleep 3
ExecStart=/usr/bin/x11vnc -display :0 -auth /home/pi/.Xauthority -forever -loop -noxdamage -repeat -rfbauth /etc/x11vnc.passwd -rfbport 5900 -shared
[Install]
WantedBy=multi-user.target
reload the systemd service files with sudo systemctl daemon-reload then sudo systemctl start x11vnc and sudo systemctl enable x11vnc.