Enable VNC (TightVNC) on Xubuntu 16.04

From EnigmaGuy Wiki
Revision as of 12:05, 6 May 2016 by Enigmaguy (talk | contribs) (Created page with "== Install TightVNC Server== <syntaxhighlight lang="bash"> apt-get install tightvncserver </syntaxhighlight> == Configure xstartup == Edit file ~/.vnc/xstartup <syntaxhighlig...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Install TightVNC Server

apt-get install tightvncserver

Configure xstartup

Edit file ~/.vnc/xstartup

#!/bin/sh
xrdb $HOME/.Xresources
xsetroot -solid grey
startxfce4 &

Try running it

tightvncserver :10 -geometry 1152x864

Note: You should run it on screen 10 instead of 1 because screen 1 is used by XServer

Connect: xtightvncviewer server_hostname:5910

Kill it: tightvncserver -kill :10

Install TightVNC Server as Systemd service

Create /lib/systemd/system/tightvnc.service

[Unit]
Description=TightVNC Service

[Service]
Type=forking
ExecStart=/usr/bin/sudo -u your_username /usr/bin/tightvncserver :10 -geometry 1152x864
ExecStop=/usr/bin/sudo -u your_username /usr/bin/tightvncserver -kill :10

Start service: systemctl start tightvnc.service

Enable service: systemctl enable tightvnc.service