Connect to current session on Raspberry pi using xrdp and vnc

Connect to current session on Raspberry pi using xrdp and vnc


I assume that Raspberry Pi is login into desktop and user Pi is the owner of it.

1. install xrdp and x11vnc
apt-get install xrdp x11vnc
 
2.Change default setting for xrdp so will always connect to current session 
edit /etc/xrdp/xrdp.ini


[xrdp1]
name=Active local login
lib=libvnc.so
username=
password=ask
ip=127.0.0.1
port=5900

3. run first time x11vnc as user Pi to setup password
 
4. depends on Raspberry version 
 
- add this line at the end of /etc/rc.local but before exit 0
 
 
...


su - pi -c '/usr/bin/x11vnc -auth /home/pi/.Xauthority -display :0 -usepw -listen 127.0.0.1 -noxdamage -ncache 10 -ncache_cr -viewonly -forever -bg'


exit 0

- or if this does not work add at the end of line of /etc/xdg/lxsession/LXDE-pi/autostart

@/usr/bin/x11vnc -auth /home/pi/.Xauthority -display :0 -usepw -listen 127.0.0.1 -noxdamage -ncache 10 -ncache_cr -viewonly -forever -bg
 
reboot raspberry.
 
Login using windows remote desktop or other software into raspberry pi
on pop-up window provide password which you setup before.

It will connect to current session, and keep x11vnc running in the background so you can reconnect anytime
 

Comments

Popular posts from this blog

Securing the Pi-hole with fail2ban to prevent DNS Amplification attacks

How to clean DB from old logs in Magento 1.x

Python pxssh failed on login. could not set shell prompt