5

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

4 Answers 4

5

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:

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?

2
  • asukiaaa's answer worked for me but there is a small typo: Disabling auto login should be as shown below. (not conofig) sudo raspi-config If you are using the Desktop in bullseye you can also change auto login with: Preferences ->Raspberry Pi Configuration -> System -> Auto login: to off (left)
    – jaysailing
    Commented Mar 30, 2022 at 18:02
  • This seemed to work for me too. Thanks. I fixed the typo but had to be a min of 6 characters of change, so had to add some dots haha
    – phocks
    Commented Oct 29, 2022 at 3:51
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.

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.

2
  • Would plugin in a monitor still work if you do this? or do i have to do a reverse command sudo adduser <username> video? sudo adduser <username> render?
    – Cees
    Commented Aug 9, 2022 at 0:47
  • I was able to login via a monitor after opening a remote desktop, but not the other way around. It seems to be a bug where two sessions are allowed, but the remote session must be started first, then the direct session.
    – Scott
    Commented Aug 31, 2022 at 20:03

Not the answer you're looking for? Browse other questions tagged or ask your own question.