I'm attempting to start a program that requires rendering a window (Unity Game) on a remote server that doesn't have a display attached to it. I wouldn't want to use ssh -X to forward rendering commands to my local machine. I'm trying to run the program in headless mode but still making use of the remote server's GPU, or use Xvfb, but I cannot get it to work.

In the first step of this process, I try to determine whether X server is already running. Upon sshing into the remote server, I ran


and it returns empty string. I thought that this means the X server is not running (reference)

However, I encounter contradicting information:

  • When running ps ax | grep X, I get

    2149 tty1     Sl+    0:03 /usr/lib/xorg/Xorg vt1 -displayfd 3 -auth /run/user/121/gdm/Xauthority -background none -noreset -keeptty -verbose 3

    This means indeed X server is running (because of the Xorg executable). Running ps -C Xorg also shows PID 2149 (reference).

  • Also, when I run Xvfb :0.0, I get

    $ Xvfb :0.0
    ...SocketCreateListener() failed
    _XSERVTransMakeAllCOTSServerListeners: server already 
    Fatal server error:
    (EE) Cannot establis

    This again seems to indicate that an X server is already running on :0.0.

However (again), when I run xdpyinfo, the utility for displaying information about an X server, I get

$ xdpyinfo
xdpyinfo:  unable to open display "".


$ xdpyinfo -display :0.0
No protocol specified
xdpyinfo:  unable to open display ":0.0".

This seems to tell me again that the X server is not running.

What is going on? Is the X server running?

As you may be able to tell I'm a newbie to X-server related issues. Please feel free point out any problem with my steps above, and suggest ways to resolve this. Thanks! There's a lot to learn.

  • Here the author proposes a way to find the locally-running servers: (cd /tmp/.X11-unix && for x in X*; do echo ":${x#X}"; done). Can you try it? (It would be just enough to call ls /tmp/.X11-unix.)
    – sasha
    Apr 26 at 12:19
  • There is a file X0 in /tmp/.X11-unix
    – zkytony
    Apr 27 at 14:49
  • I managed to have a workaround on another server which definitely did not have X server running at first. I had to install Xorg and Xvfb, and I ran sudo Xorg :0.0 and my application was able connect to that server. Interestingly echo $DISPLAY is still an empty string, yet xdpyinfo :0.0 actually returns information.
    – zkytony
    Apr 27 at 14:55
  • echo $DISPLAY just outputs a value of the variable, whatever it is. If nobody has set it before, then it has no value (if anybody set it to a wrong value, then it has the wrong value). You might need setting $DISPLAY to a specific value (if you know a specific X server exists and want the subprocesses to use it by default), but getting the $DISPLAY doesn't really give any information except “somebody has set a specific value” or “nobody has set any value yet”.
    – sasha
    Apr 27 at 15:12
  • @sasha It seems like people have debated about whether $DISPLAY can be used to check X server is running: stackoverflow.com/questions/637005/… . I feel that xdpyinfo is probably the right way to check
    – zkytony
    Apr 28 at 12:58

Your Answer

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

Browse other questions tagged or ask your own question.