1

I'm attempting to display an X-capable program on another display within a local network.

I have an X server running on a host with IP 192.168.4.79, using display :0. I have another host (192.168.4.23) that I'd like to act as the client: that is, it should run the program and display its results to the server at 192.168.4.79:0.

On the host running the server I use xhost to add the client IP to the access control list:

$ xhost +192.168.4.23

I then extract the relevant contents of ~/.Xauthority on the server host and merge it to ~/.Xauthority on the client host.

$ xauth extract - $DISPLAY > xauth_extract

Then, copy it to over to the client host with ftp. And, on the client:

$ xauth merge xauth_extract

Alternatively, on clients supporting ssh (see note at the bottom):

$ xauth extract - $DISPLAY | ssh [email protected] xauth merge -

However, if I run (on the client):

$ xterm -display 192.168.4.79:0

I see the error: xterm: Xt error: Can't open display: 192.168.4.79:0.

The hosts can communicate just fine: ping -c1 192.168.4.79. I also don't believe this is a firewall issue. First, I have my firewall setup on the host running the server to accept any connections from within the local network:

ipset create sjlan hash:net
ipset add sjlan 192.168.4.0/22
iptables -I INPUT -m set --match-set sjlan src -j ACCEPT

Moreover, if I temporarily disable the firewall on the server host (systemctl stop firewall), I get the same error.

What could I be missing here? How can I troubleshoot this?


I'm deliberately not using ssh for this, so please no answers for how to accomplish this with X11Forwarding. I already know how to do that and am deliberately not using it because I need this to work with a host running a 30 year old hp-ux instance (using X11R5) that does not have and cannot (with any non-trivial effort) be setup to use ssh.

Also, I'm first testing this with two modern Linux machines, both running X11R7, so the present issue is not some incompatibility between the implementation of X11 on the new machine and the one on the old machine.

I should also mention that the only thing that has worked so far is to run a server on the HP-UX machine and have the host I want to act as the server, act as the client. I was able to launch xterm from 192.168.4.79 and see its display and interact with it on the HP-UX machine. So, it appears that some setting on the new machines is blocking access. I would expect that the old machine has a much lower barrier in terms of security.

1
  • have you had a chance to run wireshark on either machine and look for the X11 packets? Maybe that offers some insight. May 29, 2022 at 19:30

1 Answer 1

1

X servers on most modern system have listening on IP addresses disabled by default (as it is inherently insecure), and only use the local domain sockets.

Details depend on your distro, but see man Xserver for the -listen and -nolisten arguments. You'll need to find out what starts the X server on your distro (display manager, systemd, ...), or you could start a second one to play around with the options (if your distro allows that).

2
  • 1
    That was it! Note that in my case, removing -nolisten wasn't enough. I also had to add -listen tcp.
    – MattHusz
    May 29, 2022 at 20:40
  • I tried it on Ubuntu and it did not work
    – lnee
    Jun 2, 2022 at 1:11

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .