Skip to content

Instantly share code, notes, and snippets.

@cnmoro
Created January 27, 2026 23:44
Show Gist options
  • Select an option

  • Save cnmoro/3a44acc5441f771ffdff03eff79507c1 to your computer and use it in GitHub Desktop.

Select an option

Save cnmoro/3a44acc5441f771ffdff03eff79507c1 to your computer and use it in GitHub Desktop.
tigervnc 1.16.0 linux setup

Download .deb from sourceforge

$ https://sourceforge.net/projects/tigervnc/files/stable/1.16.0/ubuntu-24.04LTS/amd64/tigervncserver_1.16.0-1ubuntu1_amd64.deb

$ sudo apt-get install -y ./tigervncserver_1.16.0-1ubuntu1_amd64.deb

Set password

$ vncpasswd

Create xstartup file

$ nano ~/.vnc/xstartup

#!/bin/sh

unset SESSION_MANAGER
unset DBUS_SESSION_BUS_ADDRESS

exec startxfce4

Create unit file

$ nano ~/.config/systemd/user/vncserver@:1.service

[Unit]
Description=TigerVNC Server on display :1
After=network.target

[Service]
Type=simple
# Ensure the environment is inherited correctly
Environment=DISPLAY=:1
Environment=XAUTHORITY=%h/.Xauthority

# We run Xvnc
ExecStart=/usr/bin/Xvnc :1 \
  -localhost no \
  -geometry 1366x768 \
  -depth 24 \
  -FrameRate 60 \
  -rfbport 5901 \
  -PasswordFile %h/.vnc/passwd

# Use 'background' execution so systemd doesn't wait for the desktop to close
ExecStartPost=/bin/sh -c '%h/.vnc/xstartup &'

# This ensures that if Xvnc dies, the xstartup processes are cleaned up
KillMode=control-group

Restart=on-failure
RestartSec=2

[Install]
WantedBy=default.target

$ systemctl --user restart vncserver@:1.service

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment