2

I have several network namespaces in my Fedora 21 VM. How can I access display from whithin the network namespace?

    # ip netns exec n1 xlogo
    Error: Can't open display: localhost:10.0

1 Answer 1

3

If you access X11 over UNIX sockets then it should "just work". Apparently UNIX domain sockets are not segregated by network namespace.

Since you are getting an error, then I guess you are using TCP, not UNIX sockets.

To connect to X11 with TCP, you will have to proceed the same way you would in order to access any other network service across network namespace boundaries: route the traffic through the network into the other namespace. For example create a pair of veth network interfaces to act as a tunnel between namespaces, or go through a real router. Either way you will have to set up IP addresses and routing.

It may be simpler if you can arrange to connect through UNIX sockets instead of TCP. That is normally the default anyway. Try just :10 as the $DISPLAY instead of localhost:10? That might force it to use UNIX. If your X11 server or proxy is only listening on a TCP socket then this won't work.

2
  • Isn't this DISPLAY=unix/:0 the proper way to access the X11 server thru a Unix domain socket? Nov 10, 2015 at 13:38
  • @MariusMatutiae I have never seen that syntax with the unix/ prefix but I tried setting my $DISPLAY manually to that and it does seem to work.
    – Celada
    Nov 10, 2015 at 17:15

You must log in to answer this question.

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