Unable to start X Server with no screens, no xorg.config to edit
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:
- start
Xfvb
and setup environment -export
proper environment variables - execute
~/.xinitrc
script that defines X client setup of user
You may alternatively execute custom commands, that would setup WM, DM, etc.
Related videos on Youtube
MichaelMitchell
Updated on September 18, 2022Comments
-
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 dostartx
which isFatal Error: no screens
I need to find a way to start X server without connecting a screen to it.
-
MichaelMitchell almost 9 yearsThank you so much! I needed the frame buffer for what I am doing as well. I will try those out and report back.
-
MichaelMitchell almost 9 yearsI 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 almost 9 yearsI also attempted to start a display with Xvfb and then
sudo startx
but that did not have any impact. -
intractve almost 9 yearsEhm...
Xvfb
starts it's own X server.startx
is front-end forxinit
and it starts classic X server. So you don'tstartx
after startingXvfb
. Why do you want to executestartx
command? -
MichaelMitchell almost 9 yearsI 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 almost 9 yearsI 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 over 8 yearsI 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.