neutrinolabs / xrdp

xrdp: an open source RDP server
http://www.xrdp.org/
Apache License 2.0
5.65k stars 1.73k forks source link

Session fails to start after upgrading Fedora 39 to Fedora 40 #3044

Closed superbonaci closed 5 months ago

superbonaci commented 5 months ago

xrdp version

0.9.25

Detailed xrdp version, build options

xrdp 0.9.25
  A Remote Desktop Protocol Server.
  Copyright (C) 2004-2020 Jay Sorg, Neutrino Labs, and all contributors.
  See https://github.com/neutrinolabs/xrdp for more information.

  Configure options:
      --build=x86_64-redhat-linux-gnu
      --host=x86_64-redhat-linux-gnu
      --program-prefix=
      --disable-dependency-tracking
      --prefix=/usr
      --exec-prefix=/usr
      --bindir=/usr/bin
      --sbindir=/usr/sbin
      --sysconfdir=/etc
      --datadir=/usr/share
      --includedir=/usr/include
      --libdir=/usr/lib64
      --libexecdir=/usr/libexec
      --localstatedir=/var
      --runstatedir=/run
      --sharedstatedir=/var/lib
      --mandir=/usr/share/man
      --infodir=/usr/share/info
      --enable-fuse
      --enable-pixman
      --enable-painter
      --enable-vsock
      --enable-ipv6
      --with-socketdir=/run/xrdp
      --with-imlib2
      build_alias=x86_64-redhat-linux-gnu
      host_alias=x86_64-redhat-linux-gnu
      CC=gcc
      CFLAGS=-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Wno-complain-wrong-lang -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -m64 -march=x86-64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer
      LDFLAGS=-Wl,-z,relro -Wl,--as-needed  -Wl,-z,pack-relative-relocs -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld-errors -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -Wl,--build-id=sha1 -specs=/usr/lib/rpm/redhat/redhat-package-notes
      LT_SYS_LIBRARY_PATH=/usr/lib64:
      PKG_CONFIG_PATH=:/usr/lib64/pkgconfig:/usr/share/pkgconfig

  Compiled with OpenSSL 3.2.1 30 Jan 2024

Operating system & version

Fedora 40

Installation method

dnf

What desktop environment do you use?

Plasma/KDE

Environment xrdp running on

physical

What's your client?

Microsoft

Area(s) with issue?

Session manager (sesman)

Steps to reproduce

Under Fedora 39 was working fine, after upgrading to Fedora 40 the login screen appears, but after entering user and pass closes immediately.

$ cat .xsession-errors
Environment variable $XAUTHORITY not set, ignoring.

$ systemctl get-default
graphical.target

The issue may be here:

[INFO ] Starting the default window manager on display 10: /usr/libexec/xrdp/startwm-bash.sh
[WARN ] Window manager (pid 11302, display 10) exited quickly (1 secs). This could indicate a window manager config problem
superbonaci commented 5 months ago

Here are the logs before and after trying to log in.

matt335672 commented 5 months ago

As you suspect, your session is failing to start.

Is there anything useful from journalctl about the session?

superbonaci commented 5 months ago

Here's the journalctl log

matt335672 commented 5 months ago

It's possibly an SELinux issue. There's some information on this in /usr/share/doc/xrdp-0.9.*/README.Fedora

1) Have you installed xrdp-selinux ? 2) If that's not it, see if the session can be started after sudo setenforce permissive (if your environment allows this).

superbonaci commented 5 months ago

The only xrdp* readme is:

/usr/share/doc/xrdp/README.Fedora

installed version is:

$ sudo dnf list installed | grep xrdp-selinux
xrdp-selinux.x86_64                                  1:0.9.25-2.fc40                     @fedora

Red Hat already covered this topic but the answer is behind a paywall: Why XRDP refuses to start when selinux is in enforcing mode ?

SELINUX was already set to permissive in /etc/selinux/config. Changing it to disabled and rebooting doesn't change anything, RDP still not working. I don't think the update from Fedora 39 to 40 changed that setting.

matt335672 commented 5 months ago

OK - thanks. It's not SELinux then.

The logs are fairly uninformative. Here are a few more possibilities. 1) Is the same user isn't logged in on the console by any chance? 2) Is there anything in ~/.xsession-errors? 3) We can make sure that the expected session is being run by tracing through the startup script with this command:-

   DISPLAY= bash -x /usr/libexec/xrdp/startwm-bash.sh
superbonaci commented 5 months ago
  1. No there isn't any other user logged in on the console, as far as I know
  2. $ cat ~/.xsession-errors
    Environment variable $XAUTHORITY not set, ignoring.
  3. This command is run over ssh, I don't have access physical to computer right now, is that mandatory to fix the issue?
matt335672 commented 5 months ago

No that's good.

After running the above command, what's in /home/fedora/.xsession-errors ?

matt335672 commented 5 months ago

It looks like Fedora is having problems working out you're running KDE.

I haven't got a recent Fedora install to hand, but you could try one of the following:- 1) Edit /etc/sysconfig/desktop and set DESKTOP="KDE" 2) Check that /usr/bin/startplasma-x11 exists, and if it does:-

   ln -s /usr/bin/startplasma-x11 ~/.xsession

Please report back either way.

superbonaci commented 5 months ago

The file /etc/sysconfig/desktop does not exist, neither does /usr/bin/startplasma-x11. Looks that the problem has been reported: Plasma session not available after upgrading to Fedora 40

Maybe I should switch to Gnome, which is the default for Fedora. i just want to login to desktop, doesn't matter the desktop. How can I do it?

matt335672 commented 5 months ago

I wouldn't give up on KDE just yet - there can't be much missing.

Have a look for any sort of startplasma command (except startplasma-wayland). You can see what's installed with ls -l /usr/bin/startplasma*. You can see what isn't installed and which package provides it with dnf whatprovides "/usr/bin/startplasma*" If you can find something, install it if necessary, then link it in to ~/.xsession as described above.

If Gnome is installed, the X11 session scripts will almost certainly find it. About Gnome:- 1) I can look up how to install it, but you can do that at least as well as I can yourself. 2) The next Fedora version will probably drop support for X11 Gnome. At that point you'll have to find another desktop anywy as we won't have anything ready for a pure Wayland environment.

superbonaci commented 5 months ago

This is what I have:

$ ls -l /usr/bin/start*
lrwxrwxrwx. 1 root root     19 Apr 16 00:00 /usr/bin/startplasma -> startplasma-wayland
-rwxr-xr-x. 1 root root 215600 Apr 16 00:00 /usr/bin/startplasma-wayland
-rwxr-xr-x. 1 root root   5528 Jan 27 00:00 /usr/bin/startx
-rwxr-xr-x. 1 root root   3389 Jan 27 00:00 /usr/bin/startxfce4

I was able to enter Plasma after linking ~/.xsession to /usr/bin/startplasma, no need to create /etc/sysconfig/desktop. The issue I have now, is that the KDE resolution is fixed at 1024x768, and resizing the RDP window only adds black bars in bottom and right. It does not dynamically change the desktop resolution like did in Fedora 39.

Since this is "fixed", the resolution issue is here: https://github.com/neutrinolabs/xrdp/issues/3047