'Raspberry Pi / Remote Desktop, "connection problem, giving up"

I have three new Raspberry Pis running this OS:

PRETTY_NAME="Raspbian GNU/Linux 11 (bullseye)"
NAME="Raspbian GNU/Linux"
VERSION_ID="11"
VERSION="11 (bullseye)"
VERSION_CODENAME=bullseye
ID=raspbian
ID_LIKE=debian

I cannot get Remote Desktop to connect properly. I have xrdp and all updates installed on the Pi. SSH is on and I can connect via a gitbash terminal fine. VNC connection is enabled and viewer connects just fine. I keep getting the following error after logging in to the Pi's ip address (192.168.4.84):

Connecting to sesman IP 127.0.0.1 port 3350
sesman connect ok sending
login info to session manager, please wait...
login successful for display 10
started connecting
connection problem, giving up
some problem

enter image description here

Per many other posts, I have tried:

  • restarting the xrdp service
  • adding auto lo to /etc/network/interfaces
  • reinstalling xrdp, vnc4server, and tightvnc in various orders per this answer.
  • adding allowed_users = anybody to /etc/X11/Xwrapper.config per this answer.
  • per this post, I tried purging xrdp, then purge vnc server, then reinstalling xrdp with no luck.
  • I tried installing an older version of xrdp per this answer, but the package is no longer available.
  • I tried adding this to sesman.ini, no luck

I have another Raspberry Pi running version 10 OS with no issues:

PRETTY_NAME="Raspbian GNU/Linux 10 (buster)"
NAME="Raspbian GNU/Linux"
VERSION_ID="10"
VERSION="10 (buster)"
VERSION_CODENAME=buster
ID=raspbian
ID_LIKE=debian

Any suggestions to get the newer OS working properly?



Solution 1:[1]

I have found the reason for the issue in this answer.

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.

I created a second user and confirmed that this works. Thanks @A.J.Bauer

Solution 2:[2]

I got my Pi 4 today and ran into exactly your problem. Took me 1 hour to figure out how to fix, hope it can help:

  • Remove and purge all VNC server and then install/reinstall XRDP
  • sudo raspi-config
  • Go to (1) System Options -> S5 Boot/Auto Login -> select "B3 Desktop GUI - requiring user to login". It should works with this option. Otherwise you can give a try with the automatically logging in as pi user option.
  • Reboot and have fun !

Solution 3:[3]

The problem is that there is some process still using the login name.

I solved this way:

  1. add a new user, give sudo privs
  2. rdp with that, it should work
  3. deluser the previous one
  4. kill any process that gives error in point 3 and repeat
  5. set autologin to console no auto w/ raspi-config
  6. reboot
  7. rdp with new user
  8. adduser the old one
  9. rdp with that
  10. you're good to go

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 S. Taylor
Solution 2 Trung Lam
Solution 3 Roberto Gatti