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

Copy/paste is not working on XRDP #1188

Open
Abinayasandhiya opened this issue Aug 7, 2018 · 63 comments
Open

Copy/paste is not working on XRDP #1188

Abinayasandhiya opened this issue Aug 7, 2018 · 63 comments
Labels
clipboard question or troubleshoot question or trouble shoot, not confirmed as xrdp bug or issue yet

Comments

@Abinayasandhiya
Copy link

Abinayasandhiya commented Aug 7, 2018

Hi,

We are using XRDP to connect our RedHat6 and RedHat7 machine.
Sometimes we could face sudden issue in XRDP that copy/paste is not working form window to XRDP server.
Please find below server and XRDP details:


[root@GUI ~]$ cat /etc/redhat-release
Red Hat Enterprise Linux Server release 7.4 (Maipo)

[root@GUI ~]$ rpm -qa | grep xrdp
xorgxrdp-0.2.5-3.el7.x86_64
xrdp-debuginfo-0.9.5-1.el7.x86_64
xrdp-devel-0.9.5-1.el7.x86_64
xrdp-0.9.5-2.el7.x86_64


Anyone please help me to fix this issue.

Regards,
Abinaya

@Abinayasandhiya
Copy link
Author

Can anyone help me on this.

@rkantos
Copy link
Contributor

rkantos commented Aug 23, 2018

I think I also have experienced this lately on Ubuntu 18.04 (Xrdp version 0.9.5)

I't seems it usually occurs when a session goes in to the "locked" screen or a screensaver. When I reconnect with the desktop session not yet timed out, clipboard works normally. Is this something that could be fixed in xrdp ? Maybe Windows rdp client limitation?

Edit: The problem also occurs when connected to a xrdp session and the desktop timeouts to a screensaver... I'm beginning to think there is something that can be changed easily to fix this.

@Abinayasandhiya
Copy link
Author

Hi,

Can we get any help here.

@metalefty metalefty added the question or troubleshoot question or trouble shoot, not confirmed as xrdp bug or issue yet label Aug 29, 2018
@GGGunrunner
Copy link

Having the same issue.... I have xrdp on Raspberry Raspbian and connect to it from Windows (default mstsc client).

Pasting works from Windows to Pi, but not backwards...

@rkantos
Copy link
Contributor

rkantos commented Aug 31, 2018

Having the same issue.... I have xrdp on Raspberry Raspbian and connect to it from Windows (default mstsc client).

Pasting works from Windows to Pi, but not backwards...

Please attach at least your version information. I have had copy-paste working both ways with XRDP for at least since the last major issues was fixed. Now there just seems to be something happening with either the Windows client or XRDP that disables copy-paste one way or both ways when the connection has gone in to (sleep?) mode..

@godmuzguit7
Copy link

@rkantos I have the same issue as you described, but in Centos 7.

As soon as the lock screen comes up, it is not possible to copy/paste between Windows 7 and my Centos desktop without first reconnecting via RDP.

Have you already found something?

Thanks,

@Abinayasandhiya
Copy link
Author

Hello,

We could see latest version of XRDP in https://github.com/neutrinolabs/xrdp/releases page.
On Bug fixes i could see the latest version fix COPY SLOW issue.

we are having COPY/PASTE issue (XRDP version is 0.9.6) from windows to RDP server and still issue is persist.

Can you confirm if we use this latest version of XRDP did it resolve COPY/PASTE issue.

Please provide some details here also this ticket seems opened like last 15 days.

@godmuzguit7
Copy link

Hello, the issue is not resolved for the moment, even with the new version.

The issue is still there when the session is locked, the clipboard doesn't work. We have to reconnect in order to be able to paste data in the password field.

Thanks for your help,

@rkantos
Copy link
Contributor

rkantos commented Sep 27, 2018

Could we get a new title for this? Someone can probably come up with a more accurate one, but it seems the issue occurs after xrdp has gone idle. Thus I suggest “Copy paste not working after session has been idle or resumed”. Anyobody got an idea for debugging?

Hello, the issue is not resolved for the moment, even with the new version.

The issue is still there when the session is locked, the clipboard doesn’t work. We have to reconnect in order to be able to paste data in the password field.

Thanks for your help,

Why would you expect anything different? The isue still open, and thus unresolved...

@godmuzguit7
Copy link

Can you confirm if we use this latest version of XRDP did it resolve COPY/PASTE issue.

I expected the new version to possibly resolve the issue, but it's not the case.

I would expect something different because nobody answered to @Abinayasandhiya about the new version.

Thanks,

@Abinayasandhiya
Copy link
Author

Is there any possible way to fix this copy/paste issue between Linux RDP server and windows.

This is absolutely important issue which is need to be fix earlier, otherwise xrdp almost not usable.

@Abinayasandhiya
Copy link
Author

Hello All,

Finally copy/paste issue has been fixed when try to access our XRDP server using updated RDP client.

Update RDP client will have option like "Detect connection quality automatically" which will detect automatic quality for our connection.

Now my RDP client is updated to version 6.3.9600.16415.
with new client version the copy/paste issue did not more occur.

@Abinayasandhiya
Copy link
Author

For more details:

image

This resolved our users issues.

@Abinayasandhiya
Copy link
Author

Sad:) Issue is solved in Win7 but the same issue on Win10.

@yxs
Copy link

yxs commented Feb 25, 2019

In my case, Windows10 to CentOS7.6, the clipboard is working only when connected in Xorg mode.

[root@localhost ~]# rpm -qa | grep xrdp
xrdp-0.9.9-1.el7.x86_64
xorgxrdp-0.2.9-1.el7.x86_64
xrdp-selinux-0.9.9-1.el7.x86_64

@cmosguy
Copy link

cmosguy commented Apr 7, 2019

Same issue here with windows 10 and xrdp 0.9.9

@nobias
Copy link

nobias commented Apr 1, 2020

I still consistently have this issue when connecting from the Microsoft Remote Desktop app (10.3.8 (1747)) on MacOS 10.15.4 to xorg on Ubuntu 19.04 LTS (xrdp 0.9.9-1, xorgxrdp 1:0.2.9-1): Clipboards on client and server simply do not get synced at all. All my software versions are pretty up-to-date. If I could get some hints on how to debug this I would be happy to provide more specific info.

@k1moradi
Copy link

k1moradi commented Apr 2, 2020

same issue here.
server: ubuntu 18.04 fully updated,
xrdp: 0.9.5-2
client: win 10
session: kde via xorgxrdp

@alejandromunozes
Copy link

alejandromunozes commented Apr 30, 2020

I have the same issue on Linux:

My server: Raspbian

$ apt show xrdp
Package: xrdp
Version: 0.9.9-1

My client: Debian

$ apt show krdc
Package: krdc
Version: 4:18.04.1-1+b1
Priority: optional
Section: net
Source: krdc (4:18.04.1-1)

@Z0pyrus
Copy link

Z0pyrus commented Apr 14, 2021

Same issue here

@JohnnySaibot
Copy link

Same issue
Снимок экрана 2021-04-23 в 17 39 21

@HACKE-RC
Copy link

HACKE-RC commented May 5, 2021

so this issue is not fixed from two years lol

@seltsa
Copy link

seltsa commented Jun 28, 2021

Still hit this env = [Win 10 => XRDP 0.9.14]

@AbinayaSandhiyaM
Copy link

Hi,

After two year again same issue

Any help would be appreciate!!!

@matt335672
Copy link
Member

@AbinayaSandhiyaM

I've just tried to reproduce this based on the information in the thread above, and I've failed to do so. I've used CentOS 8 with GNOME, xrdp 0.9.16 from RPM and the Windows 10 mstsc.exe client. Cut-and-paste for text works both ways. I can lock the screen and then unlock it and cut-and-paste still works. If I wait for the screen lock to start automatically, everything still seems OK.

Are you able to reproduce this? If so, please post:-

  • RDP client + OS
  • output of xrdp -v
  • server OS and desktop
  • method to reproduce the problem.

@matt335672
Copy link
Member

OK - thanks.

Are the workarounds I've suggested any good for you for now?

@matt335672
Copy link
Member

Re-opening this, as a robust fix is still some way away.

@matt335672 matt335672 reopened this Sep 9, 2021
@ThoSap
Copy link

ThoSap commented Sep 9, 2021

@matt335672 the screen blanking workarounds you've suggested (tried several different guides from the internet) did not fix the issue.

@matt335672
Copy link
Member

Here's something else you could try.

You can use the TCP keepalive function to prune TCP connections that have dropped out.

First, enable tcp_keepalive in /etc/xrdp/xrdp.ini

This will probe for dead connections when the connections have been dead a couple of hours. That's probably too long to wait, so you can change some values like this. These are GLOBAL, so this will affect all TCP connections to the machine with keepalive enabled:-

echo 300 | sudo tee /proc/sys/net/ipv4/tcp_keepalive_time  ;# Set keepalive timer to 5 minutes
echo 10 | sudo tee /proc/sys/net/ipv4/tcp_keepalive_intvl ;# 10 seconds between probes
echo 3 | sudo tee /proc/sys/net/ipv4/tcp_keepalive_probes   ;# 3 probes max

That way, after 5 minutes and 30 seconds the old connection will be killed and you should be able to reconnect.

More info in tcp(7) and the Linux TCP keepalive HOWTO

If that works for you, we can look at getting these values configurable in xrdp.ini. It's a bit of a band-aid, but I think there's a requirement for it at the moment.

@aquablast
Copy link

aquablast commented Sep 17, 2021

It may be useful: Check that /var/log/xrdp.log contains the row:

[ERROR] Cannot read private key file /etc/xrdp/key.pem: Permission denied

In my cause, errors like this:

[ERROR] xrdp_mm_connect_chansrv: connect failed trying again...
[DEBUG] Closed socket 18 (AF_UNIX)
[ERROR] xrdp_mm_connect_chansrv: connect failed trying again...
[DEBUG] Closed socket 18 (AF_UNIX)
[ERROR] xrdp_mm_connect_chansrv: connect failed trying again...
[DEBUG] Closed socket 18 (AF_UNIX)
[ERROR] xrdp_mm_connect_chansrv: connect failed trying again...
[ERROR] xrdp_mm_connect_chansrv: error in trans_connect chan
[DEBUG] Closed socket 16 (AF_INET6 ::1 port 43264)

ended when i fixed permissions for user xrdp by granting the private key file read rights as root (or with sudo grants):

adduser xrdp ssl-cert

@matt335672
Copy link
Member

Thanks for the contribution @aquablast.

I don't think the certificate permission is relevant. On Debian/Ubuntu however, it's important that the xrdp user can access the chansrv sockets directory. On an 18.04 system I get this:-

ls -ld /var/run/xrdp/sockdir/
drwxrwsrwt 2 xrdp xrdp 40 Sep 18 17:11 /var/run/xrdp/sockdir/

@Suitear
Copy link

Suitear commented Sep 21, 2021

my remote host is ubuntu 20.04, client is win10. I can't use the clipborad to copy & pasted on either side.
I have enable the option in xrdp.ini
cliprdr=true
and some info in the log file in xrdp-chansrv.13.log

[20210514-14:42:10] [ERROR] X error BadWindow (invalid Window parameter) opcodes 25/0 resource 0x22095b3

[20210514-14:42:10] [ERROR] X error BadWindow (invalid Window parameter) opcodes 18/0 resource 0x22095b3
[20210514-14:42:10] [ERROR] X error BadWindow (invalid Window parameter) opcodes 25/0 resource 0x22095b3
[20210514-14:42:13] [ERROR] clipboard_event_selection_request: unknown target text/plain;charset=utf-8
[20210514-14:42:15] [ERROR] clipboard_event_selection_request: unknown target COMPOUND_TEXT
[20210514-14:42:16] [ERROR] clipboard_event_selection_request: unknown target text/plain;charset=utf-8
[20210514-14:42:26] [ERROR] clipboard_event_selection_request: unknown target COMPOUND_TEXT
[20210514-14:42:26] [ERROR] clipboard_event_selection_request: unknown target COMPOUND_TEXT
[20210514-14:42:26] [ERROR] clipboard_event_selection_request: unknown target COMPOUND_TEXT
[20210514-14:42:26] [ERROR] clipboard_event_selection_request: unknown target COMPOUND_TEXT
[20210514-14:42:27] [ERROR] clipboard_event_selection_request: unknown target COMPOUND_TEXT
[20210514-14:42:28] [ERROR] clipboard_event_selection_request: unknown target COMPOUND_TEXT
[20210514-14:42:28] [ERROR] clipboard_event_selection_request: unknown target COMPOUND_TEXT
[20210514-14:42:28] [ERROR] X error BadWindow (invalid Window parameter) opcodes 18/0 resource 0x2209e9f
[20210514-14:42:28] [ERROR] X error BadWindow (invalid Window parameter) opcodes 25/0 resource 0x2209e9f

[20210916-09:14:28] [CORE ] main: app started pid 17268(0x00004374)
[20210916-09:14:28] [INFO ] main: DISPLAY env var set to :10.0
[20210916-09:14:28] [INFO ] main: using DISPLAY 10
[20210916-09:14:28] [INFO ] channel_thread_loop: thread start
[20210916-09:14:28] [INFO ] Socket 12: AF_UNIX connection received
[20210916-09:48:24] [INFO ] channel_thread_loop: trans_check_wait_objs error resetting

the process info :

root 1131 1 0 9月16 ? 00:00:00 /usr/sbin/xrdp-sesman
xrdp 1158 1 0 9月16 ? 00:00:00 /usr/sbin/xrdp
root 17249 1131 0 9月16 ? 00:00:00 /usr/sbin/xrdp-sesman
azureuser 17254 17249 0 9月16 ? 00:00:00 /bin/bash /etc/xrdp/startwm.sh
azuresuer 17255 17249 10 9月16 ? 13:07:47 /usr/lib/xorg/Xorg :10 -auth .Xauthority -config xrdp/xorg.conf -noreset -nolisten tcp -logfile .xorgxrdp.%s.log
azureuser 17268 17249 0 9月16 ? 00:00:00 [xrdp-chansrv]
xrdp 876299 1158 1 13:00 ? 00:00:14 /usr/sbin/xrdp

Please help me out. It haunted me for months.

@matt335672
Copy link
Member

@moerfutin - it looks very much like you've got the same problem as everyone else.

Can you try the actions in this post and see if it helps?

@Suitear
Copy link

Suitear commented Sep 21, 2021

@moerfutin - it looks very much like you've got the same problem as everyone else.

Can you try the actions in this post and see if it helps?

Thanks, but I don't think it's gonna help...
the current values on my host are as follows:

cat /proc/sys/net/ipv4/tcp_keepalive_time
7200
cat /proc/sys/net/ipv4/tcp_keepalive_intvl
75
cat /proc/sys/net/ipv4/tcp_keepalive_probes
9

And on my another Debian host, I installed the xrdp in default way, and its clipborad is normal. Sames values as above. So I don't think it's TCP issue...

@matt335672
Copy link
Member

The problem above is caused by a client going away without sending a TCP FIN. This can happen either because the client hibernates, or because a firewall either drops the connection with no traffic, or is simply restarted and loses state information. So it's not necessarily anything to do with how the host is configured, but rather how the individual elements of the whole system (i.e. client(s), network, server and user(s)) are interacting.

Another way to see whether you're affected by this is to look in the socksdir for your system (/var/run/xrdp/sockdir for Debian/Ubuntu) and see if the chansrv process for your display is listening for new connections.

On a Ubuntu VM I've got here, I have the following for a session on DISPLAY=:10 where chansrv is connected and everything is working:-

$ ls -l /var/run/xrdp/sockdir/
total 0
srw-rw---- 1 testuser xrdp 0 Sep 22 10:27 xrdpapi_10
srw-rw---- 1 testuser xrdp 0 Sep 22 10:27 xrdp_chansrv_audio_in_socket_10
srw-rw---- 1 testuser xrdp 0 Sep 22 10:27 xrdp_chansrv_audio_out_socket_10
srwxr-xr-x 1 testuser xrdp 0 Sep 22 10:27 xrdp_disconnect_display_10
srw-rw---- 1 testuser xrdp 0 Sep 22 10:27 xrdp_display_10

When chansrv is disconnected, I get the following:-

$ ls -l /var/run/xrdp/sockdir/
total 0
srw-rw---- 1 testuser xrdp 0 Sep 22 10:27 xrdpapi_10
srw-rw---- 1 testuser xrdp 0 Sep 22 10:29 xrdp_chansrv_socket_10
srwxr-xr-x 1 testuser xrdp 0 Sep 22 10:27 xrdp_disconnect_display_10
srw-rw---- 1 testuser xrdp 0 Sep 22 10:27 xrdp_display_10

The important line above is /var/run/xrdp/sockdir/xrdp_chansrv_socket_10. This only appears when chansrv is started on a display (:10 in this instance), but isn't connected to xrdp. When a session is fully connected this file disappears.

You can use the presence of this file to tell you whether your problem is the same as the issue being discussed here, or not.

@Suitear
Copy link

Suitear commented Sep 24, 2021

Thanks, I think I found my own solution. It seemed there is not the necessary folder in my home directory.

So I manually mkdir this folder thinclient_drives and its subfolder .clipboard , and restart xrdp service, then it works like a charm.
their permission details as follows.

azureuser@Host-Ubuntu:~/thinclient_drives/.clipboard$ ls -alsh
4.0K drwxr-xr-x 2 azureuser azureuser 4.0K Sep 24 11:07 .
4.0K drwxr-xr-x 3 root root 4.0K Sep 24 11:07 ..

Now the output of sudo systemctl status xrdp is as follows.

Sep 24 14:13:55 Host-Ubuntu xrdp[1578]: (1578)(1346981)[DEBUG] xrdp_wm_log_msg: connecting to sesman ip 127.0.0.1 port 6741
Sep 24 14:13:55 Host-Ubuntu xrdp[1578]: (1578)(1346981)[INFO ] xrdp_wm_log_msg: sesman connect ok
Sep 24 14:13:55 Host-Ubuntu xrdp[1578]: (1578)(1346981)[DEBUG] xrdp_wm_log_msg: sending login info to session manager, please wait...
Sep 24 14:13:55 Host-Ubuntu xrdp[1578]: (1578)(1346981)[DEBUG] return value from xrdp_mm_connect 0
Sep 24 14:13:55 Host-Ubuntu xrdp[1578]: (1578)(1346981)[INFO ] xrdp_wm_log_msg: login successful for display 10
Sep 24 14:13:55 Host-Ubuntu xrdp[1578]: (1578)(1346981)[DEBUG] xrdp_wm_log_msg: started connecting
Sep 24 14:13:55 Host-Ubuntu xrdp[1578]: (1578)(1346981)[INFO ] lib_mod_log_peer: xrdp_pid=1578 connected to X11rdp_pid=1346981 X11rdp_ui>
Sep 24 14:13:55 Host-Ubuntu xrdp[1578]: (1578)(1346981)[DEBUG] xrdp_wm_log_msg: connected ok
Sep 24 14:13:56 Host-Ubuntu xrdp[1578]: (1578)(1346981)[DEBUG] xrdp_mm_connect_chansrv: chansrv connect successful
Sep 24 14:13:56 Host-Ubuntu xrdp[1578]: (1578)(1346981)[DEBUG] Closed socket 18 (AF_INET6 ::1 port 41186)

@matt335672
Copy link
Member

Great - glad you got it working.

@lonbluster
Copy link

still? using mremoteng client

@matt335672
Copy link
Member

@lonbluster - if you're referring to the problem discussed above where a FIN has been lost for some reason and a reconnect is not successful, then it's still not fixed. You'll need to use the keepalive workarounds for it.

@shootlazer
Copy link

shootlazer commented Feb 16, 2023

Here's something else you could try.

You can use the TCP keepalive function to prune TCP connections that have dropped out.

First, enable tcp_keepalive in /etc/xrdp/xrdp.ini

This will probe for dead connections when the connections have been dead a couple of hours. That's probably too long to wait, so you can change some values like this. These are GLOBAL, so this will affect all TCP connections to the machine with keepalive enabled:-

echo 300 | sudo tee /proc/sys/net/ipv4/tcp_keepalive_time  ;# Set keepalive timer to 5 minutes
echo 10 | sudo tee /proc/sys/net/ipv4/tcp_keepalive_intvl ;# 10 seconds between probes
echo 3 | sudo tee /proc/sys/net/ipv4/tcp_keepalive_probes   ;# 3 probes max

That way, after 5 minutes and 30 seconds the old connection will be killed and you should be able to reconnect.

More info in tcp(7) and the Linux TCP keepalive HOWTO

If that works for you, we can look at getting these values configurable in xrdp.ini. It's a bit of a band-aid, but I think there's a requirement for it at the moment.

Been struggling for a while with this (same symptoms. 20s delay when the session is resumed, clipboard not working, plus log file looks like that except it also has "[ERROR] clipboard_event_selection_request: unknown target text/plain;charset=utf-8" on it) and xrdp.log looks the same as well.

Tried adding those settings from terminal. Also tried adding them to /etc/sysctl.conf
tcp_keepalive was already set to true.

Unfortunately, the issue keeps happening. The only thing I can do is setting KillDisconnected to true on sesman.ini, but that, of course, closes the session completely which is something I don't want at all.

To test it, I'm killing the process of the RDP software I'm using on my main machine (MobaXterm), waiting 6min and then trying to reconnect again. But even when hitting "disconnect" it still happens.

Any clues?

Logs here

Chansrv log

[20230216-07:45:31] [CORE ] main: app started pid 2050(0x00000802)
[20230216-07:45:31] [INFO ] main: DISPLAY env var set to :11.0
[20230216-07:45:31] [INFO ] main: using DISPLAY 11
[20230216-07:45:31] [INFO ] channel_thread_loop: thread start
[20230216-07:45:31] [INFO ] Socket 12: AF_UNIX connection received
[20230216-07:45:40] [ERROR] clipboard_event_selection_request: unknown target text/plain;charset=utf-8
[20230216-07:45:41] [INFO ] channel_thread_loop: trans_check_wait_objs error resetting

Xrdp.log

[20230216-07:45:53] [INFO ] connected client computer name: myname
[20230216-07:45:53] [INFO ] adding channel item name rdpdr chan_id 1004 flags 0x80800000
[20230216-07:45:53] [INFO ] adding channel item name rdpsnd chan_id 1005 flags 0xc0000000
[20230216-07:45:53] [INFO ] adding channel item name cliprdr chan_id 1006 flags 0xc0a00000
[20230216-07:45:53] [INFO ] adding channel item name drdynvc chan_id 1007 flags 0xc0800000
[20230216-07:45:53] [INFO ] TLS connection established from ::ffff:...*** port 61226: TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384
[20230216-07:45:53] [DEBUG] xrdp_00000894_wm_login_mode_event_00000001
[20230216-07:45:53] [INFO ] Loading keymap file /etc/xrdp/km-0000040a.ini
[20230216-07:45:53] [WARN ] local keymap file for 0x0000040a found and doesn't match built in keymap, using local keymap file
[20230216-07:45:53] [DEBUG] xrdp_wm_log_msg: connecting to sesman ip 127.0.0.1 port 3350
[20230216-07:45:53] [INFO ] xrdp_wm_log_msg: sesman connect ok
[20230216-07:45:53] [DEBUG] xrdp_wm_log_msg: sending login info to session manager, please wait...
[20230216-07:45:53] [DEBUG] return value from xrdp_mm_connect 0
[20230216-07:45:53] [INFO ] xrdp_wm_log_msg: login successful for display 11
[20230216-07:45:53] [DEBUG] xrdp_wm_log_msg: started connecting
[20230216-07:45:53] [INFO ] lib_mod_log_peer: xrdp_pid=2196 connected to X11rdp_pid=2037 X11rdp_uid=1000 X11rdp_gid=1000 client_ip=::ffff:...*** client_port=61226
[20230216-07:45:53] [DEBUG] xrdp_wm_log_msg: connected ok
[20230216-07:45:57] [ERROR] xrdp_mm_connect_chansrv: connect failed trying again...
[20230216-07:45:57] [DEBUG] Closed socket 20 (AF_UNIX)
[20230216-07:46:01] [ERROR] xrdp_mm_connect_chansrv: connect failed trying again...
[20230216-07:46:01] [DEBUG] Closed socket 20 (AF_UNIX)
[20230216-07:46:05] [INFO ] Socket 12: AF_INET6 connection received from ::ffff:...* port 54413
[20230216-07:46:05] [DEBUG] Closed socket 12 (AF_INET6 ::ffff:...* port 3389)
[20230216-07:46:05] [DEBUG] Closed socket 11 (AF_INET6 :: port 3389)
[20230216-07:46:05] [INFO ] Using default X.509 certificate: /etc/xrdp/cert.pem
[20230216-07:46:05] [INFO ] Using default X.509 key file: /etc/xrdp/key.pem
[20230216-07:46:05] [DEBUG] TLSv1.3 enabled
[20230216-07:46:05] [DEBUG] TLSv1.2 enabled
[20230216-07:46:05] [DEBUG] Security layer: requested 3, selected 1
[20230216-07:46:05] [DEBUG] Closed socket 12 (AF_INET6 ::ffff:...* port 3389)
[20230216-07:46:05] [ERROR] xrdp_mm_connect_chansrv: connect failed trying again...
[20230216-07:46:05] [DEBUG] Closed socket 20 (AF_UNIX)
[20230216-07:46:09] [ERROR] xrdp_mm_connect_chansrv: connect failed trying again...
[20230216-07:46:09] [ERROR] xrdp_mm_connect_chansrv: error in trans_connect chan
...
[20230216-07:55:55] [DEBUG] Security layer: requested 3, selected 1
[20230216-07:55:55] [DEBUG] Closed socket 12 (AF_INET6 ::ffff:...* port 3389)
[20230216-07:55:56] [ERROR] xrdp_mm_connect_chansrv: connect failed trying again...
[20230216-07:55:56] [DEBUG] Closed socket 20 (AF_UNIX)
[20230216-07:56:00] [ERROR] xrdp_mm_connect_chansrv: connect failed trying again...
[20230216-07:56:00] [ERROR] xrdp_mm_connect_chansrv: error in trans_connect chan

Xrdp-sesman.log

[20230216-07:45:30] [INFO ] A connection received from ::1 port 34842
[20230216-07:45:31] [INFO ] ++ created session (access granted): username mypcname, ip ::ffff: . . . :61200 - socket: 12
[20230216-07:45:31] [INFO ] starting Xorg session...
[20230216-07:45:31] [DEBUG] Closed socket 9 (AF_INET6 :: port 5911)
[20230216-07:45:31] [DEBUG] Closed socket 9 (AF_INET6 :: port 6011)
[20230216-07:45:31] [DEBUG] Closed socket 9 (AF_INET6 :: port 6211)
[20230216-07:45:31] [DEBUG] Closed socket 8 (AF_INET6 ::1 port 3350)
[20230216-07:45:31] [INFO ] calling auth_start_session from pid 2012
[20230216-07:45:31] [DEBUG] Closed socket 7 (AF_INET6 ::1 port 3350)
[20230216-07:45:31] [DEBUG] Closed socket 8 (AF_INET6 ::1 port 3350)
[20230216-07:45:31] [INFO ] /usr/lib/xorg/Xorg :11 -auth .Xauthority -config xrdp/xorg.conf -noreset -nolisten tcp -logfile .xorgxrdp.%s.log
[20230216-07:45:31] [CORE ] waiting for window manager (pid 2036) to exit
[20230216-07:45:53] [INFO ] A connection received from ::1 port 57308
[20230216-07:45:53] [INFO ] ++ reconnected session: username myusername, display :11.0, session_pid 2012, ip ::ffff:...***:61226 - socket: 12
[20230216-07:45:53] [DEBUG] Closed socket 8 (AF_INET6 ::1 port 3350)

When hitting "disconnect" manually I also see stuff like this.

[20230216-07:33:51] [DEBUG] cleanup_sockets:
[20230216-07:33:51] [DEBUG] cleanup_sockets:
[20230216-07:33:51] [DEBUG] cleanup_sockets: deleting /run/xrdp/sockdir/xrdp_chansrv_audio_out_socket_10
[20230216-07:33:51] [DEBUG] cleanup_sockets: deleting /run/xrdp/sockdir/xrdp_chansrv_audio_out_socket_11
[20230216-07:33:51] [DEBUG] cleanup_sockets: deleting /run/xrdp/sockdir/xrdp_chansrv_audio_in_socket_10
[20230216-07:33:51] [DEBUG] cleanup_sockets: deleting /run/xrdp/sockdir/xrdp_chansrv_audio_in_socket_11
[20230216-07:33:51] [DEBUG] cleanup_sockets: deleting /run/xrdp/sockdir/xrdpapi_10
[20230216-07:33:51] [DEBUG] cleanup_sockets: deleting /run/xrdp/sockdir/xrdpapi_11

@matt335672
Copy link
Member

There are a couple of possible reasons for this:-

  • You've got multiple connections open to the same session. xrdp doesn't cope well with this.
  • When closing your client, the FIN at the end of the TCP connection is not being received at the server. This presents in the same way as the previous point.

The correct solution is to get sesman to close existing the connection to a session when a new connection to the same session is made. I'm working on an architecture which will allow this to happen (#1961), but we're still a little way off I'm afraid.

@ChrisIdema
Copy link

ChrisIdema commented Mar 10, 2023

Thanks, I think I found my own solution. It seemed there is not the necessary folder in my home directory.

So I manually mkdir this folder thinclient_drives and its subfolder .clipboard , and restart xrdp service, then it works like a charm.

I can replicate the problem by putting my Ubuntu 22.04 machine in suspend while connected with Windows 11. After reconnecting clipboard stopped working. Only a Linux reboot brought back the clipboard
I tried mkdir -p ~/thinclient_drives/.clipboard and sudo systemctl reboot xrdp but I couldn't reconnect afterwards, screen remained black after I start remote desktop. Only a reboot of the Ubuntu fixed the issue. And Linux suspend still triggers the bug. I simply disabled suspending on that PC.

@Fl3xM4tt3x
Copy link

Hi,
i have the same problem.
I have a vm parrot os in hyper-v Windows 10 host.
With the clipboard I can do bidirectional copy/paste, with files I can only copy and paste from parrot to windows client while I can't from windows client to parrot
I connect in rdp with xrdp service
I share you the os system version and xrdp service version

PRETTY_NAME="Parrot OS 5.3 (Electro Ara)"
NAME="Parrot OS"
VERSION_ID="5.3"
VERSION="5.3 (Electro Ara)"
VERSION_CODENAME=ara
ID=parrot
ID_LIKE=debian
HOME_URL="https://www.parrotsec.org/"
SUPPORT_URL="https://community.parrotsec.org/"
BUG_REPORT_URL="https://community.parrotsec.org/"

xrdp 0.9.12

by default I have both the "thinclient_drives" folder and the ".clipboard" folder with the relative permissions
drwx------ 1 user user 0 13 giu 16.49 thinclient_drives
drwx------ 1 user user 4,0K 13 giu 16.49 .clipboard

do you know how i can fix it?

@RaduNico
Copy link

RaduNico commented Oct 2, 2023

adduser xrdp ssl-cert

This fixed my issue connecting from windows 10 to an Ubuntu 20.04.

@virtimus
Copy link

Found workaround on this when working on xrdp connection to docker container with Ubuntu desktop.

This my one-liner:

docker exec [container-name] ps aux | grep "xrdp-chansrv" | grep "/xrdp" | sed -e 's/ \+/ /g' | cut -d ' ' -f 2 | xargs kill -9 > /dev/null 2>&1 || nohup xrdp-chansrv > /var/log/chansrv.log 2>&1 &

(just kills xrdp-chansrv + start with logging to /var/log/chansrv.log)

Configured as pre-command and looks like working (at least copy/paste)

@sravera
Copy link

sravera commented Mar 14, 2024

Proposed workarounds seems not working in my case.
I'm experiencing same issue in case of sudden RDP connection drop. In this scenario, until kernel drops fake TCP connections (it takes around 15 minutes), the issue is present.

I have found this workaround which quickly cleans up fake TCP connections:
echo 3 | sudo tee /proc/sys/net/ipv4/tcp_retries2 ;# Set tcp retries to few seconds

In this way, if you reconnect to RDP server a few seconds after the connection drop, copy/paste is working.

You can tune it based on you needs.

@kienerj
Copy link

kienerj commented Jul 3, 2024

For me the copy&paste is simply not working, ever. Even after I reboot ubuntu 20,.04 and make a new connection. Doesn't work. I indeed had a missing .clipboard folder but adding it only changed that instead of getting an error connecting to chanserver it now is successful but copy&paste both direction (win10 to ubuntu 20.04) still doesn't work

@n00bsi
Copy link

n00bsi commented Nov 20, 2024

@Suitear

Using: Ubuntu 24.04.1 LTS

Could you tell me what I did wrong please ?
Because copy & paste did not work

/home/USERNAME/thinclient_drives/.clipboard

/etc/xrdp/xrdp.ini
...
cliprdr=true
....

# dpkg -l | grep xrdp
ii  libpipewire-0.3-modules-xrdp:amd64   0.2-2                                    amd64        libraries for the PipeWire multimedia server - xrdp modules
ii  pipewire-module-xrdp                 0.2-2                                    all          audio over xrdp for PipeWire based systems
ii  xorgxrdp                             1:0.9.19-1                               amd64        Remote Desktop Protocol (RDP) modules for X.org
ii  xrdp                                 0.9.24-4                                 amd64        Remote Desktop Protocol (RDP) server



Client is Windows 10
Connect by RDP Client from Windows

Log from a User that Login and try copy & paste

[20241120-14:23:17] [ERROR] xrdp_iso_send: trans_write_copy_s failed
[20241120-14:23:17] [ERROR] Sending [ITU T.125] DisconnectProviderUltimatum failed
[20241120-14:23:21] [INFO ] Socket 12: AF_INET6 connection received from ::ffff:192.168.1.111 port 55573
[20241120-14:23:21] [INFO ] Using default X.509 certificate: /etc/xrdp/cert.pem
[20241120-14:23:21] [INFO ] Using default X.509 key file: /etc/xrdp/key.pem
[20241120-14:23:21] [ERROR] Cannot read private key file /etc/xrdp/key.pem: Permission denied
[20241120-14:23:21] [WARN ] Cannot accept TLS connections because certificate or private key file is not readable. certificate file: [/etc/xrdp/cert.pem], private key file: [/etc/xrdp/key.pem]
[20241120-14:23:21] [INFO ] Security protocol: configured [RDP], requested [SSL|HYBRID|HYBRID_EX|RDP], selected [RDP]
[20241120-14:23:22] [ERROR] libxrdp_force_read: header read error
[20241120-14:23:22] [ERROR] Processing [ITU-T T.125] Connect-Initial failed
[20241120-14:23:22] [ERROR] [MCS Connection Sequence] receive connection request failed
[20241120-14:23:22] [ERROR] xrdp_sec_incoming: xrdp_mcs_incoming failed
[20241120-14:23:22] [ERROR] xrdp_rdp_incoming: xrdp_sec_incoming failed
[20241120-14:23:22] [ERROR] xrdp_process_main_loop: libxrdp_process_incoming failed
[20241120-14:23:22] [ERROR] xrdp_iso_send: trans_write_copy_s failed
[20241120-14:23:22] [ERROR] Sending [ITU T.125] DisconnectProviderUltimatum failed
[20241120-14:23:22] [INFO ] Socket 12: AF_INET6 connection received from ::ffff:192.168.1.111 port 55575
[20241120-14:23:22] [INFO ] Using default X.509 certificate: /etc/xrdp/cert.pem
[20241120-14:23:22] [INFO ] Using default X.509 key file: /etc/xrdp/key.pem
[20241120-14:23:22] [ERROR] Cannot read private key file /etc/xrdp/key.pem: Permission denied
[20241120-14:23:22] [WARN ] Cannot accept TLS connections because certificate or private key file is not readable. certificate file: [/etc/xrdp/cert.pem], private key file: [/etc/xrdp/key.pem]
[20241120-14:23:22] [INFO ] Security protocol: configured [RDP], requested [RDP], selected [RDP]
[20241120-14:23:22] [INFO ] Connected client computer name: SPG111466
[20241120-14:23:22] [WARN ] Received [MS-RDPBCGR] TS_UD_HEADER type 0xc006 is unknown (ignored)
[20241120-14:23:22] [WARN ] Received [MS-RDPBCGR] TS_UD_HEADER type 0xc00a is unknown (ignored)
[20241120-14:23:22] [INFO ] xrdp_load_keyboard_layout: Keyboard information sent by the RDP client, keyboard_type:[0x04], keyboard_subtype:[0x00], keylayout:[0x00000407]
[20241120-14:23:22] [INFO ] xrdp_load_keyboard_layout: model [] variant [] layout [de] options []
[20241120-14:23:22] [INFO ] Non-TLS connection established from ::ffff:192.168.1.111 port 55575: with security level : high
[20241120-14:23:22] [INFO ] xrdp_caps_process_pointer: client supports new(color) cursor
[20241120-14:23:22] [INFO ] xrdp_process_offscreen_bmpcache: support level 1 cache size 10485760 MB cache entries 100
[20241120-14:23:22] [INFO ] xrdp_caps_process_codecs: nscodec, codec id 1, properties len 3
[20241120-14:23:22] [WARN ] xrdp_caps_process_codecs: unknown codec id 5
[20241120-14:23:22] [INFO ] xrdp_caps_process_codecs: RemoteFX, codec id 3, properties len 49
[20241120-14:23:22] [INFO ] Loading keymap file /etc/xrdp/km-00000407.ini
[20241120-14:23:22] [WARN ] local keymap file for 0x00000407 found and doesn't match built in keymap, using local keymap file
[20241120-14:23:57] [INFO ] connecting to sesman on 127.0.0.1:3350
[20241120-14:23:57] [INFO ] xrdp_wm_log_msg: sesman connect ok
[20241120-14:23:57] [INFO ] sesman connect ok
[20241120-14:23:57] [INFO ] sending login info to session manager. Please wait...
[20241120-14:23:57] [INFO ] xrdp_wm_log_msg: login successful for user USERNAME on display 12
[20241120-14:23:57] [INFO ] login successful for user USERNAME on display 12
[20241120-14:23:57] [INFO ] loaded module 'libxup.so' ok, interface size 10296, version 4
[20241120-14:23:57] [INFO ] started connecting
[20241120-14:23:57] [INFO ] lib_mod_connect: connecting via UNIX socket
[20241120-14:23:57] [INFO ] lib_mod_log_peer: xrdp_pid=531820 connected to X11rdp_pid=531830 X11rdp_uid=1003 X11rdp_gid=1003 client_ip=::ffff:192.168.1.111 client_port=55575
[20241120-14:23:57] [INFO ] connected ok
[20241120-14:24:37] [ERROR] xrdp_sec_recv: xrdp_mcs_recv failed
[20241120-14:24:37] [ERROR] xrdp_rdp_recv: xrdp_sec_recv failed
[20241120-14:24:37] [ERROR] libxrdp_process_data: xrdp_rdp_recv failed
[20241120-14:24:37] [ERROR] xrdp_process_data_in: xrdp_process_loop failed

cat .xorgxrdp.12.log

[1506217.845] 
X.Org X Server 1.21.1.11
X Protocol Version 11, Revision 0
[1506217.845] Current Operating System: Linux iiotjh01 6.8.0-48-generic #48-Ubuntu SMP PREEMPT_DYNAMIC Fri Sep 27 14:04:52 UTC 2024 x86_64
[1506217.845] Kernel command line: BOOT_IMAGE=/vmlinuz-6.8.0-48-generic root=/dev/mapper/ubuntu--vg-ubuntu--lv ro quiet splash
[1506217.845] xorg-server 2:21.1.12-1ubuntu1.1 (For technical support please see http://www.ubuntu.com/support) 
[1506217.845] Current version of pixman: 0.42.2
[1506217.845]   Before reporting problems, check http://wiki.x.org
        to make sure that you have the latest version.
[1506217.845] Markers: (--) probed, (**) from config file, (==) default setting,
        (++) from command line, (!!) notice, (II) informational,
        (WW) warning, (EE) error, (NI) not implemented, (??) unknown.
[1506217.845] (++) Log file: ".xorgxrdp.12.log", Time: Wed Nov 20 14:23:57 2024
[1506217.845] (++) Using config file: "/etc/X11/xrdp/xorg.conf"
[1506217.845] (==) Using system config directory "/usr/share/X11/xorg.conf.d"
[1506217.845] (**) Option "defaultserverlayout" "X11 Server"
[1506217.845] (**) ServerLayout "X11 Server"
[1506217.845] (**) |-->Screen "Screen (xrdpdev)" (0)
[1506217.845] (**) |   |-->Monitor "Monitor"
[1506217.845] (**) |   |-->Device "Video Card (xrdpdev)"
[1506217.845] (**) |-->Input Device "xrdpMouse"
[1506217.845] (**) |-->Input Device "xrdpKeyboard"
[1506217.845] (**) Option "DontVTSwitch" "on"
[1506217.845] (**) Option "AutoAddDevices" "off"
[1506217.845] (**) Allowing byte-swapped clients
[1506217.845] (**) Not automatically adding devices
[1506217.845] (==) Automatically enabling devices
[1506217.845] (==) Automatically adding GPU devices
[1506217.845] (==) Automatically binding GPU devices
[1506217.845] (==) Max clients allowed: 256, resource mask: 0x1fffff
[1506217.845] (WW) The directory "/usr/share/fonts/X11/cyrillic" does not exist.
[1506217.845]   Entry deleted from font path.
[1506217.845] (WW) The directory "/usr/share/fonts/X11/100dpi/" does not exist.
[1506217.845]   Entry deleted from font path.
[1506217.845] (WW) The directory "/usr/share/fonts/X11/75dpi/" does not exist.
[1506217.845]   Entry deleted from font path.
[1506217.845] (WW) The directory "/usr/share/fonts/X11/100dpi" does not exist.
[1506217.845]   Entry deleted from font path.
[1506217.845] (WW) The directory "/usr/share/fonts/X11/75dpi" does not exist.
[1506217.845]   Entry deleted from font path.
[1506217.845] (==) FontPath set to:
        /usr/share/fonts/X11/misc,
        /usr/share/fonts/X11/Type1,
        built-ins
[1506217.845] (==) ModulePath set to "/usr/lib/xorg/modules"
[1506217.845] (II) Loader magic: 0x5826801d6020
[1506217.845] (II) Module ABI versions:
[1506217.845]   X.Org ANSI C Emulation: 0.4
[1506217.845]   X.Org Video Driver: 25.2
[1506217.845]   X.Org XInput driver : 24.4
[1506217.845]   X.Org Server Extension : 10.0
[1506217.847] (II) systemd-logind: took control of session /org/freedesktop/login1/session/c5
[1506217.848] (II) xfree86: Adding drm device (/dev/dri/card0)
[1506217.848] (II) Platform probe for /sys/devices/pci0000:00/0000:00:0f.0/drm/card0
[1506217.849] (EE) systemd-logind: failed to take device /dev/dri/card0: Operation not permitted
[1506217.853] (--) PCI:*(0@0:15:0) 15ad:0405:15ad:0405 rev 0, Mem @ 0xe8000000/134217728, 0xfe000000/8388608, I/O @ 0x00001070/16, BIOS @ 0x????????/131072
[1506217.853] (II) "glx" will be loaded. This was enabled by default and also specified in the config file.
[1506217.853] (II) LoadModule: "dbe"
[1506217.853] (II) Module "dbe" already built-in
[1506217.853] (II) LoadModule: "ddc"
[1506217.853] (II) Module "ddc" already built-in
[1506217.853] (II) LoadModule: "extmod"
[1506217.853] (II) Module "extmod" already built-in
[1506217.853] (II) LoadModule: "glx"
[1506217.853] (II) Loading /usr/lib/xorg/modules/extensions/libglx.so
[1506217.854] (II) Module glx: vendor="X.Org Foundation"
[1506217.854]   compiled for 1.21.1.11, module version = 1.0.0
[1506217.854]   ABI class: X.Org Server Extension, version 10.0
[1506217.854] (II) LoadModule: "int10"
[1506217.854] (II) Loading /usr/lib/xorg/modules/libint10.so
[1506217.854] (II) Module int10: vendor="X.Org Foundation"
[1506217.854]   compiled for 1.21.1.11, module version = 1.0.0
[1506217.854]   ABI class: X.Org Video Driver, version 25.2
[1506217.854] (II) LoadModule: "record"
[1506217.854] (II) Module "record" already built-in
[1506217.854] (II) LoadModule: "vbe"
[1506217.854] (II) Loading /usr/lib/xorg/modules/libint10.so
[1506217.854] (II) Module int10: vendor="X.Org Foundation"
[1506217.854]   compiled for 1.21.1.11, module version = 1.0.0
[1506217.854]   ABI class: X.Org Video Driver, version 25.2
[1506217.854] (II) LoadModule: "glamoregl"
[1506217.854] (II) Loading /usr/lib/xorg/modules/libglamoregl.so
[1506217.857] (II) Module glamoregl: vendor="X.Org Foundation"
[1506217.857]   compiled for 1.21.1.11, module version = 1.0.1
[1506217.857]   ABI class: X.Org ANSI C Emulation, version 0.4
[1506217.857] (II) LoadModule: "xorgxrdp"
[1506217.857] (II) Loading /usr/lib/xorg/modules/libxorgxrdp.so
[1506217.857] (II) Module XORGXRDP: vendor="X.Org Foundation"
[1506217.857]   compiled for 1.21.1.5, module version = 0.9.19
[1506217.857]   ABI class: X.Org Video Driver, version 25.2
[1506217.857] xorgxrdpSetup:
[1506217.857] (II) LoadModule: "fb"
[1506217.857] (II) Module "fb" already built-in
[1506217.857] (II) LoadModule: "xrdpdev"
[1506217.857] (II) Loading /usr/lib/xorg/modules/drivers/xrdpdev_drv.so
[1506217.857] (II) Module XRDPDEV: vendor="X.Org Foundation"
[1506217.857]   compiled for 1.21.1.5, module version = 0.9.19
[1506217.857]   ABI class: X.Org Video Driver, version 25.2
[1506217.857] xrdpdevSetup:
[1506217.857] (II) LoadModule: "xrdpmouse"
[1506217.858] (II) Loading /usr/lib/xorg/modules/input/xrdpmouse_drv.so
[1506217.858] (II) Module XRDPMOUSE: vendor="X.Org Foundation"
[1506217.858]   compiled for 1.21.1.5, module version = 0.9.19
[1506217.858]   Module class: X.Org XInput Driver
[1506217.858]   ABI class: X.Org XInput driver, version 24.4
[1506217.858] rdpmousePlug:
[1506217.858] (II) LoadModule: "xrdpkeyb"
[1506217.858] (II) Loading /usr/lib/xorg/modules/input/xrdpkeyb_drv.so
[1506217.858] (II) Module XRDPKEYB: vendor="X.Org Foundation"
[1506217.858]   compiled for 1.21.1.5, module version = 0.9.19
[1506217.858]   Module class: X.Org XInput Driver
[1506217.858]   ABI class: X.Org XInput driver, version 24.4
[1506217.858] rdpkeybPlug:
[1506217.858] rdpIdentify:
[1506217.858] (II) XRDPDEV: driver for xrdp: XRDPDEV
[1506217.858] rdpDriverFunc: op 10
[1506217.858] (WW) Falling back to old probe method for XRDPDEV
[1506217.858] rdpProbe:
[1506217.858] (II) Loading sub module "fb"
[1506217.858] (II) LoadModule: "fb"
[1506217.858] (II) Module "fb" already built-in
[1506217.858] rdpProbe: found DRMDevice xorg.conf value [/dev/dri/renderD128]
[1506217.858] rdpProbe: found DRI3 xorg.conf value [1]
[1506217.858] (II) XRDPDEV(0): using default device
[1506217.858] (WW) VGA arbiter: cannot open kernel arbiter, no multi-card support
[1506217.858] rdpPreInit:
[1506217.858] rdpPreInit: /dev/dri/renderD128 open failed
[1506217.858] (**) XRDPDEV(0): Depth 24, (--) framebuffer bpp 32
[1506217.858] (==) XRDPDEV(0): RGB weight 888
[1506217.858] (==) XRDPDEV(0): Using gamma correction (1.0, 1.0, 1.0)
[1506217.858] (==) XRDPDEV(0): Default visual is TrueColor
[1506217.858] (==) XRDPDEV(0): DPI set to (96, 96)
[1506217.858] (II) XRDPDEV(0):  mode "640x480" ok
[1506217.858] (II) XRDPDEV(0):  mode "800x600" ok
[1506217.858] (II) XRDPDEV(0): Virtual size is 800x600 (pitch 800)
[1506217.858] (**) XRDPDEV(0):  Default mode "800x600": 36.0 MHz (scaled from 0.0 MHz), 35.2 kHz, 56.2 Hz
[1506217.858] (II) XRDPDEV(0): Modeline "800x600"x0.0   36.00  800 824 896 1024  600 601 603 625 +hsync +vsync (35.2 kHz d)
[1506217.858] rdpScreenInit: virtualX 800 virtualY 600 rgbBits 8 depth 24
[1506217.858] rdpScreenInit: pfbMemory bytes 1920000
[1506217.858] rdpScreenInit: pfbMemory 0x740f52ad4010
[1506217.858] rdpSimdInit: assigning yuv functions
[1506217.858] rdpSimdInit: cpuid ax 1 cx 0 return ax 0x00050657 bx 0x00010800 cx 0xfffa3203 dx 0x0f8bfbff
[1506217.858] rdpSimdInit: sse2 amd64 yuv functions assigned
[1506217.858] (==) XRDPDEV(0): Backing store enabled
[1506217.858] rdpClientConInit: disconnect idle session after [0] sec
[1506217.858] rdpClientConInit: kill disconnected [0] timeout [0] sec
[1506217.858] rdpClientConInit: do_touchpad_scroll_hack [0]
[1506217.858] rdpXvInit: depth 24
[1506217.858] rdpScreenInit: out
[1506217.858] (II) Initializing extension Generic Event Extension
[1506217.858] (II) Initializing extension SHAPE
[1506217.858] (II) Initializing extension MIT-SHM
[1506217.858] (II) Initializing extension XInputExtension
[1506217.858] (II) Initializing extension XTEST
[1506217.858] (II) Initializing extension BIG-REQUESTS
[1506217.859] (II) Initializing extension SYNC
[1506217.859] (II) Initializing extension XKEYBOARD
[1506217.859] (II) Initializing extension XC-MISC
[1506217.859] (II) Initializing extension SECURITY
[1506217.859] (II) Initializing extension XFIXES
[1506217.859] (II) Initializing extension RENDER
[1506217.859] (II) Initializing extension RANDR
[1506217.859] (II) Initializing extension COMPOSITE
[1506217.859] (II) Initializing extension DAMAGE
[1506217.859] (II) Initializing extension MIT-SCREEN-SAVER
[1506217.859] (II) Initializing extension DOUBLE-BUFFER
[1506217.859] (II) Initializing extension RECORD
[1506217.859] (II) Initializing extension DPMS
[1506217.859] (II) Initializing extension Present
[1506217.859] (II) Initializing extension DRI3
[1506217.859] (II) Initializing extension X-Resource
[1506217.859] (II) Initializing extension XVideo
[1506217.860] (II) Initializing extension XVideo-MotionCompensation
[1506217.860] (II) Initializing extension SELinux
[1506217.860] (II) SELinux: Disabled on system
[1506217.860] (II) Initializing extension GLX
[1506217.860] (II) AIGLX: Screen 0 is not DRI2 capable
[1506217.882] (II) IGLX: Loaded and initialized swrast
[1506217.882] (II) GLX: Initialized DRISWRAST GL provider for screen 0
[1506217.882] (II) Initializing extension XFree86-VidModeExtension
[1506217.882] (II) Initializing extension XFree86-DGA
[1506217.882] (II) Initializing extension XFree86-DRI
[1506217.882] (II) Initializing extension DRI2
[1506217.882] rdpCreateScreenResources:
[1506217.901] (II) Using input driver 'XRDPMOUSE' for 'xrdpMouse'
[1506217.901] (**) Option "CorePointer"
[1506217.901] (**) xrdpMouse: always reports core events
[1506217.901] rdpmousePreInit: drv 0x582680373eb0 info 0x582680656900, flags 0x0
[1506217.901] (II) XINPUT: Adding extended input device "xrdpMouse" (type: Mouse, id 6)
[1506217.901] rdpmouseControl: what 0
[1506217.901] rdpmouseDeviceInit:
[1506217.901] rdpmouseCtrl:
[1506217.901] rdpRegisterInputCallback: type 1 proc 0x740f53d3a3a0
[1506217.901] (**) xrdpMouse: (accel) keeping acceleration scheme 1
[1506217.901] (**) xrdpMouse: (accel) acceleration profile 0
[1506217.901] (**) xrdpMouse: (accel) acceleration factor: 2.000
[1506217.901] (**) xrdpMouse: (accel) acceleration threshold: 4
[1506217.901] rdpmouseControl: what 1
[1506217.901] rdpmouseDeviceOn:
[1506217.901] (II) Using input driver 'XRDPKEYB' for 'xrdpKeyboard'
[1506217.901] (**) Option "CoreKeyboard"
[1506217.901] (**) xrdpKeyboard: always reports core events
[1506217.901] rdpkeybPreInit: drv 0x582680374a10 info 0x582680659a10, flags 0x0
[1506217.901] (II) XINPUT: Adding extended input device "xrdpKeyboard" (type: Keyboard, id 7)
[1506217.901] rdpkeybControl: what 0
[1506217.901] rdpkeybDeviceInit:
[1506217.913] rdpkeybChangeKeyboardControl:
[1506217.913] rdpkeybChangeKeyboardControl: autoRepeat on
[1506217.913] rdpRegisterInputCallback: type 0 proc 0x740f52caad60
[1506217.913] rdpkeybControl: what 1
[1506217.913] rdpkeybDeviceOn:
[1506217.913] rdpkeybChangeKeyboardControl:
[1506217.913] rdpkeybChangeKeyboardControl: autoRepeat on
[1506217.926] (II) config/udev: Adding input device Power Button (/dev/input/event0)
[1506217.926] (II) AutoAddDevices is off - not adding device.
[1506217.926] (II) config/udev: Adding drm device (/dev/dri/card0)
[1506217.926] (II) xfree86: Adding drm device (/dev/dri/card0)
[1506217.926] (II) Platform probe for /sys/devices/pci0000:00/0000:00:0f.0/drm/card0
[1506217.927] (EE) systemd-logind: failed to take device /dev/dri/card0: Operation not permitted
[1506217.928] (II) config/udev: Adding input device AT Translated Set 2 keyboard (/dev/input/event1)
[1506217.928] (II) AutoAddDevices is off - not adding device.
[1506217.928] (II) config/udev: Adding input device VirtualPS/2 VMware VMMouse (/dev/input/event3)
[1506217.928] (II) AutoAddDevices is off - not adding device.
[1506217.929] (II) config/udev: Adding input device VirtualPS/2 VMware VMMouse (/dev/input/mouse1)
[1506217.929] (II) AutoAddDevices is off - not adding device.
[1506217.929] (II) config/udev: Adding input device VirtualPS/2 VMware VMMouse (/dev/input/event2)
[1506217.929] (II) AutoAddDevices is off - not adding device.
[1506217.929] (II) config/udev: Adding input device VirtualPS/2 VMware VMMouse (/dev/input/mouse0)
[1506217.929] (II) AutoAddDevices is off - not adding device.
[1506217.935] rdpDeferredRandR:
[1506217.935] rdpResizeSession: width 1024 height 768
[1506217.935]   calling RRScreenSizeSet
[1506217.935] rdpRRScreenSetSize: width 1024 height 768 mmWidth 271 mmHeight 203
[1506217.935] rdpRRGetInfo:
[1506217.935]   screen resized to 1024x768
[1506217.937]   RRScreenSizeSet ok 1
[1506217.937] rdpResizeSession: width 1920 height 1080
[1506217.937]   calling RRScreenSizeSet
[1506217.937] rdpRRScreenSetSize: width 1920 height 1080 mmWidth 508 mmHeight 286
[1506217.937] rdpRRGetInfo:
[1506217.937]   screen resized to 1920x1080
[1506217.941]   RRScreenSizeSet ok 1
[1506217.941] rdpClientConGotConnection:
[1506217.941] rdpClientConGotConnection: g_sck_accept ok new_sck 9
[1506217.941] rdpClientConGetConnection: idle_disconnect_timeout set to non-positive value, idle timer turned off
[1506217.941] rdpAddClientConToDev: adding first clientCon 0x5826806b51d0
[1506217.941] rdpClientConProcessMsgVersion: version 0 0 0 1
[1506217.941] rdpClientConProcessScreenSizeMsg: set width 1920 height 1080 bpp 32
[1506217.941] rdpClientConAllocateSharedMemory: shmemid 622651 shmemptr 0x740f45017000 bytes 8294400
[1506217.941] rdpClientConProcessMsgClientInput: invalidate x 0 y 0 cx 1920 cy 1080
[1506218.014] rdpInDeferredRepeatCallback:
[1506218.014] rdpkeybChangeKeyboardControl:
[1506218.014] rdpkeybChangeKeyboardControl: autoRepeat off
[1506218.014] rdpInDeferredRepeatCallback:
[1506218.014] rdpkeybChangeKeyboardControl:
[1506218.014] rdpkeybChangeKeyboardControl: autoRepeat off
[1506218.137] rdpClientConProcessMsgClientInfo:
[1506218.137]   got client info bytes 7072
[1506218.137]   jpeg support 0
[1506218.137]   offscreen support 1
[1506218.137]   offscreen size 10485760
[1506218.137]   offscreen entries 100
[1506218.137]   client can not do offscreen to offscreen blits
[1506218.137]   client can do new(color) cursor
[1506218.137]   client can not do multimon
[1506218.137] rdpRRSetRdpOutputs: numCrtcs 0 numOutputs 0 monitorCount 0
[1506218.137] rdpRRSetRdpOutputs: add output 0 left 0 top 0 width 1920 height 1080
[1506218.137] rdpLoadLayout: keylayout 0x00000407 variant  display 12
[1506218.153] rdpkeybChangeKeyboardControl:
[1506218.153] rdpkeybChangeKeyboardControl: autoRepeat on
[1506218.154] rdpkeybChangeKeyboardControl:
[1506218.154] rdpkeybChangeKeyboardControl: autoRepeat on
[1506218.253] rdpInDeferredRepeatCallback:
[1506218.253] rdpkeybChangeKeyboardControl:
[1506218.253] rdpkeybChangeKeyboardControl: autoRepeat off
[1506218.254] rdpInDeferredRepeatCallback:
[1506218.254] rdpkeybChangeKeyboardControl:
[1506218.254] rdpkeybChangeKeyboardControl: autoRepeat off
[1506218.266] rdpkeybChangeKeyboardControl:
[1506218.266] rdpkeybChangeKeyboardControl: autoRepeat off
[1506218.266] rdpkeybChangeKeyboardControl:
[1506218.266] rdpkeybChangeKeyboardControl: autoRepeat off
[1506218.689] rdpRRGetInfo:
[1506218.703] rdpkeybChangeKeyboardControl:
[1506218.703] rdpkeybChangeKeyboardControl: autoRepeat on
[1506218.703] rdpkeybChangeKeyboardControl:
[1506218.703] rdpkeybChangeKeyboardControl: autoRepeat on
[1506218.704] rdpkeybChangeKeyboardControl:
[1506218.704] rdpkeybChangeKeyboardControl: autoRepeat on
[1506218.704] rdpkeybChangeKeyboardControl:
[1506218.704] rdpkeybChangeKeyboardControl: autoRepeat on
[1506218.704] rdpkeybChangeKeyboardControl:
[1506218.704] rdpkeybChangeKeyboardControl: autoRepeat on
[1506218.704] rdpkeybChangeKeyboardControl:
[1506218.704] rdpkeybChangeKeyboardControl: autoRepeat on
[1506218.706] rdpkeybChangeKeyboardControl:
[1506218.706] rdpkeybChangeKeyboardControl: autoRepeat on
[1506218.706] rdpkeybChangeKeyboardControl:
[1506218.706] rdpkeybChangeKeyboardControl: autoRepeat on
[1506218.803] rdpInDeferredRepeatCallback:
[1506218.803] rdpkeybChangeKeyboardControl:
[1506218.803] rdpkeybChangeKeyboardControl: autoRepeat off
[1506218.803] rdpInDeferredRepeatCallback:
[1506218.803] rdpkeybChangeKeyboardControl:
[1506218.803] rdpkeybChangeKeyboardControl: autoRepeat off
[1506218.804] rdpInDeferredRepeatCallback:
[1506218.804] rdpkeybChangeKeyboardControl:
[1506218.804] rdpkeybChangeKeyboardControl: autoRepeat off
[1506218.804] rdpInDeferredRepeatCallback:
[1506218.804] rdpkeybChangeKeyboardControl:
[1506218.804] rdpkeybChangeKeyboardControl: autoRepeat off
[1506218.804] rdpInDeferredRepeatCallback:
[1506218.804] rdpkeybChangeKeyboardControl:
[1506218.804] rdpkeybChangeKeyboardControl: autoRepeat off
[1506218.804] rdpInDeferredRepeatCallback:
[1506218.804] rdpkeybChangeKeyboardControl:
[1506218.804] rdpkeybChangeKeyboardControl: autoRepeat off
[1506218.806] rdpInDeferredRepeatCallback:
[1506218.806] rdpkeybChangeKeyboardControl:
[1506218.806] rdpkeybChangeKeyboardControl: autoRepeat off
[1506218.806] rdpInDeferredRepeatCallback:
[1506218.806] rdpkeybChangeKeyboardControl:
[1506218.806] rdpkeybChangeKeyboardControl: autoRepeat off
[1506219.159] rdpRRGetInfo:
[1506219.224] rdpRRCrtcGetGamma: 0x582680673310 0x58268066b920 0x58268066bd20 0x58268066bb20
[1506219.225] rdpRRCrtcSetGamma:
[1506219.225] rdpRRCrtcGetGamma: 0x582680673310 0x58268066b920 0x58268066bd20 0x58268066bb20
[1506258.078] rdpClientConRecv: g_sck_recv failed(returned 0)
[1506258.078] rdpClientConRecvMsg: error
[1506258.078] rdpClientConCheck: rdpClientConGotData failed
[1506258.078] rdpClientConDisconnect:
[1506258.078] rdpRemoveClientConFromDev: removing clientCon 0x5826806b51d0

@kienerj
Copy link

kienerj commented Dec 6, 2024

For me upgrading from Ubuntu 20.04 to 22.04 fixed the issue without any other change.

@ku4979p9
Copy link

ku4979p9 commented Dec 7, 2024

Here's something else you could try.

You can use the TCP keepalive function to prune TCP connections that have dropped out.

First, enable tcp_keepalive in /etc/xrdp/xrdp.ini

This will probe for dead connections when the connections have been dead a couple of hours. That's probably too long to wait, so you can change some values like this. These are GLOBAL, so this will affect all TCP connections to the machine with keepalive enabled:-

echo 300 | sudo tee /proc/sys/net/ipv4/tcp_keepalive_time  ;# Set keepalive timer to 5 minutes
echo 10 | sudo tee /proc/sys/net/ipv4/tcp_keepalive_intvl ;# 10 seconds between probes
echo 3 | sudo tee /proc/sys/net/ipv4/tcp_keepalive_probes   ;# 3 probes max

That way, after 5 minutes and 30 seconds the old connection will be killed and you should be able to reconnect.

More info in tcp(7) and the Linux TCP keepalive HOWTO

If that works for you, we can look at getting these values configurable in xrdp.ini. It's a bit of a band-aid, but I think there's a requirement for it at the moment.

Proposed workarounds seems not working in my case. I'm experiencing same issue in case of sudden RDP connection drop. In this scenario, until kernel drops fake TCP connections (it takes around 15 minutes), the issue is present.

I have found this workaround which quickly cleans up fake TCP connections: echo 3 | sudo tee /proc/sys/net/ipv4/tcp_retries2 ;# Set tcp retries to few seconds

In this way, if you reconnect to RDP server a few seconds after the connection drop, copy/paste is working.

You can tune it based on you needs.

it works

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clipboard question or troubleshoot question or trouble shoot, not confirmed as xrdp bug or issue yet
Projects
None yet
Development

No branches or pull requests