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
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.