2022-07-30

TigerVNC and Systemd

A quick systemd service definition file for tigervnc on Ubuntu 20.04

[Unit]
Description=tigervnc

[Service]
Type=forking
ExecStart=/usr/bin/vncserver -localhost no -depth 24 -geometry 1920x1080 -noreset
User=steve

[Install]
WantedBy=multi-user.target

Key components:

  1. Type=forking so systemd correctly identifies the real VNC process, not the perl script that runs and then exits
  2. -localhost no so connections from other computers are accepted. This is only needed if you are not using ssh tunneling.
  3. User=steve so tigervnc doesn't complain about HOME not defined in the environment and uses my settings for auth and X session. Note that this is a strictly single-user setup.