Forwarding X11 without SSH? How do I run local apps on another Pc running X Server?

Viewed 6646

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?

3 Answers

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

Related