# Vncserver service file for Debian or Ubuntu with systemd # # 1. Copy this file to /etc/systemd/system/vncserver@:1.service # 2. Edit User= # e.g "User=paul" # 3. Edit the vncserver parameters appropriately in the ExecStart= line! # e.g. the -localhost option only allows connections from localhost (or via ssh tunnels) # 4. Run `systemctl daemon-reload` # 5. Run `systemctl enable vncserver@:.service` # [Unit] Description=Remote desktop service (VNC) After=syslog.target network.target [Service] Type=forking User=pi # Clean any existing files in /tmp/.X11-unix environment ExecStartPre=/bin/sh -c '/usr/bin/tigervncserver -kill %i > /dev/null 2>&1 || :' ExecStart=/usr/bin/tigervncserver -SecurityTypes VncAuth,TLSVnc %i ExecStop=/usr/bin/tigervncserver -kill %i [Install] WantedBy=multi-user.target