Unable to login to Librem Mini with Remote Desktop

Hi,

I’ve been trying to debug an unusual issue with my Librem Mini. I’m trying to login with remote desktop, but I’m running into one of two issues. Either the login screen crashes with the following graphic:

librem-mini-rdp-error

Or I get a blank, black screen. I get the blank screen if my user is logged in locally, and I get the error graphic if my user is not logged in locally.

During my troubleshooting I found two potential solutions to the issue with a user being logged in locally and remotely causing the blank, black screen. However, both of those solutions result in the error graphic when attempting to login remotely, regardless of if my user is logged in locally or not. The two potential solutions I tried are covered here:
https://c-nergy.be/blog/?p=16698

It seems there may be some issue with the desktop login screen itself when accessed by remote desktop, but I am unable to find any further information that may assist with my troubleshooting. So I wanted to reach out in this forum to see if any one else has any additional information that may help me get this fixed.

I’ve pasted relevant sections from auth.log, xrdp.log, and xrdp-sesman.log below for a recent attempted login that resulted in the login screen crash error graphic.

auth.log

Dec 27 13:30:57 librem-mini xrdp-sesman[6089]: pam_unix(xrdp-sesman:session): session opened for user ajm(uid=1000) by (uid=0)
Dec 27 13:30:57 librem-mini systemd-logind[653]: New session c6 of user ajm.
Dec 27 13:30:57 librem-mini gnome-keyring-daemon[1334]: The Secret Service was already initialized
Dec 27 13:30:57 librem-mini gnome-keyring-daemon[1334]: The SSH agent was already initialized
Dec 27 13:30:57 librem-mini gnome-keyring-daemon[1334]: The PKCS#11 component was already initialized
Dec 27 13:30:57 librem-mini gnome-keyring-daemon[1334]: The Secret Service was already initialized
Dec 27 13:30:58 librem-mini PackageKit: uid 1000 is trying to obtain org.freedesktop.packagekit.system-sources-refresh auth (only_trusted:0)
Dec 27 13:30:58 librem-mini PackageKit: uid 1000 failed to obtain auth
Dec 27 13:31:07 librem-mini xrdp-sesman[6089]: pam_unix(xrdp-sesman:session): session closed for user ajm
Dec 27 13:31:07 librem-mini systemd-logind[653]: Failed to restore VT, ignoring: Bad file descriptor
Dec 27 13:31:07 librem-mini systemd-logind[653]: Session c6 logged out. Waiting for processes to exit.

xrdp.log

[20211227-13:30:42] [INFO ] Socket 12: AF_INET connection received from $macbook-local-ip-addr port 53223
[20211227-13:30:42] [DEBUG] Closed socket 12 (AF_INET $librem-mini-local-ip-addr:3389)
[20211227-13:30:42] [DEBUG] Closed socket 11 (AF_INET 0.0.0.0:3389)
[20211227-13:30:42] [INFO ] Using default X.509 certificate: /etc/xrdp/cert.pem
[20211227-13:30:42] [INFO ] Using default X.509 key file: /etc/xrdp/key.pem
[20211227-13:30:42] [DEBUG] TLSv1.3 enabled
[20211227-13:30:42] [DEBUG] TLSv1.2 enabled
[20211227-13:30:42] [DEBUG] Security layer: requested 11, selected 1
[20211227-13:30:56] [INFO ] connected client computer name: ajm-MacBook-P
[20211227-13:30:56] [INFO ] adding channel item name rdpdr chan_id 1004 flags 0x80800000
[20211227-13:30:56] [INFO ] adding channel item name rdpsnd chan_id 1005 flags 0xc0000000
[20211227-13:30:56] [INFO ] adding channel item name cliprdr chan_id 1006 flags 0xc0a00000
[20211227-13:30:56] [INFO ] adding channel item name drdynvc chan_id 1007 flags 0xc0800000
[20211227-13:30:56] [INFO ] TLS connection established from $macbook-local-ip-addr port 53223: TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384
[20211227-13:30:57] [DEBUG] xrdp_000017c8_wm_login_mode_event_00000001
[20211227-13:30:57] [INFO ] Loading keymap file /etc/xrdp/km-00000409.ini
[20211227-13:30:57] [WARN ] local keymap file for 0x00000409 found and doesn't match built in keymap, using local keymap file
[20211227-13:30:57] [DEBUG] xrdp_wm_log_msg: connecting to sesman ip 127.0.0.1 port 3350
[20211227-13:30:57] [INFO ] xrdp_wm_log_msg: sesman connect ok
[20211227-13:30:57] [DEBUG] xrdp_wm_log_msg: sending login info to session manager, please wait...
[20211227-13:30:57] [DEBUG] return value from xrdp_mm_connect 0
[20211227-13:30:57] [INFO ] xrdp_wm_log_msg: login successful for display 12
[20211227-13:30:57] [DEBUG] xrdp_wm_log_msg: started connecting
[20211227-13:30:57] [INFO ] lib_mod_log_peer: xrdp_pid=6088 connected to X11rdp_pid=6091 X11rdp_uid=1000 X11rdp_gid=1000 client_ip=$macbook-local-ip-addr client_port=53223
[20211227-13:30:57] [DEBUG] xrdp_wm_log_msg: connected ok
[20211227-13:30:57] [DEBUG] xrdp_mm_connect_chansrv: chansrv connect successful
[20211227-13:30:57] [DEBUG] Closed socket 18 (AF_INET6 ::1 port 58874)
[20211227-13:31:07] [DEBUG] Closed socket 12 (AF_INET $librem-mini-local-ip-addr:3389)
[20211227-13:31:07] [DEBUG] xrdp_mm_module_cleanup
[20211227-13:31:07] [DEBUG] Closed socket 19 (AF_UNIX)
[20211227-13:31:07] [DEBUG] Closed socket 20 (AF_UNIX)

xrdp-sesman.log

[20211227-13:30:57] [INFO ] A connection received from ::1 port 58874
[20211227-13:30:57] [INFO ] ++ created session (access granted): username ajm, ip $macbook-local-ip-addr:53223 - socket: 12
[20211227-13:30:57] [INFO ] starting Xorg session...
[20211227-13:30:57] [DEBUG] Closed socket 9 (AF_INET6 :: port 5912)
[20211227-13:30:57] [DEBUG] Closed socket 9 (AF_INET6 :: port 6012)
[20211227-13:30:57] [DEBUG] Closed socket 9 (AF_INET6 :: port 6212)
[20211227-13:30:57] [DEBUG] Closed socket 8 (AF_INET6 ::1 port 3350)
[20211227-13:30:57] [INFO ] calling auth_start_session from pid 6089
[20211227-13:30:57] [DEBUG] Closed socket 7 (AF_INET6 ::1 port 3350)
[20211227-13:30:57] [DEBUG] Closed socket 8 (AF_INET6 ::1 port 3350)
[20211227-13:30:57] [INFO ] /usr/lib/xorg/Xorg :12 -auth .Xauthority -config xrdp/xorg.conf -noreset -nolisten tcp -logfile .xorgxrdp.%s.log
[20211227-13:30:57] [CORE ] waiting for window manager (pid 6090) to exit
[20211227-13:31:07] [CORE ] window manager (pid 6090) did exit, cleaning up session
[20211227-13:31:07] [INFO ] calling auth_stop_session and auth_end from pid 6089
[20211227-13:31:07] [DEBUG] cleanup_sockets:
[20211227-13:31:07] [DEBUG] cleanup_sockets: deleting /run/xrdp/sockdir/xrdp_chansrv_audio_out_socket_12
[20211227-13:31:07] [DEBUG] cleanup_sockets: deleting /run/xrdp/sockdir/xrdp_chansrv_audio_in_socket_12
[20211227-13:31:07] [DEBUG] cleanup_sockets: deleting /run/xrdp/sockdir/xrdpapi_12
[20211227-13:31:07] [INFO ] ++ terminated session:  username ajm, display :12.0, session_pid 6089, ip $macbook-local-ip-addr:53223 - socket: 12

The only things that really jump out to me are these two lines from auth.log:

Dec 27 13:30:58 librem-mini PackageKit: uid 1000 is trying to obtain org.freedesktop.packagekit.system-sources-refresh auth (only_trusted:0)
Dec 27 13:30:58 librem-mini PackageKit: uid 1000 failed to obtain auth

And in the xrdp.log, one of the sockets is closed in the same second that the connection finishes successfully.

[20211227-13:30:57] [DEBUG] xrdp_mm_connect_chansrv: chansrv connect successful
[20211227-13:30:57] [DEBUG] Closed socket 18 (AF_INET6 ::1 port 58874)

Thanks in advance for any help or insights.

Are you running Wayland or Xorg on the librem mini?

I switched from Wayland to Xorg yesterday and rebooted.

[daemon]
# Uncomment the line below to force the login screen to use Xorg
WaylandEnable=false

I’ve installed Plasma desktop and switched to sddm display manager but I’m still getting the same error. It seems it is just not possible to connect to a PureOS device via remote desktop.

I don’t think PureOS is going to work for my needs unfortunately. I will try installing Ubuntu Server and add a lightweight desktop.

If you power off the librem mini completely, turn it back on, and then DO NOT login in locally at all, can you connect to it via xRDP (I assume that is what you are using since its in the links)?

Searching for your particular error message I’m finding lots of hits online with various workarounds, just not specific to xRDP, its more of an authentication failure thing.

If you power off the librem mini completely, turn it back on, and then DO NOT login in locally at all, can you connect to it via xRDP (I assume that is what you are using since its in the links)?

Yea that is what I’m doing. I set it so I can decrypt the main volume remotely via SSH. Once the volume is decrypted, the temporary SSH session is closed by the Librem Mini. Then I open the Remote Desktop application and attempt to login with my user and I get that login page crash error.

I think you are right that it is auth based and that is what I’ve found in my searching. xRDP remote login has auth issues if the same user is logged in locally. I seem to be getting the issue whether my user is logged in locally or not. This makes me think that there is some user session being generated even if I’m not actually logged in. I think it may be that even just having the login screen running locally could be interfering with xRDP. But that is purely a guess at this point.

Having remote GUI access is really just a nice to have feature for my use case. 99% of the time I’ll be fine with SSH. I think I’m mostly just annoyed that it isn’t working and I want to solve the mystery.

Thanks for taking the time look over this and offer suggestions. Much appreciated!