Domanda

I am using Cygwin X and Debian. I can forward my X session via SSH but what happens is that I seem to loose the display forwarding in the X session once in a while (from Cygwin to Linux). So i am guessing that that is an imnplementation thing with Cygwin because I never loose X11 display in the same ssh session when I use Linux to Linux.

This also happens when a X11 forwarded app tries to fork another process lets say I run Thunderbird and I click on a url inside an email. Naturally Thurderbird will try to start the default web browser but it is not doing it with Cygwin X server and here is the message I get when SSH session gives up the display for various reasons that I am not able to know.

"Error: cannot open display: localhost:10.0"

The other issue is that since the ssh gives up the display variable, I have to restart my ssh session to get it working which also kills other apps that I might be running during the ssh session.

Anyway after struggling with this for a while I am thinking that I want to be able to open my apps on another display without using ssh forwarding. I am using it internally and it is almost a closed lan so I am not worried about the security for now. I just want to be able to run the app on the Linux then see the app on the Pc that is running Cygwin.

I tried basic DISPLAY variable thing like "export DISPLAY=MY_CYGWIN_PC_IP:0.0" (on Linux Pc) but it does not work.

So I am wondering about how I can achieve this. What are the proper settings to achieve what i need?

È stato utile?

Soluzione

Your direction was OK. export DISPLAY is what you want. But it is not enough.

On the target, you need to type

xhost +from.where.the.windows.are.coming.com

It gives the X server the permission to allow remote windows from this computer.

Beware, it is not really secure! A possible attacker could not only windows shown by you, but even control your mouse/keyboard. But for simple solutions, or if you can trust the remote machine and the network between you, it may be ok.

If not, there is an advanced authorization, based on preshared keys. It is named xauth. Google for xauth.

The Xorg server has an option to disable the remote windows, and there are distributions, (f.e. ubuntu!) who turn this option by default on. You can test it - if you can telnet to the tcp port 6000, it is allowed.

Altri suggerimenti

If you are using ssh -X, don't. Use ssh -Y

Cygwin XWin server randomly loses connection

Basically to work as old times , we need enable xdmcp on display manager and use X11 , Xwayland seems to me that doesn't work either.

sddm doesn't support xdmcp , but gdm does , you need edit /etc/gdm/custom.conf and add

[security]
DisallowTCP=false

[xdmcp]
Enable=true

xhost + ip_of_remote_computer
echo $DISPLAY (the number of the display usually :0 or :1)

after you can verify :

netstat -l | grep xdmcp

udp        0      0 0.0.0.0:xdmcp           0.0.0.0:*

lsof -i :xdmcp

COMMAND    PID USER   FD   TYPE   DEVICE SIZE/OFF NODE NAME
gdm     862335 root   12u  IPv4 71774686      0t0  UDP *:xdmcp

on remote host :

export DISPLAY="ip_of_server:0" (see if is 0 or other number in echo $DISPLAY on server mention above ) 
xclock &

References:
http://www.softpanorama.org/Xwindows/Troubleshooting/can_not_open_display.shtml
https://tldp.org/HOWTO/html_single/XDMCP-HOWTO/
https://wiki.archlinux.org/title/XDMCP

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top