Unable to start X Server with no screens, no xorg.config to edit

12,560

You're looking for headless with X. It's little bit described on ArchWiki, there's shown a way how to do this.

There's another alternative to run headless X11 compatible server: Xvfb(X virtual framebuffer). It's a display server that performs all graphical operations in memory without showing any screen output.

startx is just front-end for xinit which setups X.Org server and clients(Window Manager, Desktop Environment,...). Among other things, it reads client side configuration from ~/.xinitrc.

To run common user session inside virtual framebuffer:

  1. start Xfvb and setup environment - export proper environment variables
  2. execute ~/.xinitrc script that defines X client setup of user

You may alternatively execute custom commands, that would setup WM, DM, etc.

Share:
12,560

Related videos on Youtube

MichaelMitchell
Author by

MichaelMitchell

Updated on September 18, 2022

Comments

  • MichaelMitchell
    MichaelMitchell about 1 year

    I am trying to start the X server (I have all the packages installed).

    The problem I am having is that the server is offsite, has no screen and never has had a screen connected to it and as a result X Server has never run which means there is no xorg.config which from other posts I see can be used to start X server with out any screens.

    I have tried running X -configuration (can't remember the command but I used the right one) and it output the same message that I get when I do startx which is Fatal Error: no screens

    I need to find a way to start X server without connecting a screen to it.

  • MichaelMitchell
    MichaelMitchell almost 9 years
    Thank you so much! I needed the frame buffer for what I am doing as well. I will try those out and report back.
  • MichaelMitchell
    MichaelMitchell almost 9 years
    I followed the directions of the ArchWiki link and I am still getting the same error, pastebin.com/AfF024iQ I am not able to reboot the server, I can only attempt to start X server with sudo startx
  • MichaelMitchell
    MichaelMitchell almost 9 years
    I also attempted to start a display with Xvfb and then sudo startx but that did not have any impact.
  • intractve
    intractve almost 9 years
    Ehm... Xvfb starts it's own X server. startx is front-end for xinit and it starts classic X server. So you don't startx after starting Xvfb. Why do you want to execute startx command?
  • MichaelMitchell
    MichaelMitchell almost 9 years
    I was told startx starts the x server, but if I can use Xvfb for an X server I guess I don't need to. When using OpenGL in C++ do I still link to X11 or are their different libraries to link to for Xvfb?
  • MichaelMitchell
    MichaelMitchell almost 9 years
    I was able to run my program in similar manner as what is shown in this stackoverflow.com/questions/6281998/… Thank you for your help
  • MichaelMitchell
    MichaelMitchell over 8 years
    I am working on a project that uses rendering for analytics, so it outputs a sort of texture in the form of a png or jpg once it finishes, so there isn't a need to view it. Thank you for the suggestion, I will look into it since it may help during development to be able to see the output live.