I' try to play with Xephyr under tty:
$ DISPLAY=:0 Xephyr -ac -screen 800x600 -host-cursor
Xephyr cannot open host display. Is DISPLAY set?
As u can see, DISPLAY has been set, but Xephyr still cannot see it.
Xephir runs on X11. If you are running on a tty (i.e., virtual console on Linux, no graphics), there is no X server to connect to. Ditto if you are running Wayland on your display server, no X server around.
DISPLAYcannot be just anything. For:0there should be a/tmp/.X11-unix/X0unix socket (or an@/tmp/.X11-unix/X0abstract unix socket on Linux) and an X11 server listening on it. AndDISPLAYis not always:0. On some distros, it's something like:8or similar. When forwarded via ssh, it'slocalhost:10.0. – Mar 07 '20 at 10:49-ac? It's pointless. Is that copied from somewhere else? Where from? – Mar 07 '20 at 10:53FOO=bar cmdwill exportFOOin the environment ofcmd, just try withFOO=bar printenv FOO. And:0is enough, no need of:0.0. – Mar 07 '20 at 12:11export DISPLAY=:1.0, and (b) Display is an arg::Xephyr -ac -screen 1024x768 -br -reset -terminate 2> /dev/null :1 &. It's an X-on-X server and apparently abhors :0.If we do not change it, Xephyr won't get any data forwarded to it.– Paul_Pedant Mar 07 '20 at 19:55Xephyris a nested X server. You're mixing up the displayXephyrruns on with the one it creates for other X11 clients to run on. And no, there's no need of.0, screen 0 is the default anyway (and the only one in 99.99% of cases). – Mar 07 '20 at 20:28:1or:7(or whatever free display name) to their command, as inDISPLAY=:0 Xephyr :1 -screen 800x600 -host-cursor, thenXephyrwill die with an error likeAnother server is already active for display :0. But they haven't reached that point yet. TheirXephyrhas yet to connect to the display it should run in. – Mar 07 '20 at 20:42DISPLAY=:19 Xephyr :1or (on Linux)unshare -Urnm sh -c 'mkdir -p /tmp/junk; mount -B /tmp/junk /tmp/.X11-unix; Xephyr :1'(which runs in a namespace where it doesn't have access to/tmp/.X11-unix/X0or@ /tmp/.X11-unix/X0. It's nothing special; the error has been that obtuse since 40 years or so. – Mar 07 '20 at 22:06