Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I can only connect via RDP if the user is in the sudo group #3016

Closed
izi4me opened this issue Mar 26, 2024 · 15 comments
Closed

I can only connect via RDP if the user is in the sudo group #3016

izi4me opened this issue Mar 26, 2024 · 15 comments
Labels

Comments

@izi4me
Copy link

izi4me commented Mar 26, 2024

xrdp version

0.9.21.1

Detailed xrdp version, build options

xrdp 0.9.21.1
  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:
      --enable-ipv6
      --enable-jpeg
      --enable-fuse
      --enable-rfxcodec
      --enable-opus
      --enable-painter
      --enable-vsock
      --build=aarch64-linux-gnu
      --prefix=/usr
      --includedir=${prefix}/include
      --mandir=${prefix}/share/man
      --infodir=${prefix}/share/info
      --sysconfdir=/etc
      --localstatedir=/var
      --disable-silent-rules
      --libdir=${prefix}/lib/aarch64-linux-gnu
      --libexecdir=${prefix}/lib/aarch64-linux-gnu
      --disable-maintainer-mode
      --disable-dependency-tracking
      --with-socketdir=/run/xrdp/sockdir
      build_alias=aarch64-linux-gnu
      CFLAGS=-g -O2 -ffile-prefix-map=/build/xrdp-xCPoG3/xrdp-0.9.21.1=. -fstack-protector-strong -Wformat -Werror=format-security 
      LDFLAGS=-Wl,-z,relro -Wl,-z,now -Wl,--as-needed
      CPPFLAGS=-Wdate-time -D_FORTIFY_SOURCE=2 
      PKG_CONFIG_PATH=/build/xrdp-xCPoG3/xrdp-0.9.21.1/pkgconfig

  Compiled with OpenSSL 3.0.11 19 Sep 2023

Operating system & version

Debian GNU/Linux 12 (bookworm)

Installation method

dnf / apt / zypper / pkg / etc

Which backend do you use?

xorg

What desktop environment do you use?

LXDE-pi

Environment xrdp running on

Raspberry PI (PCI bridge: Broadcom Inc. and subsidiaries BCM2711 PCIe Bridge)

What's your client?

Windows RDP client

Area(s) with issue?

Session manager (sesman)

Steps to reproduce

When I log in with the main user, there is no problem. When I try with any other user, the client closes automatically without any response message.

✔️ Expected Behavior

Log in with any user

❌ Actual Behavior

I can't log in with a different user than my main user

Anything else?

Logs

/var/log/xrdp.log
xrdp.log.txt

/var/log/xrdp-sesman.log
xrdp-sesman.log.txt

/home/izi4me/.xorgxrdp.10.log
xorgxrdp.10.log.txt

/home/raspi/.xorgxrdp.11.log
xorgxrdp.11.log..txt

When I add the raspi user to the sudo group, I can access correctly via RDP. I guess it must be a permissions problem but I can't identify the problem.

Thank you.
Regards.

@izi4me izi4me added the bug label Mar 26, 2024
@matt335672
Copy link
Member

Bad messages in xordxrdp.10.txt:-

[    59.774] (EE) glamor0: GL error: GL_INVALID_OPERATION in glGetUniformLocation(program not linked)
[    59.774] (EE) 
[    59.774] (EE) Backtrace:
[    59.776] (EE) 0: /usr/lib/aarch64-linux-gnu/dri/v3d_dri.so (__driDriverGetExtensions_d3d12+0x2397e4) [0x7f88aa56d4]
[    59.777] (EE) 1: /usr/lib/aarch64-linux-gnu/dri/v3d_dri.so (__driDriverGetExtensions_d3d12+0x698dc) [0x7f888d57cc]
[    59.778] (EE) 2: /usr/lib/aarch64-linux-gnu/dri/v3d_dri.so (__driDriverGetExtensions_d3d12+0x2dea78) [0x7f88b4a968]
[    59.779] (EE) 3: /usr/lib/xorg/modules/libxorgxrdp.so (rdpEglCreate+0x508) [0x7f8a3e2448]
[    59.780] (EE) unw_get_proc_name failed: no unwind info found [-10]
[    59.780] (EE) 4: /usr/lib/xorg/modules/drivers/xrdpdev_drv.so (?+0x0) [0x7f8a3a3b08]
[    59.781] (EE) 5: /usr/lib/xorg/Xorg (AddScreen+0xac) [0x5584b650dc]
[    59.782] (EE) 6: /usr/lib/xorg/Xorg (InitOutput+0x264) [0x5584ba4db8]
[    59.782] (EE) 7: /usr/lib/xorg/Xorg (InitFonts+0x268) [0x5584b68d48]
[    59.784] (EE) 8: /lib/aarch64-linux-gnu/libc.so.6 (__libc_init_first+0x80) [0x7f8b287780]
[    59.785] (EE) 9: /lib/aarch64-linux-gnu/libc.so.6 (__libc_start_main+0x98) [0x7f8b287858]
[    59.786] (EE) 10: /usr/lib/xorg/Xorg (_start+0x30) [0x5584b51f30]

What do you get for ls -l /dev/dri/renderD128? You might need to add your user to the group that owns this device.

@izi4me
Copy link
Author

izi4me commented Mar 26, 2024

Let me attack also the logs of .xsession-errors:

/home/izi4me/.xsession-errors
(izi4me)-xsession-errors.txt

/home/raspi/.xsession-errors
(raspi)-xsession-errors.txt

@izi4me
Copy link
Author

izi4me commented Mar 26, 2024

Bad messages in xordxrdp.10.txt:-

[    59.774] (EE) glamor0: GL error: GL_INVALID_OPERATION in glGetUniformLocation(program not linked)
[    59.774] (EE) 
[    59.774] (EE) Backtrace:
[    59.776] (EE) 0: /usr/lib/aarch64-linux-gnu/dri/v3d_dri.so (__driDriverGetExtensions_d3d12+0x2397e4) [0x7f88aa56d4]
[    59.777] (EE) 1: /usr/lib/aarch64-linux-gnu/dri/v3d_dri.so (__driDriverGetExtensions_d3d12+0x698dc) [0x7f888d57cc]
[    59.778] (EE) 2: /usr/lib/aarch64-linux-gnu/dri/v3d_dri.so (__driDriverGetExtensions_d3d12+0x2dea78) [0x7f88b4a968]
[    59.779] (EE) 3: /usr/lib/xorg/modules/libxorgxrdp.so (rdpEglCreate+0x508) [0x7f8a3e2448]
[    59.780] (EE) unw_get_proc_name failed: no unwind info found [-10]
[    59.780] (EE) 4: /usr/lib/xorg/modules/drivers/xrdpdev_drv.so (?+0x0) [0x7f8a3a3b08]
[    59.781] (EE) 5: /usr/lib/xorg/Xorg (AddScreen+0xac) [0x5584b650dc]
[    59.782] (EE) 6: /usr/lib/xorg/Xorg (InitOutput+0x264) [0x5584ba4db8]
[    59.782] (EE) 7: /usr/lib/xorg/Xorg (InitFonts+0x268) [0x5584b68d48]
[    59.784] (EE) 8: /lib/aarch64-linux-gnu/libc.so.6 (__libc_init_first+0x80) [0x7f8b287780]
[    59.785] (EE) 9: /lib/aarch64-linux-gnu/libc.so.6 (__libc_start_main+0x98) [0x7f8b287858]
[    59.786] (EE) 10: /usr/lib/xorg/Xorg (_start+0x30) [0x5584b51f30]

What do you get for ls -l /dev/dri/renderD128? You might need to add your user to the group that owns this device.

The group is render.
I added the user raspi into the group render and reboot, but it still doesn't work.

I attach the new log from xordxrdp.10.txt
(new)xorgxrdp.10.log.txt

@izi4me
Copy link
Author

izi4me commented Mar 26, 2024

I have seen that the error still appears in the new log:
rdpProbe: found DRMDevice xorg.conf value [/dev/dri/renderD128]

But the user was added into the group render:
image

@izi4me
Copy link
Author

izi4me commented Mar 26, 2024

I'm not sure if there is any relation, but when I try to access any browser via RDP it displays as follows:

image

This happens only via RDP. This does not happen when viewed directly via HDMI.

I currently have the configuration:
image

But also i changed to multi-user.target and still have the same problems

@matt335672
Copy link
Member

For the browser issue see #2869

As for the rest of your issues, I've done a bit of poking about in past issues and found this comment on #1503 which describes your situation. I can't offer you a solution for the issue as reported as I don't have an rPI 4 to reproduce this.

In the log you attach above for a working session, I notice the following:-

  5250.885] rdpPreInit: /dev/dri/renderD128 open failed

It looks like for the working session the device can't be opened, which is the other way round from what I'd expect. It does however give us a way forward which is to stop the xrdp session trying to use this device at all. See this comment for how to do that.

@izi4me
Copy link
Author

izi4me commented Mar 27, 2024

First of all, thank you very much for your time and help.

The problem with the browser was what you said. Using the --disable-gpu command works fine.

Lets talk about the rdp connection. I have made the change you mention and reboot, but I still can't log in via RDP with "raspi" user.

image

I cheked again the log xorgxrdp.11.log and even if the field is blank, it still gives an error when trying to use it:

[  2531.674] rdpProbe: found DRMDevice xorg.conf value []
[  2531.674] rdpProbe: found DRI3 xorg.conf value [1]
[  2531.674] (II) XRDPDEV(0): using default device
[  2531.674] (WW) VGA arbiter: cannot open kernel arbiter, no multi-card support
[  2531.674] rdpPreInit:
[  2531.674] rdpPreInit:  open failed

I attach the xorgxrdp.11.log of the user "raspi"

raspi_log(xorgxrdp.11.log).txt

If you need anything else, tell me.

Thank you.

@matt335672
Copy link
Member

That log file looks fine. The session is not working for another reason.

Check you're not logged in on the rPI console as the same user. If it's not that, paste your xrdp-sesman.log for the session times.

@izi4me
Copy link
Author

izi4me commented Mar 28, 2024

I have checked the user who is logged in, and it's the user "izi4me". From this user I can connect via RDP, but I still can't connect with the "raspi" user.

I have checked the xrdp-sesman.log and xrdp.log files, and I don't see anything strange.

I attach the logs.

(update)-xrdp-sesman.log.txt
(update)xrdp.log.txt

@matt335672
Copy link
Member

Thanks.

Have you get anything in /home/raspi/.xsession-errors?

@izi4me
Copy link
Author

izi4me commented Mar 28, 2024

I check it and there is not many information about the error, just "Failed to inhibit: Access denied"

i attack the log.

(update)xsession-errors.txt

@matt335672
Copy link
Member

Let's try to get more logging out of the start session script.

Try this logged in as raspi:-

DISPLAY= sh -x /etc/xrdp/startwm.sh

This might give you more in .xsession-errors as well

@izi4me
Copy link
Author

izi4me commented Mar 28, 2024

Its seems there is more information:

(update2)xsession-errors.txt

@izi4me
Copy link
Author

izi4me commented Mar 28, 2024

I add a trace of debug into the xrdp-sesman.ini to get more info on the xrdp-sesman.log. Maybe can help you:

[20240328-16:23:38] [INFO ] Socket 12: AF_INET6 connection received from ::1 port 59016
[20240328-16:23:39] [DEBUG] session_get_bydata: search policy 0 U raspi W 1920 H 1080 bpp 24 T 3 IP ::ffff:192.168.50.119:58472 - socket: 12
[20240328-16:23:39] [DEBUG] session_get_bydata: try 0x558d4b5c30 U izi4me W 1920 H 1080 bpp 24 T 3 IP ::ffff:192.168.50.119:58139 - socket: 12
[20240328-16:23:39] [INFO ] Terminal Server Users group is disabled, allowing authentication
[20240328-16:23:39] [INFO ] ++ created session (access granted): username raspi, ip ::ffff:192.168.50.119:58472 - socket: 12
[20240328-16:23:39] [INFO ] starting Xorg session...
[20240328-16:23:39] [INFO ] Found X server running at /tmp/.X11-unix/X10
[20240328-16:23:39] [DEBUG] Did not find a running X server at /tmp/.X11-unix/X12
[20240328-16:23:39] [DEBUG] Did not find a running X server at /tmp/.X12-lock
[20240328-16:23:39] [DEBUG] Closed socket 13 (AF_INET6 :: port 5912)
[20240328-16:23:39] [DEBUG] Did not find a running X server at 5912
[20240328-16:23:39] [DEBUG] Closed socket 13 (AF_INET6 :: port 6012)
[20240328-16:23:39] [DEBUG] Did not find a running X server at 6012
[20240328-16:23:39] [DEBUG] Closed socket 13 (AF_INET6 :: port 6212)
[20240328-16:23:39] [DEBUG] Did not find a running X server at 6212
[20240328-16:23:39] [DEBUG] Did not find a running X server at /run/xrdp/sockdir/xrdp_chansrv_socket_12
[20240328-16:23:39] [DEBUG] Did not find a running X server at /run/xrdp/sockdir/xrdp_chansrv_audio_out_socket_12
[20240328-16:23:39] [DEBUG] Did not find a running X server at /run/xrdp/sockdir/xrdp_chansrv_audio_in_socket_12
[20240328-16:23:39] [DEBUG] Did not find a running X server at /run/xrdp/sockdir/xrdpapi_12
[20240328-16:23:39] [INFO ] Starting session: session_pid 2145, display :12.0, width 1920, height 1080, bpp 24, client ip ::ffff:192.168.50.119:58472 - socket: 12, user name raspi
[20240328-16:23:39] [INFO ] [session start] (display 12): calling auth_start_session from pid 2145
[20240328-16:23:39] [ERROR] sesman_data_in: scp_process_msg failed
[20240328-16:23:39] [ERROR] sesman_main_loop: trans_check_wait_objs failed, removing trans
[20240328-16:23:39] [DEBUG] Closed socket 12 (AF_INET6 ::1 port 3350)
[20240328-16:23:39] [DEBUG] Closed socket 11 (AF_INET6 ::1 port 3350)
[20240328-16:23:39] [DEBUG] Closed socket 12 (AF_INET6 ::1 port 3350)
[20240328-16:23:39] [DEBUG] Waiting for X server to start on display 12
[20240328-16:23:39] [DEBUG] Did not find a running X server at /tmp/.X11-unix/X12
[20240328-16:23:39] [DEBUG] Waiting for X server to start on display 12
[20240328-16:23:39] [DEBUG] Did not find a running X server at /tmp/.X11-unix/X12
[20240328-16:23:39] [DEBUG] Did not find a running X server at /tmp/.X12-lock
[20240328-16:23:39] [INFO ] Starting X server on display 12: /usr/lib/xorg/Xorg :12 -auth .Xauthority -config xrdp/xorg.conf -noreset -nolisten tcp -logfile .xorgxrdp.%s.log  
[20240328-16:23:39] [DEBUG] Did not find a running X server at /tmp/.X12-lock
[20240328-16:23:39] [DEBUG] Calling exec (executable: /usr/lib/xorg/Xorg, arguments: /usr/lib/xorg/Xorg :12 -auth .Xauthority -config xrdp/xorg.conf -noreset -nolisten tcp -logfile .xorgxrdp.%s.log)
[20240328-16:23:39] [INFO ] Found X server running at /tmp/.X11-unix/X12
[20240328-16:23:39] [INFO ] Session started successfully for user raspi on display 12
[20240328-16:23:39] [INFO ] Found X server running at /tmp/.X11-unix/X12
[20240328-16:23:39] [INFO ] Starting the xrdp channel server for display 12
[20240328-16:23:39] [INFO ] Session in progress on display 12, waiting until the window manager (pid 2166) exits to end the session
[20240328-16:23:39] [DEBUG] waiting for pid 2166 to exit
[20240328-16:23:39] [INFO ] Found X server running at /tmp/.X11-unix/X12
[20240328-16:23:39] [DEBUG] Calling exec (executable: /usr/sbin/xrdp-chansrv, arguments: /usr/sbin/xrdp-chansrv)
[20240328-16:23:39] [DEBUG] The user session on display 12 did not request a specific window manager
[20240328-16:23:39] [DEBUG] The user home directory window manager configuration is enabled but window manager program does not exist: /home/raspi/startwm.sh
[20240328-16:23:39] [INFO ] Starting the default window manager on display 12: /etc/xrdp/startwm.sh
[20240328-16:23:39] [DEBUG] Calling exec (executable: /etc/xrdp/startwm.sh, arguments: /etc/xrdp/startwm.sh )
[20240328-16:23:40] [WARN ] Window manager (pid 2166, display 12) exited with non-zero exit code 1 and signal 0. This could indicate a window manager config problem
[20240328-16:23:40] [WARN ] Window manager (pid 2166, display 12) exited quickly (1 secs). This could indicate a window manager config problem
[20240328-16:23:40] [INFO ] Calling auth_stop_session and auth_end from pid 2145
[20240328-16:23:40] [INFO ] Terminating X server (pid 2167) on display 12
[20240328-16:23:40] [INFO ] Terminating the xrdp channel server (pid 2206) on display 12
[20240328-16:23:40] [DEBUG] waiting for pid 2167 to exit
[20240328-16:23:40] [INFO ] X server on display 12 (pid 2167) returned exit code 0 and signal number 0
[20240328-16:23:40] [DEBUG] waiting for pid 2206 to exit
[20240328-16:23:40] [INFO ] xrdp channel server for display 12 (pid 2206) exit code 0 and signal number 0
[20240328-16:23:40] [INFO ] cleanup_sockets:
[20240328-16:23:40] [DEBUG] cleanup_sockets: deleting /run/xrdp/sockdir/xrdp_chansrv_audio_out_socket_12
[20240328-16:23:40] [DEBUG] cleanup_sockets: deleting /run/xrdp/sockdir/xrdp_chansrv_audio_in_socket_12
[20240328-16:23:40] [DEBUG] cleanup_sockets: deleting /run/xrdp/sockdir/xrdpapi_12
[20240328-16:23:40] [DEBUG] receiving SIGCHLD
[20240328-16:23:40] [INFO ] Process 2145 has exited
[20240328-16:23:40] [INFO ] ++ terminated session:  username raspi, display :12.0, session_pid 2145, ip ::ffff:192.168.50.119:58472 - socket: 12

@matt335672
Copy link
Member

No, sadly none of that is useful, except to tell us that xrdp is trying to start the right desktop.

Your desktop environment is failing - there's no problem with sesman. It may be related to this error, but I don't know enough about how the rPI desktop works to be sure.

Failed to inhibit: Access denied

Am I correct in thinking that raspi is not in your sudo group and izi4me is? I'm not totally clear on that from the above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants