2

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.

  • does the server have permission to access xserver? I had a similar issue with running gui programs as root. I had to give root access to my display server. – ravery Jun 28 '17 at 08:19
  • I'm not sure, but I don't think that that applies to xpra server – Jorge Suárez de Lis Jun 28 '17 at 09:18
  • When you are connected to your headless server via ssh, you can use "ssh tunneling" for the access to your local X server. Call ssh -X user@host and make sure, that X11 tunneling is enabled on your server (Set X11Forwarding yes in /etc/ssh/sshd_config. This should then generate a display on your host (usually DISPLAY=localhost:10.0, depending on the server configuation). – ridgy Jun 28 '17 at 10:43
  • I can't connect directly to the server. I'm just throwed there by a queue system (that, of course, isn't forwarding anything). As I tried to explain in my question, I can't access directly the server from my laptop nor I can change any configuration in the server. [Edit: Maybe I didn't explain it properly until now, I'll just edit the question] – Jorge Suárez de Lis Jun 29 '17 at 07:15
  • Where are you setting the :9100? Also, is your firewall blocking that port from making it out? – ben-Nabiy Derush Jul 11 '17 at 19:47
  • This might have some helpful info for you as well... https://askubuntu.com/questions/203173/run-application-on-local-machine-and-show-gui-on-remote-display – ben-Nabiy Derush Jul 12 '17 at 17:57

1 Answers1

1

This is not a complete answer, as there is not really enough info to give one, but hope it helps.

The list of things which could be interfering are:

  • Firewall on Server blocking outbound traffic
  • Firewall on Laptop blocking inbound traffic
  • Firewall on Router / Network device blocking traffic
  • Improper NAT setup on LAN where laptop is.
  • Improper permissions on laptop desktop session files. Desktops are picky...

That is a start, and unless you can rule them out, probably a portion of what is stopping you. I would also give a read over this answer posted by Paul Hänsch - Run application on local machine and show GUI on remote display