This application failed to start because no Qt platform plugin could be initialized
Unsolved
General and Desktop
-
Re: problem with qt.qpa.plugin: running on a docker in Kubuntu
Hi. Im trying to run wbots inside the docker container with x11 but getting an error
docker-compose up webots_simulation ✔ 10980 12:25:26 [+] Running 1/1 ✔ Container shatun-webots_simulation-1 Recreated 0.5s Attaching to webots_simulation-1 webots_simulation-1 | Debug: checking directory path "/usr/local/webots/lib/webots/qt/plugins/platforms" ... webots_simulation-1 | Debug: looking at "/usr/local/webots/lib/webots/qt/plugins/platforms/libqxcb.so" webots_simulation-1 | Debug: Found metadata in lib /usr/local/webots/lib/webots/qt/plugins/platforms/libqxcb.so, metadata= webots_simulation-1 | { webots_simulation-1 | "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3", webots_simulation-1 | "MetaData": { webots_simulation-1 | "Keys": [ webots_simulation-1 | "xcb" webots_simulation-1 | ] webots_simulation-1 | }, webots_simulation-1 | "archlevel": 1, webots_simulation-1 | "className": "QXcbIntegrationPlugin", webots_simulation-1 | "debug": false, webots_simulation-1 | "version": 394240 webots_simulation-1 | } webots_simulation-1 | webots_simulation-1 | webots_simulation-1 | Debug: Got keys from plugin meta data QList("xcb") webots_simulation-1 | Debug: checking directory path "/usr/local/webots/bin/platforms" ... webots_simulation-1 | Debug: "/usr/local/webots/lib/webots/qt/plugins/platforms/libqxcb.so" loaded library webots_simulation-1 | Warning: could not connect to display host.docker.internal:0 webots_simulation-1 | Info: Could not load the Qt platform plugin "xcb" in "" even though it was found. webots_simulation-1 | Fatal: This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem. webots_simulation-1 | webots_simulation-1 | Available platform plugins are: xcb. webots_simulation-1 | webots_simulation-1 | /usr/local/webots/webots: line 105: 9 Aborted "$webots_home/bin/webots-bin" "$@" webots_simulation-1 exited with code 134
The Dockerfile im using is
ARG BASE_IMAGE=nvidia/cuda:11.8.0-base-ubuntu22.04 FROM ${BASE_IMAGE} AS downloader # Determine Webots version to be used and set default argument ARG WEBOTS_VERSION=R2023b ARG WEBOTS_PACKAGE_PREFIX= # Disable dpkg/gdebi interactive dialogs ENV DEBIAN_FRONTEND=noninteractive RUN apt-get update && apt-get install --yes wget bzip2 && rm -rf /var/lib/apt/lists/ && \ wget https://github.com/cyberbotics/webots/releases/download/$WEBOTS_VERSION/webots-$WEBOTS_VERSION-x86-64$WEBOTS_PACKAGE_PREFIX.tar.bz2 && \ tar xjf webots-*.tar.bz2 && rm webots-*.tar.bz2 FROM ${BASE_IMAGE} # Disable dpkg/gdebi interactive dialogs ENV DEBIAN_FRONTEND=noninteractive # Install Webots runtime dependencies RUN apt-get update && apt-get install --yes wget xvfb locales && rm -rf /var/lib/apt/lists/ && \ wget https://raw.githubusercontent.com/cyberbotics/webots/master/scripts/install/linux_runtime_dependencies.sh && \ chmod +x linux_runtime_dependencies.sh && ./linux_runtime_dependencies.sh && rm ./linux_runtime_dependencies.sh && rm -rf /var/lib/apt/lists/ # Install Webots WORKDIR /usr/local COPY --from=downloader /webots /usr/local/webots/ ENV QTWEBENGINE_DISABLE_SANDBOX=1 ENV WEBOTS_HOME /usr/local/webots ENV PATH /usr/local/webots:${PATH} # Set a user name to fix a warning ENV USER root # Set the locales RUN locale-gen en_US.UTF-8 ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' LC_ALL='en_US.UTF-8' RUN apt-get update && apt-get install -y '^libxcb.*-dev' libx11-xcb-dev libglu1-mesa-dev libxrender-dev libxi-dev libxkbcommon-dev libxkbcommon-x11-dev
and docker-compose
webots_simulation: build: context: . dockerfile: Dockerfile_webots_simulation volumes: - /tmp/.X11-unix:/tmp/.X11-unix environment: - DISPLAY=host.docker.internal:0 - QT_DEBUG_PLUGINS=1 - QT_X11_NO_MITSHM=1 command: webots
Does anyone can help to understand what is a problem? Running on Mac OS
-
@PaulZ said in This application failed to start because no Qt platform plugin could be initialized:
Warning: could not connect to display host.docker.internal:0
This is the problem.
Is X11 running when you start the app?