7

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.

4
  • check out the "xrdp" software. It allows for multiple headless X sessions to start, and you can connect to them remotely through several clients even rdesktop.
    – sivann
    Feb 1, 2015 at 9:07
  • Are we correct in thinking that you want headless X11: so you can run a program that insists on displaying stuff, but you don't want to look at? Feb 1, 2015 at 10:08
  • xrdp is not headless: it is a protocol converter. The head will be somewhere else. But it will be somewhere. Feb 1, 2015 at 10:09
  • @richard I am making an program that renders using OpenGL and I need to get an OpenGL context. The way I am trying to do this is by using glx which seems to require that you have X server running in order to get the GL context. Feb 1, 2015 at 17:31

2 Answers 2

10

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.

7
  • Thank you so much! I needed the frame buffer for what I am doing as well. I will try those out and report back. Feb 1, 2015 at 16:32
  • 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 Feb 1, 2015 at 17:23
  • I also attempted to start a display with Xvfb and then sudo startx but that did not have any impact. Feb 1, 2015 at 17:29
  • 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?
    – kravemir
    Feb 1, 2015 at 17:38
  • 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? Feb 1, 2015 at 17:52
0

I think you want some variant of vnc. It runs an X server on Linux machines and the result can be displayed remotely. If you don't want to see the screen anywhere use the older answers about headless X servers.

1
  • 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. Mar 4, 2015 at 22:03

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.