How to setup XRDP server on NanoPC-T4
Contents
1 Step1: Install XRDP remote desktop
Enter the following command to install:
sudo apt install -y tigervnc-standalone-server xrdp sudo sed -e 's/^new_cursors=true/new_cursors=false/g' -i / etc / xrdp / xrdp.ini
2 Step2: Edit /etc/xrdp/startwm.sh
Edit /etc/xrdp/startwm.sh:
sudo vim / etc / xrdp / startwm.sh
Comment out the last two lines in the file (comment method: add # sign at the beginning of the line), as shown below:
# test -x /etc/X11/Xsession && exec /etc/X11/Xsession # exec /bin/sh /etc/X11/Xsession
Then add the following at the end of the file:
lxsession -s LXDE -e LXDE
3 Step3: Edit /etc/xrdp/xrdp.ini
Edit /etc/xrdp/xrdp.ini
sudo vim / etc / xrdp / xrdp.ini
Scroll to the address of "; Session types", delete all other session types, only [Xvnc] is left:
; ; Session types ; ; Some session types such as Xorg, X11rdp and Xvnc start a display server. ; Startup command-line parameters for the display server are configured ; in sesman.ini. See and configure also sesman.ini. [ Xvnc ] name =Xvnc lib =libvnc.so username =ask password =ask ip =127.0.0.1 port =- 1 #xserverbpp=24 #delay_ms=2000
4 Step4: Disable light-locker
Since light-locker will not work properly in the XRDP environment, we need to disable it in the XRDP environment. In order not to affect the real environment, here we use a packaging script to solve the problem. First, rename the original file:
the sudo CP / usr / bin / Light-Locker / usr / bin / Light-locker.orig the sudo RM / usr / bin / Light-Locker
Create another script to call it, and use the editor to create a file /usr/bin/light-locker with the following content:
#!/bin/sh # The light-locker uses XDG_SESSION_PATH provided by lightdm. if [ ! -Z " \$ {XDG_SESSION_PATH}" ] ; then / usr / bin / light-locker.orig else # Disable light-locker in XRDP. true fi EOF
Give the script executable permissions:
sudo chmod 755 / usr / bin / light-locker
5 Step5: Start xrdp service
sudo systemctl enable xrdp sudo systemctl restart xrdp
6 Step6: Test the remote desktop connection
Use the Microsoft Remote Desktop client to create a new connection, the address is the IP address of the development board, and the user name and password are pi. In order to get a better experience, the resolution is recommended to be set to 1280x800, and the color depth is 24 bits. The settings are as shown in the figure below. Shown:
After the connection is successful, as shown in the figure below:
No comments:
Post a Comment