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

Channel.request_x11() either doesn't work or needs a good demo #40

Open
fatboy92 opened this issue Sep 12, 2011 · 5 comments
Open

Channel.request_x11() either doesn't work or needs a good demo #40

fatboy92 opened this issue Sep 12, 2011 · 5 comments

Comments

@fatboy92
Copy link

A number of users report not being able to get Channel.request_x11() to work correctly in situations where ssh -X works fine. We need to figure out whether this functionality is currently broken, or if it simply requires additional non-obvious code in order to work (in which case we need to improve the docs/demos.)

Originally submitted issue from @fatboy92:

Hi all,
first of all: thanks for that module, I feel it gives me more control, than pexpect.

Now, here is my question:
I am trying to use the channel method request_x11 (and yes I looked at the example programs). Just like when you do ssh -X.

When I do, the process is started as expected but no window is displayed. Same behaviour with invoke_shell(), the display variable is set correctly (localhost:10 or similar), but again no window is displayed. I checked with wmctrl, it isn't there, not even outside the visible area of the screen.

Any thoughts?

Many thanks for all answers.
H. Witsch

bitprophet added a commit that referenced this issue Sep 26, 2012
(cherry picked from commit c27915d55182cfa22c517c2d6d887316fc89c80a)
@bitprophet
Copy link
Member

N.B. above "commit reference" is unfortunately for another repo that got merged into this one. It is 100% unrelated.


Making this ticket the clearinghouse for "wtf X11?". Other instances of people having problems with this:

Unfortunately I haven't used the X11 bits in Paramiko myself so I have no immediate or obvious fix (and I have other higher priorities re: digging in :(). However I'm more than willing to assist anybody who has a clue, or who can at least be available on eg IRC to help test/debug things on their end.

@garyvdm
Copy link
Contributor

garyvdm commented Oct 15, 2012

I wrote a working example for one of the stackoverflow questions. See http://stackoverflow.com/a/12903844/72911

It still needs some work, for example, I want to make it handle multiple connections. But it is a start....

@dnozay
Copy link

dnozay commented Oct 19, 2012

As Gary pointed out in the stackoverflow answer, the handler for x11 requests needs to:

  • accept the connection
  • open a connection to local display.
  • add descriptor for both remote end and local display to poll / select() fd list

then while there's data to handle

  • forward data back and forth between remote end and local x11 display.

@bitprophet
Copy link
Member

Thanks @garyvdm & @dnozay! Still don't have time to dig into this in full, but it sounds like the issue is "no concrete example included in the source" -- not "X11 channel support is actually broken." Yes? no?

Gary's link implies "yes", so I'd definitely merge a pull request adding @garyvdm's example as a new file in demos/, with the notes inlined as comments or as docstrings (module-level or otherwise).

@amrit-poudel
Copy link

amrit-poudel commented Oct 1, 2021

Tried everything mentioned on this thread, but nothing seems to work on macosx big sur (local machine) with python 3.9 and xquartz installed on the macosx. ssh -X on the terminal works without any issue.. Main issue is echo $DISPLAY on macosx returns /tmp/…./org.xquartz:0 which does not work with xlib_connect.get_display(). Then paramiko’s channel.request_x11() fails. Its been a decade, and a workable solution still doesn’t seem to exist. I would truly appreciate if anyone could offer a workable solution/code to this problem. Thanks!

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

5 participants