I wonder, why isn't this working?

$ screen
$ Xvfb -screen :1 1024x768x16 &
[1] 17540
$ _XSERVTransSocketINETCreateListener: ...SocketCreateListener() failed
_XSERVTransMakeAllCOTSServerListeners: server already running
Fatal server error:
(EE) Cannot establish any listening sockets - Make sure an X server isn't already running(EE) 

And then after Ctrl+C or +D I run this:

$ ps -C Xorg
  PID TTY          TIME CMD

And, indeed, the X server isn't running. Why the error then?

$ uname -a
Linux ip-123456-generic #102-Ubuntu SMP Tue Aug 11 14:29:36 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux


enter image description here

  • 6
    please don't post images, copy the text. The above font messages are just warnings, unless you end up with no fonts at all. Are there any fatal messages beginning EE?
    – meuh
    Sep 30, 2015 at 9:47
  • @meuh, it's more convenient for me to post images.
    – Incerteza
    Sep 30, 2015 at 10:09
  • 6
    @アレックス so your convenience is more important than those who are taking valuable time out of their day to answer your question? Apr 27, 2020 at 18:31

2 Answers 2


Make sure you delete the following files before starting Xvfb as for ":1" screen:

rm /tmp/.X11-unix/X1
rm /tmp/.X1

Xvfb simply considers Xorg server running if it cannot create these "locking" files. This can be a case when another user created them on the same screen such as root, and you are starting Xvfb as a user that have no rights to delete the "locking" files. In other words Xvfb tries to delete and create "locking" files and if it fails it shows an error you've faced.

  • The OP really should have accepted this answer. This worked for me. Thanks! Dec 14, 2016 at 18:53
  • 1
    This answer does not work for me. OP's error only happens after I run the commands listed in this answer.
    – Yvon
    Jun 29, 2017 at 1:56
  • 1
    Sometimes it is necessary also sudo rm /tmp/.X11-unix/X0 Jan 25, 2019 at 21:08
  • 2
    What if those folders do not exist in the /tmp directory? Apr 27, 2020 at 18:25
  • rm /tmp/.X1-lock maybe
    – Micha93
    Jan 25, 2021 at 8:56

You probably meant to run:

Xvfb :1 -screen 0 1024x768x16 &

where the :1 is an argument on its own and means use the default network connection +1, i.e. you will need to export DISPLAY=:1 in the environment to connect to this display. Also, the X11 server may run under the name X instead of Xorg.

  • thanks, but that led to other errors, please see my update.
    – Incerteza
    Sep 30, 2015 at 4:38

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .