0

I run a second xserver through tty2 this way:

export DISPLAY=:1
xinit -- :1

I don't have any .xinitrc file defined and I get only a black screen with xterm window. It looks like that running xterm is hardcoded in xinit bin. Is it possible to run xserver without that xterm window ? When I close xterm the screen is redirected back to tty2 and there is a messasge:

xinit: connection to xserver lost

Does it mean that xserver can't be run without any "regular" window ? (there is always also a root window)

  • How do you run your first X server? A display manager (gdm, kdm, xdm)? Why don't you configure the display manager to run the second server in the same way it runs the first server? – dirkt Jul 23 '17 at 19:34
  • I use UBuntu 16.04 LTS , so there is lightdm. I play with a minimal X11 setup just for learning purpose. – Irbis Jul 23 '17 at 19:50
  • Just start X :1 without xinit. – mviereck Jul 24 '17 at 14:37
2

The manual page is the place to start. From "man xinit":

If no specific client program is given on the command line, xinit will look for a file in the user's home directory called .xinitrc to run as a shell script to start up client programs. If no such file exists, xinit will use the following as a default:

    xterm -geometry +1+1 -n login -display :0

The X server will wait until that program stops before shutting down. You can certainly use different programs, including those that do not open a window. But without a terminal (or window manager) the X display will be hard to use.

Further reading: startx manual page.

  • So when using xinit I can't close xterm and still have xserver running, right ? (I know that such setup doesn't make much sense but I want to check all options. I can later open xterm again remotely, for example through ssh). startx internally also uses xinit, what are other posiblities to run xserver ? – Irbis Jul 23 '17 at 19:55
  • 1
    The X server expects to have a client program running, which could be xterm or some other application. Usually the "other" application is a window manager. Once there are no clients, X stops :-) – Thomas Dickey Jul 23 '17 at 20:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.