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

Clipboard not working with xrdp #469

Closed
ToddAndMargo opened this issue Oct 29, 2016 · 71 comments
Closed

Clipboard not working with xrdp #469

ToddAndMargo opened this issue Oct 29, 2016 · 71 comments

Comments

@ToddAndMargo
Copy link

ToddAndMargo commented Oct 29, 2016

Dear XRDP,

Red Hat asked me to report this with you.
https://bugzilla.redhat.com/show_bug.cgi?id=1356732

This bug makes it an absolute nightmare to do remote maintenance!

Would one of our intrepid heroes please fix this for me?

Client 1:
Scientific Linux 7.2 (RHEL 7.2 Clone)
rdesktop-1.8.3-1.el7.nux.x86_64

Client 2:
mstsc.exe 6.3.9600.16415 from Windows 7 Professional

Server:
Fedora core 24, x64
xrdp-0.9.0-5.fc24.x86_64
Xfce 4.12

Neither clipboard from Linux works or the clipboard from Windows. Yes both are configured for clipboard and both work when logged into a Windows RDP (terminal services) server.

And the clipboard IS supported in xrdp as of 0.7.0. See
http://www.xrdp.org/index.php?option=com_content&view=article&id=12:clipboard&catid=2:documents&Itemid=7

 "The clipboard in RDP support several formats.  As of xrdp v 0.7.0,
  bitmaps are supported.  You can copy and paste images between your
  Linux or Windows client and xrdp server"

This also reproduces on Scientific Linux 7.2 and xrdp 0.9.0 as the server. I had to upgrade the server to FC24 do to SL 7.2 randomly not recognizing my system drives, which I reported under
https://bugzilla.redhat.com/show_bug.cgi?id=1353423

This is a nightmare. Please fix as soon as possible!

Many thanks,
-T

@therevoman
Copy link

I'm not sure if this is the answer to your problem, but it helped me.

  1. in your Remote Desktop Client, check the configuration and make sure printers and smart cards are UN selected. This might be in the advanced settings
  2. make sure FUSE is installed and your user has permissions to the 'fuse' group.

@ToddAndMargo
Copy link
Author

ToddAndMargo commented Oct 31, 2016

Why do you need to disable printers in the clients?

On the server, "fuse" is installed but there is no such fuse group:

$ rpm -qa fuse
glusterfs-fuse-3.8.5-1.fc24.x86_64
fuse-libs-2.9.7-1.fc24.x86_64
fuse-2.9.7-1.fc24.x86_64

$ grep -i fuse /etc/group
$ # nothing comes back

@itamarjp
Copy link
Member

What you did to fix it ?

@ToddAndMargo ToddAndMargo reopened this Oct 31, 2016
@ToddAndMargo
Copy link
Author

I pressed the wrong button on the this screen. I though "close and Comment" was "close" the edit window, not the case. So I am reopening it.

@ToddAndMargo
Copy link
Author

No symptom change with printer redirects and file sharing redirect removed:

rdesktop -u "todd" -g 92%% -a 16 -r clipboard:CLIPBOARD uuu.vvv.www.xxx:yyy

Should there be a "fuse" group"?

@itamarjp
Copy link
Member

itamarjp commented Nov 2, 2016

do you mind trying with xfreerdp client ?

@ToddAndMargo
Copy link
Author

I don't mind. But I do not use xfreerdp. I use rdesktop in Linux and mstsc in Windows and both work fine with other RDP servers. It is just xrdp that the clipboard does not work with.

I just installed freerdp.x86_64 0:1.0.2-6.el7_2.1 on my Linux client machine. No symptom change.

Do you need me to keep xfreerdp around? I was about to delete it.

@Natureshadow
Copy link
Contributor

rdesktop is a major cause of trouble. Please consider moving to xfreerdp.

@ToddAndMargo
Copy link
Author

ToddAndMargo commented Nov 10, 2016

The clipboard when used with xfreerdp also does not work. There was no symptom change.

It also does not matter what client I am using, the clipboard still does not work with xrdp. The clipboards when used with those clients do work with various Windows RDP servers. Therefore the issue is on the server side with xrdp or supporting utilities.

The problem with trying other Linux clients (none of which work with xrdp's clipboard) is that xrdp needs to work with Windows clients as well. And the clipboard when used with mstsc.exe from both XP and W7 does not work with xrdp.

xfreerdp does not work as well as rdesktop either. (rdesktop's command line can be a chore to master though.) What issues are you having with it?

@nktl
Copy link

nktl commented Nov 24, 2016

Clipboard (both direction) works fine, at least in RHEL 7.2.

Two things that might help:

  1. Make sure you use latest devel build with 'native' xorgxrdp drivers (not VNC-proxy session)
  2. Check with different session manage / desktop environment - KDE distributed with RHEL 7.2 definitively works OK.

@ToddAndMargo
Copy link
Author

ToddAndMargo commented Nov 25, 2016 via email

@ToddAndMargo
Copy link
Author

The server is now running Fedora Core 25. MSTSC.exe from Windows 7 Professional is still not able to copy and paste from/to the server. Tears!

@metalefty
Copy link
Member

Add CHANSRV_LOG_LEVEL=LOG_LEVEL_DEBUG to SessionVariables section in sesman.ini and restart your session.
You can see more logs for clipboard. The log is written to ~/.local/share/xrdp/xrdp-chansrv.log or ~/xrdp-chansrv.log.

@ToddAndMargo
Copy link
Author

Hi Metalefty,
Done and I did a
systemclt restart xrdp-sesman.service; systemctl restart xrdp.service

I promptly got lkicked off, but was able to log in again. This is what appeared in the log.

$ more xrdp-chansrv.log
[20161214-19:04:44] [CORE ] main: app started pid 3639(0x00000e37)
[20161214-19:04:44] [INFO ] main: DISPLAY env var set to :10.0
[20161214-19:04:44] [INFO ] main: using DISPLAY 10
[20161214-19:04:45] [INFO ] channel_thread_loop: thread start
[20161214-19:04:45] [INFO ] A connection received from: 0.0.0.0 port 0
[20161214-19:04:45] [DEBUG] my_trans_conn_in:
[20161214-19:04:45] [INFO ] An established connection closed to endpoint: NULL:N
ULL - socket: 11
[20161214-19:04:45] [DEBUG] my_trans_data_in:
[20161214-19:04:46] [DEBUG] process_message_init:
[20161214-19:04:46] [INFO ] send_init_response_message:
[20161214-19:04:46] [DEBUG] my_trans_data_in:
[20161214-19:04:46] [DEBUG] process_message_channel_setup:
[20161214-19:04:46] [DEBUG] process_message_channel_setup: num_chans 0
[20161214-19:04:46] [DEBUG] send_channel_setup_response_message:

Does this tell you anything?

-T

@metalefty
Copy link
Member

What do you see in the log when copy something to clipboard?

@ToddAndMargo
Copy link
Author

I put a tail on the log file. Then I copied something int the clipboard on the client side. No log change. Then I copied something into the clipboard on the server side. No log change. No amount of copying and pasting on either side caused a change in the log file.

You just can't copy/paste between the client/server. The server and the client can copy and paste to themselves just fine

@therevoman
Copy link

therevoman commented Dec 21, 2016 via email

@ToddAndMargo
Copy link
Author

ToddAndMargo commented Dec 21, 2016 via email

@yvesdm3000
Copy link

I seem to have the same issue from the latest 'devel' branch. It looks like the xrdp-chanserv becomes defunct. Everything seems to continue working except for copy&paste. I still need to figure out why that process stops working.

Yves

@yvesdm3000
Copy link

Found why it was not working for me. I have an alternative location of the .Xauthority file, normally set by the XAUTHORITY environment variable, but it gets lost when xrdp-chansrv launches. It fails to connect to the x server and hence can't perform its tasks.

Yves

@fenghse
Copy link

fenghse commented Jan 16, 2017

Same for me, neither xfreerdp or rdesktop works. Is there a method to fix this issue. @yvesdm3000

@dafyre
Copy link

dafyre commented Jan 18, 2017

I am also experiencing this on LInux Mint 18 and Mate.

Using Windows RDP as well as xfreerdp. It's happening on two different systems, so I'll be happy to help if needed.

Edit: After adding logging lines for the chansrv and a restart, the clipboard now appears to be working.

@ToddAndMargo
Copy link
Author

Is there a new update for this to try?

@metalefty
Copy link
Member

Could you try the latest release?

@ToddAndMargo
Copy link
Author

ToddAndMargo commented Mar 15, 2017

I upgraded to xrdp-0.9.1-5.fc25.x86_64. Rebooted and got:

xrdp_error

So I downgraded back to xrdp-0.9.0-6.fc25.x86_64. A least I am working again, even without the clipboard

@proski
Copy link
Contributor

proski commented Mar 15, 2017 via email

@ToddAndMargo
Copy link
Author

I did, I had to revert to 0.9.0. I updated the post after you read it.

@ToddAndMargo
Copy link
Author

i am trying on both Fedora 25 and RHEL 7.3 (clone). Both stop me with an idiot sudo on my user name ( I edited the sh file on Fedora and substituted dnf for yum). Maybe I just should wait.

@metalefty
Copy link
Member

RHEL 7 (and clones) are OK. Try it on RHEL clone but don't on Fedora 25. Not tested on Fedora at all.

@ToddAndMargo
Copy link
Author

Sudo request for documentation:
metalefty/X11RDP-RH-Matic#41

Fedora request:
metalefty/X11RDP-RH-Matic#42

@metalefty
Copy link
Member

If you have both Fedora and RHEL clone, try it on RHEL.

@ToddAndMargo
Copy link
Author

I can't get past the idiot sudo error on either. That would be error #41 above

@metalefty
Copy link
Member

That is your issue. If you don't have root privilege, you shouldn't run RH-Matic on the system.

@ToddAndMargo
Copy link
Author

I have root privileges! I tried running it as root and it wagged the finger at me and exited! I hate sudo. I use su instead

@bladerdorf
Copy link

bladerdorf commented Apr 3, 2017

I've built the latest 0.9.2 version with xorgrdp and fuse on Linux Mint 18.10 x64 and enabled Mate desktop for xsession.
When connecting from Windows 7 with mstsc.exe, clipboard from Windows to Linux do NOT work.
Everything else seems to be fine. Should I wait for the next release?

@ophers
Copy link

ophers commented Apr 18, 2017

I had the same problem. Looked elsewhere in google-land, then read this evolved thread ...
Suddenly it struck me!
VNC clipboard only works if vncconfig is running in the background.
So I type in a terminal: vncconfig -nowin& ... and voila; Clipboard is now working!

@bladerdorf
Copy link

bladerdorf commented Apr 19, 2017

I've built the latest 0.9.2 version with xorgrdp and fuse on Linux Mint 18.10 x64 and enabled Mate desktop for xsession.
When connecting from Windows 7 with mstsc.exe, clipboard from Windows to Linux do NOT work.

Actually, text copy/paste is working now. The only thing I cannot do - is to copy a file from Win to Mint via RDP.
What can I do to fix it?

@ToddAndMargo
Copy link
Author

Got some new symptoms for you guys.

Client:
$ cat /etc/redhat-release: Scientific Linux release 7.3 (Nitrogen
$rpm -qa *rdp*
freerdp-nightly-2.0-0+020170131033816.2831.git58cc996.x86_64
freerdp-plugins-1.0.2-10.el7.x86_64
freerdp-libs-1.0.2-10.el7.x86_64

Server:
$ cat /etc/redhat-release: Fedora release 25 (Twenty Five)
$ rpm -qa xrdp: xrdp-0.9.2-5.fc25.x86_64

Okay, now the fun begins!

If you copy () something to the clipboard on the client, then past () it into the server (leafpad), the connection immediately closes. When you log back in, the text did indeed paste to the client.

And it gets more fun. On the server, if you open a terminal as a user and run
$ vncconfig -nowin &
Then copy something to the clipboard on the client, the connection immediately terminates. No paste involved.

PleaseFixPleaseFixPleaseFixPleaseFixPleaseFixPleaseFixPleaseFix

Many thanks,
-T

@yoru74
Copy link

yoru74 commented Aug 2, 2017

Running F25 with xrdp-0.9.2-12.fc25 and xorgxrdp-0.2.3-1.fc25. Everything works fine with Xorg, and faster!

The trick is to add the file /etc/X11/Xwrapper.config with a single line:
allowed_users = anybody
otherwise Xorg does not starts because the default is to allow X11 only if you are on the console.

To avoid the choice between Xvnc and Xorg on the client side, just comment the [Xvnc] section in /etc/xrdp/xrdp.ini and modify the 'autorun' line as: autorun=Xorg". The rest of the setup is OK out of the box.

To run your favorite Windows Manager without going through the generic startup, you can add a '.xinitrc' file in your home directory (with exec permissions) containing the following lines:

#!/bin/sh
if [ -d /etc/X11/xinit/xinitrc.d ]; then
    for f in /etc/X11/xinit/xinitrc.d/*; do
        [ -x "$f" ] && . "$f"
    done
    unset f
fi

exec mate-session
# Or whatever you like, like
# exec gnome-session --session=gnome-classic

see #755

@ToddAndMargo
Copy link
Author

ToddAndMargo commented Aug 2, 2017 via email

@yoru74
Copy link

yoru74 commented Aug 2, 2017

Just create it:
echo 'allowed_users = anybody' > /etc/X11/Xwrapper.config

otherwise the default value is used (console).

@ToddAndMargo
Copy link
Author

Okay, did that and changed /etc/xrdp/xrdp.ini's to autorun=Xorg.

New symptom: instead of after I log on and my screen going dark and then dying, I actually get to see my user's screen for two seconds, them it dies.

Any words of wisdom?

@ToddAndMargo
Copy link
Author

Does this have anything to do with bug:
Clipboard not working with xrdp:
#469 (comment)

As I remember, this bug also caused you to crash

@ToddAndMargo
Copy link
Author

okay. I changed my freexrdp runb string from "+clipboard" to "-clipboard" and now I no longer crash.

Not having the clipboard work is a YUGE pain in the neck. Do you have an tips on that?

@yoru74
Copy link

yoru74 commented Aug 3, 2017

okay. I changed my freexrdp runb string from "+clipboard" to "-clipboard" and now I no longer crash.

This is the bug with Xvnc, but it works with Xorg. Did you chose the right way on the login screen ?

@ToddAndMargo
Copy link
Author

"Did you chose the right way on the login screen ?"

What do you mean?

@yoru74
Copy link

yoru74 commented Aug 3, 2017

"Did you chose the right way on the login screen ?"

What do you mean?

Short answer: when you open the RDP session, you have the login screen, with the XRDP logo on top and a login/password form. On top of the login you have a drop-down menu where you can choose Xvnc or Xorg (or more stuff depending on your /etc/xrdp/xrdp.ini). You have to choose Xorg, Xvnc crashes with the clipboard.

Long answer: RDP is just the transmission protocol, on your Linux server you need a graphical environment. Xvnc simulates a physical graphic card, on which X11 will work as it does on a physical console. Then xrdp gets whatever is drawn on this card and sends it to the client. Another approach is to install the package xorgxrdp, which makes X11 work directly with RDP, bypassing the need of a graphic card. This is what makes Xorg faster than Xvnc.

You have other options too, if you want to access the physical graphical console via RDP, you can activate the X11vnc, which will attach a VNC session to a running X session on a physical graphic card. Many other possibilities are commented out in the xrdp.ini file. In all cases, xrdp will synchronize a physical display, keyboard, mouse, etc on a remote client with a local graphical display. It will send graphics to the RDP client and transmit keyboard and mouse events to the RDP server.

X11 was written to do the same thing, but the server runs on the client side. Your window manager and graphical programs running on a Linux server are clients of the X11 server running on your terminal. Xorgxrdp is a lightweight X11 server that will simply translate X11 <-> RDP.

Graphical user interfaces are easy to use but extremely complex to implement. We have a huge stack of standards, from cables to protocols, that make the whole thing work (most of the time ;-). Don't feel bad if this seems complex to you, it IS complex!

@ToddAndMargo
Copy link
Author

ToddAndMargo commented Aug 3, 2017 via email

@yoru74
Copy link

yoru74 commented Aug 3, 2017

I have a choice of X11rdp, Xvnc, or Xorg

Xvnc: I am able to log in as long as I have the clipboard
(-clipboard) disabled

Xorg: with +clipboard, after entering my password and attempting
to show my screen, I die. With -clipboard, after entering
my password, I get a blank cyan screen.

X11rdp: after entering my password, just gives me a blank
cyan screen (with or without the clipboard).

Comment out the X11rdp and Xvnc sections in your /etc/xrdp/xrdp.ini file and restart xrdp (systemctl restart xrdp). X11rdp is used to link to an existing X11 session on the server, and Xvnc is buggy. Focus on Xorg.

Verify that xorgxrdp is installed on the server, and that you created the Xwrapper.config as stated above (dnf install xorgxrdp; cat /etc/X11/Xwrapper.config).

You can see the command that is launched by xrdp in /var/log/xrdp-sesman.log. You should see something like this:

setpriv --no-new-privs Xorg :21 -auth .Xauthority -config xrdp/xorg.conf -noreset -nolisten tcp -logfile .xorgxrdp.%s.log

Somehow your Xorg is not able to start. Login via ssh as the user that will use RDP (or simply "su - your_user" if you are already logged in as root), and run the same command from a shell, starting from Xorg (the 'setpriv --no-new-privs' is just to limit the privileges of the X server). You will get more information why it is not running.

@ToddAndMargo
Copy link
Author

ToddAndMargo commented Aug 3, 2017 via email

@ToddAndMargo
Copy link
Author

Comment out the X11rdp and Xvnc sections in your /etc/xrdp/xrdp.ini file

done

and restart xrdp (systemctl restart xrdp). X11rdp is used to link to an existing X11 session on the server, and Xvnc is buggy. Focus on Xorg.

done

Verify that xorgxrdp is installed on the server,

It is:

rpm -qa xorgxrdp

xorgxrdp-0.2.3-1.fc25.x86_64

and that you created the Xwrapper.config as stated above (dnf install xorgxrdp; cat /etc/X11/Xwrapper.config).

I have an Xwrapper.conf but not a ".config":

cat /etc/X11/Xwrapper.conf

allowed_users = anybody

You can see the command that is launched by xrdp in /var/log/xrdp-sesman.log. You should see something like this:
setpriv --no-new-privs Xorg :21 -auth .Xauthority -config xrdp/xorg.conf -noreset -nolisten tcp -logfile .xorgxrdp.%s.log

tail /var/log/xrdp-sesman.log

[20170804-22:41:27] [INFO ] starting xrdp-sesman with pid 4468
[20170804-22:41:27] [INFO ] listening to port 3350 on 127.0.0.1

Somehow your Xorg is not able to start. Login via ssh as the user that will use RDP (or simply "su - your_user" if you are already logged in as root), and run the same command from a shell, starting from Xorg (the 'setpriv --no-new-privs' is just to limit the privileges of the X server). You will get more information why it is not running.

from an ssh shell as the user:
$ setpriv --no-new-privs Xorg :21 -auth .Xauthority -config xrdp/xorg.conf -noreset -nolisten tcp -logfile .xorgxrdp.%s.log
/usr/libexec/Xorg.wrap: Only console users are allowed to run the X server

Attempting to log in still gies me a big blank cyan screen. And ssh shows:

tail /var/log/xrdp-sesman.log

[20170804-22:51:44] [DEBUG] Closed socket 7 (AF_INET 127.0.0.1:3350)
[20170804-22:51:44] [DEBUG] Closed socket 8 (AF_INET 127.0.0.1:3350)
[20170804-22:51:45] [INFO ] setpriv --no-new-privs Xorg :11 -auth .Xauthority -config xrdp/xorg.conf -noreset -nolisten tcp -logfile .xorgxrdp.%s.log
[20170804-22:51:54] [ERROR] X server for display 11 startup timeout
[20170804-22:51:54] [CORE ] waiting for window manager (pid 18082) to exit
[20170804-22:51:55] [ERROR] X server for display 11 startup timeout
[20170804-22:51:55] [ERROR] another Xserver might already be active on display 11 - see log
[20170804-22:51:55] [DEBUG] aborting connection...
[20170804-22:51:55] [CORE ] window manager (pid 18082) did exit, cleaning up session
[20170804-22:51:55] [INFO ] ++ terminated session: username todd, display :11.0, session_pid 17886, ip 50.37.22.95:34496 - socket: 12

Uncommenting [Xvnc] and using Xvnc allows me to log in. I just have to make sure I use "-clipboard" or I crash out.

@yoru74
Copy link

yoru74 commented Aug 7, 2017

The name is "Xwrapper.config" not "Xwrapper.conf", this is what gives you the error "Only console users are allowed to run the X server"

You are very close to make it work!

@ToddAndMargo
Copy link
Author

The name is "Xwrapper.config" not "Xwrapper.conf", this is what gives you the error "Only console users are allowed to run the X server"

That worked. The primary clipboard does not work (mouse over, middle click), but clipboard does (ctrl c ctrl v). And I have +clipboard enabled and no crashing.

I am now getting an Xfce Policy Kit error, but it does not affect operation:

image

@yoru74
Copy link

yoru74 commented Aug 9, 2017

Well, you are done, that nice dialog box is shown on your RDP connection!

Nothing to do with this thread, but the error probably comes from 2 policy agents running at the same time (like XFCE and GTK). Check your process list and installed packages.

@ToddAndMargo
Copy link
Author

ToddAndMargo commented Aug 9, 2017 via email

@metalefty
Copy link
Member

The discussion is no longer clipboard issue but polkit issue, closing.

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

No branches or pull requests