checkout vnc section of: http://dwaves.de/2018/05/07/getting-started-with-raspberry-pi-2-model-b-v1-1-vs-odroid-xu4-vnc-display-0-and-1/

Create a file called

~/.config/autostart/xvnc.desktop

.

Place within it this text:


[Desktop Entry]
Name=XVNC Server
Exec=/usr/local/bin/xvnc.sh
Icon=
Type=Application

Now

su

to root and do the following.

Create a file called

/usr/local/bin/xvnc.sh

and place within it the following text:


#!/bin/bash
xhost +
x11vnc -display :0 -forever -passwd "<span style="color: #ff0000;">foobar</span>" &amp;

And run

chmod +x /usr/local/bin/xvnc/sh

.

Exit from root.


This will allow connections as long as the server is running, and access to be granted by the password „foobar“ as LXDE is started.

 

admin