Enable VNC (TightVNC) on Xubuntu 16.04

From EnigmaGuy Wiki
Jump to navigation Jump to search

Update (2019/Feb/02)

If you want to install TightVNC on Ubuntu 18.04 I recommend to use my tutorial for Lxde and Ubuntu 18.04 on Github.com/.../myvnc

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