neutrinolabs / xrdp

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

Fail to connect after blue screen waiting from Windows 11 official client #2998

Closed Fisher-Wang closed 5 months ago

Fisher-Wang commented 5 months ago

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:

Compiled with OpenSSL 3.0.8 7 Feb 2023

Operating system & version

Ubuntu 23.04

Installation method

git clone & make install

Which backend do you use?

xorgxrdp

What desktop environment do you use?

GNOME

Environment xrdp running on

physical machine with RTX 3090

What's your client?

Microsoft official client

Area(s) with issue?

No response

Steps to reproduce

  1. Start Microsoft 'Remote Desktop Connection' on Win11 Pro 23H2
  2. Input the computer's ip address (fetched using 'ip address' on ubuntu), click 'Connect'
  3. Encounter a warning window and click 'Yes' image

✔️ Expected Behavior

get connected to remote desktop

❌ Actual Behavior

Client behavior

After waiting in blue screen for ~3 minutes, I got this error message

Weixin Image_20240313220049

xrdp log

[20240313-21:50:12] [INFO ] address [0.0.0.0] port [3389] mode 1
[20240313-21:50:12] [INFO ] listening to port 3389 on 0.0.0.0
[20240313-21:50:12] [INFO ] xrdp_listen_pp done
[20240313-21:50:14] [INFO ] starting xrdp with pid 5853
[20240313-21:50:14] [INFO ] address [0.0.0.0] port [3389] mode 1
[20240313-21:50:14] [INFO ] listening to port 3389 on 0.0.0.0
[20240313-21:50:14] [INFO ] xrdp_listen_pp done
[20240313-21:52:50] [INFO ] Socket 12: AF_INET connection received from 192.168.1.108 port 32313
[20240313-21:52:50] [INFO ] Using default X.509 certificate: /etc/xrdp/cert.pem
[20240313-21:52:50] [INFO ] Using default X.509 key file: /etc/xrdp/key.pem
[20240313-21:52:50] [INFO ] Security protocol: configured [SSL|RDP], requested [SSL|HYBRID|HYBRID_EX|RDP], selected [SSL]
[20240313-21:52:50] [ERROR] SSL_read: I/O error
[20240313-21:52:50] [ERROR] libxrdp_force_read: header read error
[20240313-21:52:50] [ERROR] Processing [ITU-T T.125] Connect-Initial failed
[20240313-21:52:50] [ERROR] [MCS Connection Sequence] receive connection request failed
[20240313-21:52:50] [ERROR] xrdp_sec_incoming: xrdp_mcs_incoming failed
[20240313-21:52:50] [ERROR] xrdp_rdp_incoming: xrdp_sec_incoming failed
[20240313-21:52:50] [ERROR] xrdp_process_main_loop: libxrdp_process_incoming failed
[20240313-21:52:50] [ERROR] xrdp_iso_send: trans_write_copy_s failed
[20240313-21:52:50] [ERROR] Sending [ITU T.125] DisconnectProviderUltimatum failed
[20240313-21:52:54] [INFO ] Socket 12: AF_INET connection received from 192.168.1.108 port 32315
[20240313-21:52:54] [INFO ] Using default X.509 certificate: /etc/xrdp/cert.pem
[20240313-21:52:54] [INFO ] Using default X.509 key file: /etc/xrdp/key.pem
[20240313-21:52:54] [INFO ] Security protocol: configured [SSL|RDP], requested [SSL|HYBRID|HYBRID_EX|RDP], selected [SSL]
[20240313-21:52:54] [INFO ] Connected client computer name: LAPTOP-469AJF4T
[20240313-21:52:54] [WARN ] Received [MS-RDPBCGR] TS_UD_HEADER type 0xc006 is unknown (ignored)
[20240313-21:52:54] [WARN ] Received [MS-RDPBCGR] TS_UD_HEADER type 0xc00a is unknown (ignored)
[20240313-21:52:54] [INFO ] xrdp_load_keyboard_layout: Keyboard information sent by the RDP client, keyboard_type:[0x04], keyboard_subtype:[0x00], keylayout:[0x00000804]
[20240313-21:52:54] [INFO ] xrdp_load_keyboard_layout: model [] variant [] layout [us] options []
[20240313-21:52:54] [INFO ] TLS connection established from 192.168.1.108 port 32315: TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384
[20240313-21:52:54] [INFO ] xrdp_caps_process_pointer: client supports new(color) cursor
[20240313-21:52:54] [INFO ] xrdp_process_offscreen_bmpcache: support level 1 cache size 10485760 MB cache entries 100
[20240313-21:52:54] [INFO ] xrdp_caps_process_codecs: nscodec, codec id 1, properties len 3
[20240313-21:52:54] [WARN ] xrdp_caps_process_codecs: unknown codec id 5
[20240313-21:52:54] [INFO ] xrdp_caps_process_codecs: RemoteFX, codec id 3, properties len 49
[20240313-21:52:54] [WARN ] Cannot find keymap file /etc/xrdp/km-00000804.ini
[20240313-21:52:54] [WARN ] Cannot find keymap file /etc/xrdp/km-00000804.ini
[20240313-21:52:54] [INFO ] Loading keymap file /etc/xrdp/km-00000409.ini
[20240313-21:52:54] [WARN ] local keymap file for 0x00000804 found and doesn't match built in keymap, using local keymap file
[20240313-21:52:59] [INFO ] connecting to sesman on 127.0.0.1:3350
[20240313-21:52:59] [INFO ] xrdp_wm_log_msg: sesman connect ok
[20240313-21:52:59] [INFO ] sesman connect ok
[20240313-21:52:59] [INFO ] sending login info to session manager. Please wait...
[20240313-21:52:59] [INFO ] xrdp_wm_log_msg: login successful for user fs on display 10
[20240313-21:52:59] [INFO ] login successful for user fs on display 10
[20240313-21:52:59] [INFO ] loaded module 'libxup.so' ok, interface size 10296, version 4
[20240313-21:52:59] [INFO ] started connecting
[20240313-21:52:59] [INFO ] lib_mod_connect: connecting via UNIX socket
[20240313-21:56:29] [INFO ] connection problem, giving up
[20240313-21:56:29] [INFO ] some problem
[20240313-21:56:29] [ERROR] xrdp_wm_log_msg: Error connecting to user session
[20240313-21:56:29] [INFO ] Error connecting to user session

Anything else?

No response

metalefty commented 5 months ago

As mentioned in issue form, could you add the log?

Links? References? Anything that will give us more context about the issue you are encountering! We recommend attaching xrdp.log, xrdp-sesman.log, xrdp/xorg.conf or screenshots to clarify context.

Fisher-Wang commented 5 months ago

Sure. xrdp.log is shown above, here is other logs

xrdp-sesman.log

[20240313-21:50:12] [INFO ] sesman_main_loop: sesman asked to terminate
[20240313-21:50:12] [INFO ] starting xrdp-sesman with pid 5851
[20240313-21:52:59] [INFO ] Socket 12: AF_INET connection received from 127.0.0.1 port 49740
[20240313-21:52:59] [INFO ] Terminal Server Users group is disabled, allowing authentication
[20240313-21:52:59] [INFO ] ++ created session (access granted): username fs, ip 192.168.1.108:32315 - socket: 12
[20240313-21:52:59] [INFO ] starting Xorg session...
[20240313-21:52:59] [INFO ] Starting session: session_pid 6232, display :10.0, width 2560, height 1600, bpp 24, client ip 192.168.1.108:32315 - socket: 12, user name fs
[20240313-21:52:59] [INFO ] [session start] (display 10): calling auth_start_session from pid 6232
[20240313-21:52:59] [ERROR] sesman_data_in: scp_process_msg failed
[20240313-21:52:59] [ERROR] sesman_main_loop: trans_check_wait_objs failed, removing trans
[20240313-21:52:59] [INFO ] Starting X server on display 10: Xorg :10 -auth .Xauthority -config xrdp/xorg.conf -noreset -nolisten tcp -logfile .xorgxrdp.%s.log  
[20240313-21:53:09] [WARN ] Timed out waiting for X server on display 10 to startup
[20240313-21:53:09] [INFO ] Session started successfully for user fs on display 10
[20240313-21:53:09] [INFO ] Starting the xrdp channel server for display 10
[20240313-21:53:09] [INFO ] Session in progress on display 10, waiting until the window manager (pid 6233) exits to end the session
[20240313-21:53:09] [WARN ] Timed out waiting for X server on display 10 to startup
[20240313-21:53:09] [ERROR] There is no X server active on display 10
[20240313-21:53:09] [ERROR] A fatal error has occurred attempting to start the window manager on display 10, aborting connection
[20240313-21:53:09] [WARN ] Window manager (pid 6233, display 10) exited quickly (0 secs). This could indicate a window manager config problem
[20240313-21:53:09] [INFO ] Calling auth_stop_session and auth_end from pid 6232
[20240313-21:53:09] [INFO ] Terminating X server (pid 6234) on display 10
[20240313-21:53:09] [INFO ] Terminating the xrdp channel server (pid 6247) on display 10
[20240313-21:53:09] [INFO ] X server on display 10 (pid 6234) returned exit code 1 and signal number 0
[20240313-21:53:09] [INFO ] xrdp channel server for display 10 (pid 6247) exit code 0 and signal number 0
[20240313-21:53:09] [INFO ] cleanup_sockets:
[20240313-21:53:09] [INFO ] Process 6232 has exited
[20240313-21:53:09] [INFO ] ++ terminated session:  username fs, display :10.0, session_pid 6232, ip 192.168.1.108:32315 - socket: 12

xrdp/xorg.conf

I find xrdp/xorg.conf at this path /etc/X11/xrdp/xorg.conf, and here is its content:

Section "ServerLayout"
    Identifier "X11 Server"
    Screen "Screen (xrdpdev)"
    InputDevice "xrdpMouse" "CorePointer"
    InputDevice "xrdpKeyboard" "CoreKeyboard"
EndSection

Section "ServerFlags"
    # This line prevents "ServerLayout" sections in xorg.conf.d files
    # overriding the "X11 Server" layout (xrdp #1784)
    Option "DefaultServerLayout" "X11 Server"
    Option "DontVTSwitch" "on"
    Option "AutoAddDevices" "off"
EndSection

Section "Module"
    Load "dbe"
    Load "ddc"
    Load "extmod"
    Load "glx"
    Load "int10"
    Load "record"
    Load "vbe"
    Load "glamoregl"
    Load "xorgxrdp"
    Load "fb"
EndSection

Section "InputDevice"
    Identifier "xrdpKeyboard"
    Driver "xrdpkeyb"
EndSection

Section "InputDevice"
    Identifier "xrdpMouse"
    Driver "xrdpmouse"
EndSection

Section "Monitor"
    Identifier "Monitor"
    Option "DPMS"
    HorizSync 30-80
    VertRefresh 60-75
    ModeLine "1920x1080" 138.500 1920 1968 2000 2080 1080 1083 1088 1111 +hsync -vsync
    ModeLine "1280x720" 74.25 1280 1720 1760 1980 720 725 730 750 +HSync +VSync
    Modeline "1368x768" 72.25 1368 1416 1448 1528 768 771 781 790 +hsync -vsync
    Modeline "1600x900" 119.00 1600 1696 1864 2128 900 901 904 932 -hsync +vsync
EndSection

Section "Device"
    Identifier "Video Card (xrdpdev)"
    Driver "xrdpdev"
    Option "DRMDevice" "/dev/dri/renderD128"
    Option "DRI3" "1"
EndSection

Section "Screen"
    Identifier "Screen (xrdpdev)"
    Device "Video Card (xrdpdev)"
    Monitor "Monitor"
    DefaultDepth 24
    SubSection "Display"
        Depth 24
        Modes "640x480" "800x600" "1024x768" "1280x720" "1280x1024" "1600x900" "1920x1080"
    EndSubSection
EndSection
Fisher-Wang commented 5 months ago

I follow this issue comment and replace param=Xorg with param=/usr/lib/xorg/Xorg in file /etc/xrdp/sesman.ini so that the X server start successfully.

Then I follow this issue comment to stay logged out at my physical machine, and I successfully connect to it from my Win11 MS Official Remote Desktop Connector.

Although there is a bit latency, the desktop looks odd and can't change configuration in settings, it still works amazing!