Is it possible to run xserver without any window?

5,379

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.

Share:
5,379

Related videos on Youtube

Irbis
Author by

Irbis

Updated on September 18, 2022

Comments

  • Irbis
    Irbis over 1 year

    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)

    • dirkt
      dirkt almost 7 years
      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?
    • Irbis
      Irbis almost 7 years
      I use UBuntu 16.04 LTS , so there is lightdm. I play with a minimal X11 setup just for learning purpose.
    • mviereck
      mviereck almost 7 years
      Just start X :1 without xinit.
  • Irbis
    Irbis almost 7 years
    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 ?
  • Marius
    Marius almost 7 years
    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 :-)