6

I installed xrdp on two Raspberry Pi 4 with 4 GB memory. The first one had a fresh installation of Raspberry Pi OS 11 with the full desktop environment, here everything works.

The second one had the normal desktop instead of the full one. On the second Pi with the normal desktop image, connecting to the RDP session doesn't work. After some time, XRDP shows the following error:

Screenshot of error message: Connection problem

In the log file /var/log/xrdp.log I found permission errors:

[ERROR] Cannot read private key file /etc/xrdp/key.pem: Permission denied

The file is owned by user & group root

lrwxrwxrwx 1 root root   36 Nov 22 21:57 cert.pem -> /etc/ssl/certs/ssl-cert-snakeoil.pem
lrwxrwxrwx 1 root root   38 Nov 22 21:57 key.pem -> /etc/ssl/private/ssl-cert-snakeoil.key

so I changed it to the pi user

sudo chown pi:pi /etc/xrdp/{key.pem,cert.pem}

The permission error in the logs is away now, but it doesn't seem to help. It shows the background color without anything on it and the logs shows

[20211122-22:50:39] [INFO ] connecting to sesman ip 127.0.0.1 port 3350
[20211122-22:50:39] [INFO ] xrdp_wm_log_msg: sesman connect ok
[20211122-22:50:39] [INFO ] sesman connect ok
[20211122-22:50:39] [INFO ] sending login info to session manager, please wait...
[20211122-22:50:39] [INFO ] xrdp_wm_log_msg: login successful for display 12
[20211122-22:50:39] [INFO ] login successful for display 12
[20211122-22:50:39] [INFO ] loaded module 'libxup.so' ok, interface size 9456, version 4
[20211122-22:50:39] [INFO ] started connecting
[20211122-22:50:39] [INFO ] lib_mod_connect: connecting via UNIX socket
[20211122-22:54:09] [INFO ] connection problem, giving up
[20211122-22:54:09] [INFO ] some problem

Is this somehow related to the window manager changes in RPI OS 11? The changelogs says that

mutter window manager used instead of openbox on devices with 2GB or more of RAM

I also tried this idea by creating a ~/.xsession file to start mutter without success:

#!/bin/bash
exec /usr/bin/mutter
Chenmunka
  • 620
  • 6
  • 17
  • 28
Lion
  • 247
  • 2
  • 4
  • 12

4 Answers4

8

I tested 32bit and 64bit for Pi Zero, 3 and 4 then I found that the problem happens only on 4.

The OS I tested are released on 2021.01.28.

Pi type OS RDP login status
Zero 32bit No problem
3 32bit No problem
3 64bit No problem
4 32bit Black screen
4 63bit Black screen

As Robert says on the thread, removing group of video and render and disabling auto login solved this problem.


Removing group

sudo gpasswd -d pi video
sudo gpasswd -d pi render

Disabling auto login

sudo raspi-config

Then select System options -> Boot / Auto Login -> Desktop GUI, requiring user to login.


Is it bug of Raspberry Pi OS for 4?

asukiaaa
  • 181
  • 1
  • 4
6

Turns out you cannot login twice with the same account using xrdp on Raspbian Bullseye (Debian 11). So you need to either disable autologin using "Raspberry Pi Configuration"/sudo raspi-config or create another user. If this is not an option because you need to login as the same user then you might want to look into VNC, Teamviewer or go back to Raspbian Buster (Debian 10).

Some links:

A-J-Bauer
  • 218
  • 1
  • 5
4

The reason is not only the autologin. Even if autologin is disabled for the user pi, you will not be able to login via RDP with this user under Bullseye.

I created an own user, and at first I could use RDP. But after I put the user into the same user groups as the user pi, it was not possible anymore. The reason seem to be the user groups video and render. With render it's not possible at all, if you remove only render and keep video, the video output in the RDP session will make problems.

I'm using the 64-bit-version of Bullseye.

Robert
  • 41
  • 1
3

I'm on an Rpi 4 running the latest 64 bit OS (as at April 2022). I have been searching for a way to get this working and tried all the different combinations including creating a new user account (note the latest 64bit raspian is similar to debian in that you no longer get a "pi" user created)

For me, the answer provided by asukiaa above actually worked: By removing my own user from video and render, I was able to get RDP working:

sudo gpasswd -d <username> video
sudo gpasswd -d <username> render

Unfortunately, I don't have enough points to be able to upvote their answer, but this is definitely working for me right now.

Geekdan
  • 31
  • 2