Hello,
I couldn't find anywhere how to create a vnc server (using TightVNC) service for systemd, which replaces old System V init starting with Debian / Raspbian 8 (Jessie). So here's how I managed to do that.
1. Install Tight VNC server:
Code: Select all
sudo apt-get install tightvncserver
Code: Select all
vncserver :1
3. Create a new file /etc/systemd/system/vncserver@.service with the following contents:
Code: Select all
[Unit]
Description=Remote desktop service (VNC)
After=syslog.target network.target
[Service]
Type=forking
User=pi
PAMName=login
PIDFile=/home/pi/.vnc/%H:%i.pid
ExecStartPre=-/usr/bin/vncserver -kill :%i > /dev/null 2>&1
ExecStart=/usr/bin/vncserver -depth 24 -geometry 1280x800 :%i
ExecStop=/usr/bin/vncserver -kill :%i
[Install]
WantedBy=multi-user.target
5. Run
Code: Select all
sudo systemctl daemon-reload && sudo systemctl enable vncserver@1.service
I also changed
Code: Select all
xsetroot -solid grey
Code: Select all
xsetroot -solid grey -cursor_name left_ptr
That's all. Have fun.
