Skip to content

Instantly share code, notes, and snippets.

@jeremyvisser
Last active March 13, 2021 12:57
Show Gist options
  • Save jeremyvisser/22d1ac92fa9388a4462cc49e662c5a8f to your computer and use it in GitHub Desktop.
Save jeremyvisser/22d1ac92fa9388a4462cc49e662c5a8f to your computer and use it in GitHub Desktop.
Simple systemd socket-activated VNC server
[Unit]
Description=VNC server
[Service]
Type=simple
User=%i
PAMName=login
Environment=DISPLAY=:9
ExecStart=/usr/bin/xinit -- /usr/bin/Xvnc :9 -depth 24 -inetd -once -rfbauth /home/%i/.vnc/passwd -geometry 1920x1080
StandardInput=socket
StandardOutput=journal
StandardError=journal
[Install]
[Unit]
Description=VNC socket
[Socket]
ListenStream=[::]:5900
Accept=false
[Install]
WantedBy=multi-user.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment