Skip to content

Instantly share code, notes, and snippets.

@gpatsiaouras
Created June 7, 2021 07:58
Show Gist options
  • Save gpatsiaouras/7e219bd0ed1eaedef3e9135cfabccc22 to your computer and use it in GitHub Desktop.
Save gpatsiaouras/7e219bd0ed1eaedef3e9135cfabccc22 to your computer and use it in GitHub Desktop.
VNC Server systemd service
[Unit]
Description=Start TightVNC server at startup
After=syslog.target network.target
[Service]
Type=forking
User=<my-user>
Group=<my-user>
WorkingDirectory=/home/<my-user>
PIDFile=/home/mbi/.vnc/%H:%i.pid
ExecStartPre=-/usr/bin/vncserver -kill :%i > /dev/null 2>&1
ExecStart=/usr/bin/vncserver -depth 24 -geometry 1920x1080 :%i
ExecStop=/usr/bin/vncserver -kill :%i
[Install]
WantedBy=multi-user.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment