I'm connecting to a server with a headless restricted environment, based on Debian Jessie, via SSH. I'm throwed there by a jobs queue system, so I can't just use X11 Forwarding options with SSH.
I'm on Ubuntu on my laptop. I want to be able to run X11 applications on that server, but there is no X server running.
I'm trying to use an X server on my laptop listening to a TCP port and then connecting to it from the other machine, but I'm definitely doing something wrong.
I'm using Xpra on my laptop for simplicity, since I don't have TCP enabled on my primary X server.
laptop$ xpra --bind-tcp=0.0.0.0 start :100
laptop$ xpra attach :100
Some simple checks to prove that xpra seems to be running:
laptop$ netstat -putan | grep 9100
(Not all processes could be identified, non-owned process info
will not be shown, you would have to be root to see it all.)
tcp 0 0 0.0.0.0:9100 0.0.0.0:* LISTEN 28376/python
server$ telnet 172.16.243.95 9100
Trying 172.16.243.95...
Connected to 172.16.243.95.
Escape character is '^]'.
P<l10:disconnect42:invalid packet format, not an xpra client?eConnection closed by foreign host.
Also, I'm able to show windows from the same machine:
laptop$ DISPLAY=:100 xterm # this just works
However, I'm not able to do the same from the server.
server$ DISPLAY=172.16.243.95:9100 xterm
xterm: Xt error: Can't open display: 172.16.243.95:9100
Am I specifying the DISPLAY
variable correctly? Maybe that's the problem, but I can't find comprehensive docs about how that variable works, or how are translated TCP ports to display numbers.
ssh -X user@host
and make sure, that X11 tunneling is enabled on your server (SetX11Forwarding yes
in/etc/ssh/sshd_config
. This should then generate a display on your host (usuallyDISPLAY=localhost:10.0
, depending on the server configuation). – ridgy Jun 28 '17 at 10:43