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

Connecting to the same session fails [VNC error - problem connecting] #2512

Closed
Saya47 opened this issue Jan 22, 2023 · 9 comments
Closed

Connecting to the same session fails [VNC error - problem connecting] #2512

Saya47 opened this issue Jan 22, 2023 · 9 comments

Comments

@Saya47
Copy link

Saya47 commented Jan 22, 2023

Hello! I hope you're having a great time.

I've added this small config to the bottom of /etc/xrdp/xrdp.ini:

[xrdp1]
name=mysession
lib=libvnc.so
username=ask
password=ask
ip=127.0.0.1
port=ask-1

I've logged in locally on my laptop but I want to connect remotely to it now, but it fails:
image

VNC error - problem connecting
some problem
Error connecting to the user session

cat /var/log/xrdp.log

[WARN ] Ignoring obsolete SCP port value '3350'
[INFO ] xrdp_wm_log_msg: sesman connect ok
[INFO ] xrdp_wm_log_msg: Performing login request for shayan
[INFO ] xrdp_wm_log_msg: login was successful - creating session
[INFO ] xrdp_wm_log_msg: session is available on display 14 for user shayan
[INFO ] xrdp_wm_log_msg: Connecting to session
[INFO ] loaded module 'libvnc.so' ok, interface size 4064, version 4
[ERROR] VNC error 1 after security negotiation
[ERROR] VNC error before sending share flag
[ERROR] VNC error before receiving server init
[ERROR] VNC error before receiving pixel format
[ERROR] VNC error before receiving name length
[ERROR] VNC error before receiving name
[ERROR] xrdp_wm_log_msg: Error connecting to user session

cat /var/log/xrdp-sesman.log

[WARN ] Timed out waiting for X server on display 14 to startup
[INFO ] Session started successfully for user shayan on display 14
[INFO ] Starting the xrdp channel server for display 14
[INFO ] Session in progress on display 14, waiting until the window manager (pid 500981) exits to end the session
[WARN ] Timed out waiting for X server on display 14 to startup
[ERROR] There is no X server active on display 14
[ERROR] A fatal error has occurred attempting to start the window manager on display 14, aborting connection
[WARN ] Window manager (pid 500981, display 14) exited quickly (0 secs). This could indicate a window manager config problem
[INFO ] Calling auth_stop_session from pid 500980
[INFO ] Terminating X server (pid 500982) on display 14
[INFO ] Terminating the xrdp channel server (pid 501016) on display 14
[INFO ] X server on display 14 (pid 500982) returned exit code 1 and signal number 0
[INFO ] xrdp channel server for display 14 (pid 501016) exit code 0 and signal number 0
[INFO ] cleanup_sockets:
[INFO ] Process 500980 has exited
[INFO ] Calling auth_end for pid 500980 from pid 500968
[INFO ] ++ terminated session: UID 1000 (shayan), display :14.0, session_pid 500980, ip 192.168.1.128
@matt335672
Copy link
Member

Doesn't look like the X server is starting. Look further up in the sesman.log for the messages generated when the X server is started.

@Saya47
Copy link
Author

Saya47 commented Jan 24, 2023

@matt335672 Hello! Thanks for replying.
Sorry about that, here's the full logs of today:

[INFO ] Socket 13: connection accepted from AF_UNIX
[INFO ] Received system login request from xrdp for user: shayan IP: 192.168.1.128
[INFO ] Terminal Server Users group is disabled, allowing authentication
[INFO ] Access permitted for user: shayan
[INFO ] Received request from xrdp to create a session for user shayan
[INFO ] ++ created session: username shayan, ip 192.168.1.128
[INFO ] Found X server running at /tmp/.X11-unix/X10
[INFO ] Found X server running at /tmp/.X11-unix/X11
[INFO ] Found X server running at /tmp/.X11-unix/X12
[INFO ] Found X server running at /tmp/.X11-unix/X13
[INFO ] Starting session: session_pid 634507, display :14.0, width 1920, height 1080, bpp 32, client ip 192.168.1.128, UID 1000
[INFO ] [session start] (display 14): calling auth_start_session from pid 634507
[INFO ] Starting X server on display 14: Xvnc :14 -auth .Xauthority -geometry 1920x1080 -depth 32 -rfbauth /home/shayan/.vnc/sesman_passwd-shayan@debian:14 -bs -nolisten tcp -localhost -dpi 96
[ERROR] Error calling exec (executable: Xvnc, arguments: Xvnc :14 -auth .Xauthority -geometry 1920x1080 -depth 32 -rfbauth /home/shayan/.vnc/sesman_passwd-shayan@debian:14 -bs -nolisten tcp -localhost -dpi 96) returned errno: 2, description: No such file or directory
[ERROR] Error starting X server on display 14
[ERROR] A fatal error has occurred attempting to start the X server on display 14, aborting connection
[WARN ] Timed out waiting for X server on display 14 to startup
[INFO ] Session started successfully for user shayan on display 14
[INFO ] Starting the xrdp channel server for display 14
[INFO ] Session in progress on display 14, waiting until the window manager (pid 634508) exits to end the session
[WARN ] Timed out waiting for X server on display 14 to startup
[ERROR] There is no X server active on display 14
[ERROR] A fatal error has occurred attempting to start the window manager on display 14, aborting connection
[WARN ] Window manager (pid 634508, display 14) exited quickly (0 secs). This could indicate a window manager config problem
[INFO ] Calling auth_stop_session from pid 634507
[INFO ] Terminating X server (pid 634509) on display 14
[INFO ] Terminating the xrdp channel server (pid 634570) on display 14
[INFO ] X server on display 14 (pid 634509) returned exit code 1 and signal number 0
[INFO ] xrdp channel server for display 14 (pid 634570) exit code 0 and signal number 0
[INFO ] cleanup_sockets:
[INFO ] Process 634507 has exited
[INFO ] Calling auth_end for pid 634507 from pid 500968
[INFO ] ++ terminated session: UID 1000 (shayan), display :14.0, session_pid 634507, ip 192.168.1.128

@matt335672
Copy link
Member

Looks like you don't have Xvnc installed.

You don't say what you platform is. On Debian/Ubuntu/Kali etc, etc use sudo apt install tigervnc-standalone-server. For other platforms, you'll need to do something different.

@Saya47
Copy link
Author

Saya47 commented Jan 24, 2023

@matt335672 Are you sure? I'm on Debian Bullseye (Debian 11.6.0) and:
Linux debian 5.10.0-20-amd64 #1 SMP Debian 5.10.158-2 (2022-12-13) x86_64 GNU/Linux
Uhm, the XRDP works fine when my user is not logged in locally. I just want to be able to connect remotely while the same user is logged in locally, so I don't have to log out the user each time I want to connect via XRDP.
Thank you!

@Saya47
Copy link
Author

Saya47 commented Jan 24, 2023

I installed tigervnc-standalone-server but now it just goes back to this error:
image

@Saya47
Copy link
Author

Saya47 commented Jan 24, 2023

And the logs now say this:
sesman:

[INFO ] Socket 13: connection accepted from AF_UNIX
[INFO ] Received system login request from xrdp for user: shayan IP: 192.168.1.128
[INFO ] Terminal Server Users group is disabled, allowing authentication
[INFO ] Access permitted for user: shayan
[INFO ] Received request from xrdp to create a session for user shayan
[INFO ] ++ reconnected session: username shayan, display :14.0, session_pid 643797, ip 192.168.1.128
[INFO ] Starting session reconnection script on display 14: /etc/xrdp/reconnectwm.sh
[INFO ] Process 655698 has exited

xrdp:

[INFO ] Socket 12: connection accepted from 192.168.1.128:10405
[INFO ] Using default X.509 certificate: /etc/xrdp/cert.pem
[INFO ] Using default X.509 key file: /etc/xrdp/key.pem
[INFO ] Security protocol: configured [SSL|RDP], requested [SSL|HYBRID|HYBRID_EX|RDP], selected [SSL]
[ERROR] SSL_read: I/O error
[ERROR] libxrdp_force_read: header read error
[ERROR] Processing [ITU-T T.125] Connect-Initial failed
[ERROR] [MCS Connection Sequence] receive connection request failed
[ERROR] xrdp_sec_incoming: xrdp_mcs_incoming failed
[ERROR] xrdp_rdp_incoming: xrdp_sec_incoming failed
[ERROR] xrdp_process_main_loop: libxrdp_process_incoming failed
[ERROR] xrdp_iso_send: trans_write_copy_s failed
[ERROR] Sending [ITU T.125] DisconnectProviderUltimatum failed
[INFO ] Socket 12: connection accepted from 192.168.1.128:10406
[INFO ] Using default X.509 certificate: /etc/xrdp/cert.pem
[INFO ] Using default X.509 key file: /etc/xrdp/key.pem
[INFO ] Security protocol: configured [SSL|RDP], requested [SSL|HYBRID|HYBRID_EX|RDP], selected [SSL]
[INFO ] Connected client computer name: DESKTOP-SCRPN
[WARN ] Received [MS-RDPBCGR] TS_UD_HEADER type 0xc006 is unknown (ignored)
[WARN ] Received [MS-RDPBCGR] TS_UD_HEADER type 0xc00a is unknown (ignored)
[INFO ] xrdp_load_keyboard_layout: Keyboard information sent by the RDP client, keyboard_type:[0x07], keyboard_subtype:[0x00], keylayout:[0x00000409]
[INFO ] xrdp_load_keyboard_layout: model [] variant [] layout [us] options []
[INFO ] TLS connection established from 192.168.1.128:10406 TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384
[INFO ] xrdp_caps_process_pointer: client supports new(color) cursor
[INFO ] xrdp_process_offscreen_bmpcache: support level 1 cache size 10485760 MB cache entries 100
[INFO ] xrdp_caps_process_codecs: NSCodec(CA8D1BB9-000F-154F-589F-AE2D1A87E2D6), codec id [1], properties len [3]
[WARN ] xrdp_caps_process_codecs: unknown(2744CCD4-9D8A-4E74-803C-0ECBEEA19C54), codec id [5], properties len [49]
[INFO ] xrdp_caps_process_codecs: RemoteFX(76772F12-BD72-4463-AFB3-B73C9C6F7886), codec id [3], properties len [49]
[INFO ] Loading keymap file /etc/xrdp/km-00000409.ini
[WARN ] local keymap file for 0x00000409 found and doesn't match built in keymap, using local keymap file
[INFO ] Login screen monitor height is 1080 pixels over 194 mm (141 DPI)
[WARN ] Ignoring obsolete SCP port value '3350'
[INFO ] xrdp_wm_log_msg: sesman connect ok
[INFO ] xrdp_wm_log_msg: Performing login request for shayan
[INFO ] xrdp_wm_log_msg: login was successful - creating session
[INFO ] xrdp_wm_log_msg: session is available on display 14 for user shayan
[INFO ] xrdp_wm_log_msg: Connecting to session
[INFO ] loaded module 'libvnc.so' ok, interface size 4064, version 4
[INFO ] VNC: Clipboard (if available) is provided by chansrv facility
[INFO ] xrdp_wm_log_msg: Connecting to chansrv
[INFO ] Layout from OldLayout (geom=1920x1080 #screens=1) : 1804289383:(1920x1080+0+0)
[ERROR] xrdp_sec_recv: xrdp_mcs_recv failed
[ERROR] xrdp_rdp_recv: xrdp_sec_recv failed
[ERROR] libxrdp_process_data: xrdp_rdp_recv failed
[ERROR] xrdp_process_data_in: xrdp_process_loop failed
[ERROR] SSL_write: I/O error
[ERROR] xrdp_iso_send: trans_write_copy_s failed
[ERROR] Sending [ITU T.125] DisconnectProviderUltimatum failed

@matt335672
Copy link
Member

@Saya47 - that isn't supported on systemd-based systems - see the FAQ. If you absolutely need that functionality, you'll need to move to Devuan.

The limitation is imposed by systemd. There's some discussion around possible workarounds in #2491 but nothing concrete yet.

@matt335672
Copy link
Member

I've just updated the FAQ to reference #2491.

@Saya47
Copy link
Author

Saya47 commented Jan 25, 2023

Thanks very much @matt335672
So basically RDP on Windows enforces single session per user as well, I was hoping to get better treatment on Linux! But systemd comes to fail us once again! oh well.

@Saya47 Saya47 closed this as completed Jan 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants