Docker error for GUI app: qt.qpa.xcb: could not connect to display, qt.qpa.plugin: Could not load the Qt platform plugin "xcb" "" even though

Viewed 1747

I am trying to install a GUI based software called Dragonfly as a container, since the software has conflicts with my host OS RHEL7. So I thought installing as a Docker container could be a solution, even though I am completely new with Docker. My Dockerfile looks like below:

FROM ubuntu
COPY DragonflyInstaller /Dragonfly/ 
WORKDIR /Dragonfly/

# Dependent packages for Dragonfly
ARG DEBIAN_FRONTEND=noninteractive #
ENV TZ=Europe/Berlin
RUN apt-get update && apt-get install -y apt-utils \
                                         fontconfig \
                                         libxcb1 \
                                         libxcb-glx0 \
                                         x11-common \
                                         x11-apps \
                                         libx11-xcb-dev \
                                         libxrender1 \
                                         libxext6 \
                                         libxkbcommon-x11-0 \
                                         libglu1 \
                                         libxcb-xinerama0 \
                                         qt5-default \
                                         libxcb-icccm4 \
                                         libxcb-image0 \
                                         libxcb-render-util0 \
                                         libxcb-util1 \
                                         freeglut3-dev \
                                         python3-pip \
                                         xauth

CMD ./DragonflyInstaller  

After building the corresponding Docker image, it cannot launch GUI based installer-window of Dragonfly. I am using the two following commands:

xhost +local:docker
sudo docker run -e DISPLAY=$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix: dragonfly

I tried various suggestions posted on different forums, accordingly, I tried various arguments for docker run, however, I am getting two errors every time, as below:

No protocol specified
qt.qpa.xcb: could not connect to display :340.0
qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

Available platform plugins are: minimal, xcb.

Could you please suggest me how to resolve this issue?

1 Answers

In fact I was logging in my machine with X2Go remote desktop client that provides its own desktop after log in. However, I also tried another remote login software called NoMachine which does not create its own display or desktop, rather it keeps original desktop for the remote user. When I tried with NoMachine, there was no errors.

So I guess, the above two errors are caused by remote desktop software X2Go.

Related