Docker Community Forums

Share and learn in the Docker community.

Error: Can't connect to X11 window server using 'localhost:0.0' as the value of the DISPLAY variable

docker

(Zhengxie) #1

I started docker container using:

docker run --privileged -it wexac/testimage:v1 /bin/bash -il
The base image is “centos”

Then in the container shell, I need to run a ./firststep.sh for a application, which requires GUI. the guide says I run it as:
“export DISPLAY=display_server_host_name:0.0
firststep.sh

The error I got is:
firststep.sh: Starting First Steps.
Exception in thread “main” java.awt.AWTError: Can’t connect to X11 window server using ‘localhost:0.0’ as the value of the DISPLAY variable.
at sun.awt.X11GraphicsEnvironment.initDisplay(Native Method)
at sun.awt.X11GraphicsEnvironment.access$200(X11GraphicsEnvironment.java:79)
at sun.awt.X11GraphicsEnvironment$1.run(X11GraphicsEnvironment.java:140)
at java.security.AccessController.doPrivileged(AccessController.java:503)
at sun.awt.X11GraphicsEnvironment.(X11GraphicsEnvironment.java:88)
at java.lang.Class.forNameImpl(Native Method)
at java.lang.Class.forName(Class.java:273)
at java.awt.GraphicsEnvironment.createGE(GraphicsEnvironment.java:113)
at java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvironment.java:92)
at com.ibm.es.firststep.FirstSteps.(FirstSteps.java:289)

I then run
yum groupinstall “GNOME Desktop” "Graphical Administration Tools"
to install xOrg

But “startx” throws error:
(EE)
Fatal server error:
(EE) no screens found(EE)

How can I start the xServer in docker container, so that I can run “./firststep.sh” for the application?

thanks

Jen


(Adminoid) #2

I’m have same problem… I was awaiting solution…
I have macbook pro with Intel Iris 1536 MB video card
I use XQuartz with socat. firefox running ok, but startx command got error same you.