How do chrooted X clients connect to server?

Pavel Krc debian at
Thu May 8 06:55:50 PDT 2014

Hi all,

I've been using chrooted Debian (and other distros) for years, but there's one thing that baffled me many times. While many users seek help trying to make chrooted X programs work (mostly due to missing DISPLAY=... or xauth problems), I cannot find a reason why this works for me when it clearly shouldn't. I'm running XOrg outside the chroot, which listens only on a socket /tmp/.X11-unix/X0 and no TCP port, as usual. When preparing the chroot, I don't bind /tmp to new root - I mount a new tmpfs, so chrooted /tmp is empty (checked). Therefore, the X clients should have no way of connecting the server, yet they work without any problems. I have studied source codes of Xlib and XCB and found only the expected behavior of trying /tmp/.X11-unix/X{display} and tcp port 6000 + {display} (which is closed). Any ideas how this works or where I should continue my search?



More information about the xorg mailing list