xrdp and Nvidia GPU

Hello everyone,
I'm stuck with xrdp (blue screen) while trying to connect to my server.
Actually, I have FreeBSD 13.1-RELEASE-p6

Slim/XFCE are configured and are working quite well.
Server has i9-13900K Intel, so I've been obliged to put a second GPU (Nvidia GeForce RTX 2060) because the Intel one is not recognized.
After investigation with pciconf -lv, configuration of Xorg was wade in order to use the NVIDIA GPU :

# /usr/local/etc/X11/xorg.conf.d/driver-nvidia.conf
Code:
Section "Device"
      Identifier  "Device0"
      Driver      "nvidia"
      VendorName  "NVIDIA Corporation
      BusID       "PCI:1:0:0
EndSection

Slim/XFCE are perfectly working. No problem with that. I've got several users that have xorking xfce sessions.

I installed xrdp in order to give them access remotely :
Code:
pkg ins -y xrdp
sysrc xrdp_enable=YES xrdp_sesman_enable=YES
cp /usr/local/etc/xrdp/startwm.sh /usr/home/marcel/

vi /usr/home/marcel/startwm.sh

#!/bin/sh
#
# This script is an example. Edit this to suit your needs.
# If ${HOME}/startwm.sh exists, xrdp-sesman will execute it instead of this.
#
#### set environment variables here if you want
export LANG=fr_FR.UTF-8

#### start desktop environment
# exec gnome-session
# exec mate-session
# exec start-lumina-desktop
# exec startkde
exec startxfce4
exec xterm
Code:
reboot

I let the port 3389.
I did the same install on 2 others servers, no problem at all. xrdp is working... But this time, I get blue screen after identification.
I suppose it's coming from this second GPU.

Here is the log for xrdp when I try to connect remotely :
(/var/log/xrdp.log)

Code:
[20230414-18:13:18] [INFO ] Socket 13: AF_INET6 connection received from ::ffff:192.168.1.1 port 50855
[20230414-18:13:18] [INFO ] Using default X.509 certificate: /usr/local/etc/xrdp/cert.pem
[20230414-18:13:18] [INFO ] Using default X.509 key file: /usr/local/etc/xrdp/key.pem
[20230414-18:13:18] [INFO ] Security protocol: configured [SSL|RDP], requested [SSL|RDP], selected [SSL]
[20230414-18:13:18] [INFO ] Connected client computer name: D-7720
[20230414-18:13:18] [INFO ] xrdp_load_keyboard_layout: Keyboard information sent by the RDP client, keyboard_type:[0x04], keyboard_subtype:[0x00], keylayout:[0x0000040C]
[20230414-18:13:18] [INFO ] xrdp_load_keyboard_layout: model [] variant [] layout [fr] options []
[20230414-18:13:18] [INFO ] TLS connection established from ::ffff:192.168.1.1 port 50855: TLSv1.3 with cipher TLS_AES_256_GCM_SHA384
[20230414-18:13:18] [INFO ] xrdp_caps_process_pointer: client supports new(color) cursor
[20230414-18:13:18] [WARN ] Received [MS-RDPBCGR] TS_CONFIRM_ACTIVE_PDU - TS_CAPS_SET capabilitySetType = 27 is unknown - Ignored
[20230414-18:13:18] [INFO ] Loading keymap file /usr/local/etc/xrdp/km-0000040c.ini
[20230414-18:13:18] [WARN ] local keymap file for 0x0000040c found and doesn't match built in keymap, using local keymap file
[20230414-18:13:18] [ERROR] Dynamic Virtual Channel version 1 is not supported
[20230414-18:13:18] [ERROR] xrdp_rdp_recv: xrdp_channel_process failed
[20230414-18:13:24] [INFO ] connecting to sesman on 127.0.0.1:3350
[20230414-18:13:24] [INFO ] xrdp_wm_log_msg: sesman connect ok
[20230414-18:13:24] [INFO ] sesman connect ok
[20230414-18:13:24] [INFO ] sending login info to session manager. Please wait...
[20230414-18:13:24] [INFO ] xrdp_wm_log_msg: login successful for user theophile on display 10
[20230414-18:13:24] [INFO ] login successful for user theophile on display 10
[20230414-18:13:24] [INFO ] loaded module 'libxup.so' ok, interface size 10296, version 4
[20230414-18:13:24] [INFO ] started connecting
[20230414-18:13:24] [INFO ] lib_mod_connect: connecting via UNIX socket

Now for xrdp-sesman :
(/var/log/xrdp-sesman.log)
Code:
[20230414-18:13:24] [INFO ] Socket 12: AF_INET6 connection received from ::1 port 60058
[20230414-18:13:24] [INFO ] Terminal Server Users group is disabled, allowing authentication
[20230414-18:13:24] [INFO ] ++ created session (access granted): username theophile, ip ::ffff:192.168.1.1:50855 - socket: 13
[20230414-18:13:24] [INFO ] starting Xorg session...
[20230414-18:13:24] [INFO ] Starting session: session_pid 2085, display :10.0, width 1024, height 768, bpp 24, client ip ::ffff:192.168.1.1:50855 - socket: 13, user name theophile
[20230414-18:13:24] [INFO ] [session start] (display 10): calling auth_start_session from pid 2085
[20230414-18:13:24] [ERROR] sesman_data_in: scp_process_msg failed
[20230414-18:13:24] [INFO ] PAM: Last login: Fri Apr 14 17:59:45 from box
[20230414-18:13:24] [ERROR] sesman_main_loop: trans_check_wait_objs failed, removing trans
[20230414-18:13:24] [INFO ] Starting X server on display 10: /usr/local/libexec/Xorg :10 -auth .Xauthority -config xrdp/xorg.conf -noreset -nolisten tcp 
[20230414-18:13:35] [WARN ] Timed out waiting for X server on display 10 to startup
[20230414-18:13:35] [INFO ] Session started successfully for user theophile on display 10
[20230414-18:13:35] [INFO ] Starting the xrdp channel server for display 10
[20230414-18:13:35] [INFO ] Session in progress on display 10, waiting until the window manager (pid 2087) exits to end the session
[20230414-18:13:35] [WARN ] Timed out waiting for X server on display 10 to startup
[20230414-18:13:35] [ERROR] There is no X server active on display 10
[20230414-18:13:35] [ERROR] A fatal error has occurred attempting to start the window manager on display 10, aborting connection
[20230414-18:13:35] [WARN ] Window manager (pid 2087, display 10) exited quickly (0 secs). This could indicate a window manager config problem
[20230414-18:13:35] [INFO ] Calling auth_stop_session and auth_end from pid 2086
[20230414-18:13:35] [INFO ] Terminating X server (pid 2088) on display 10
[20230414-18:13:35] [INFO ] Terminating the xrdp channel server (pid 2091) on display 10
[20230414-18:13:35] [INFO ] X server on display 10 (pid 2088) returned exit code 1 and signal number 0
[20230414-18:13:35] [INFO ] xrdp channel server for display 10 (pid 2091) exit code 0 and signal number 0
[20230414-18:13:35] [INFO ] cleanup_sockets:
[20230414-18:13:35] [INFO ] Process 2085 has exited
[20230414-18:13:35] [INFO ] ++ terminated session:  username theophile, display :10.0, session_pid 2085, ip ::ffff:192.168.1.1:50855 - socket: 13

I see the error of no X server active on display 10.
I know it's in /usr/local/etc/xrdp/sesman.ini that I can change this... But for what ?
What am I supposed to write ?
Is that the problem ?

If someone knows, I would really appreciate any help !

Thank you
 
If I wait a few minutes... I see new lines in log and error message in my blue blue screen.
(/var/log/xrdp.log) :
Code:
[20230414-18:16:56] [INFO ] connection problem, giving up
[20230414-18:16:56] [INFO ] some problem
[20230414-18:16:56] [ERROR] xrdp_wm_log_msg: Error connecting to user session
[20230414-18:16:56] [INFO ] Error connecting to user session

But I don't learn something very new I think :-D...
 

Attachments

  • Capture d’écran_2023-04-14_18-25-55.png
    Capture d’écran_2023-04-14_18-25-55.png
    10.7 KB · Views: 187
Ok. I finally found the solution, thanks to a archlinux member post :
https://bbs.archlinux.org/viewtopic.php?id=284854

In /etc/X11/xrdp/xorg.conf :

Code:
# [...]
#
Section "ServerFlags"

    # This line ...
    # overriding ...
    Option "DefaultServerLayout" "X11 Server"
    Option "DontVTSwitch" "on"
    Option "AutoAddDevices" "off"

    # Add next line :
    Option "AutoAddGPU" "off"

EndSection
#
# [...]
#
Section "Screen"
    Identifier "Screen (xrdpdev)"
    Device "Video Card (xrdpdev)"
    Monitor "Monitor"
    
    # Add next line. Leave "" empty (!) :
    GPUDevice ""
    
    DefaultDepth 24
    SubSection "Display"
        Depth 24
        Modes "640x480" "800x600" "1024x768" "1280x720" "1280x1024" "1600x900" "1920x1080"
        EndSubSection
EndSection
 
Back
Top