Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. Error: qt.qpa.xcb: could not connect to display

Error: qt.qpa.xcb: could not connect to display

Scheduled Pinned Locked Moved Unsolved Installation and Deployment
docker containeqt.qpa.plugin
6 Posts 3 Posters 13.6k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    Jeetu
    wrote on 3 Mar 2022, 11:27 last edited by Jeetu 3 Mar 2022, 11:29
    #1

    Hello there,
    Greetings of the day,

    I am getting the below error of qt.qpa.plugin when running in the docker container. The project works fine on the local Ubuntu:18.04.

    Error statement: *qt.qpa.xcb: could not connect to display
    qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "/miniconda/lib/python3.9/site-packages/cv2/qt/plugins" 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: xcb.

    Aborted (core dumped)*

    I am using ubuntu:18.04 OS on top of docker container.

    Any comments for solving the error are appreciated.

    Thanks

    J 1 Reply Last reply 3 Mar 2022, 12:12
    0
    • J Jeetu
      3 Mar 2022, 11:27

      Hello there,
      Greetings of the day,

      I am getting the below error of qt.qpa.plugin when running in the docker container. The project works fine on the local Ubuntu:18.04.

      Error statement: *qt.qpa.xcb: could not connect to display
      qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "/miniconda/lib/python3.9/site-packages/cv2/qt/plugins" 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: xcb.

      Aborted (core dumped)*

      I am using ubuntu:18.04 OS on top of docker container.

      Any comments for solving the error are appreciated.

      Thanks

      J Offline
      J Offline
      jsulm
      Lifetime Qt Champion
      wrote on 3 Mar 2022, 12:12 last edited by
      #2

      @Jeetu said in Error: qt.qpa.xcb: could not connect to display:

      Any comments for solving the error are appreciated.

      You do not have running X server in your container it seems

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • J Offline
        J Offline
        Jeetu
        wrote on 4 Mar 2022, 07:49 last edited by Jeetu 3 Apr 2022, 07:55
        #3

        @jsulm Yes, you are right but how do I get one?
        Thank you for responding, your response is appreciated.

        For better understanding,
        I am running my python code inside Docker container on EC2(Ubuntu:18.04) instance.
        Looking forward to get the solution.
        Thanks

        J 1 Reply Last reply 4 Mar 2022, 07:55
        0
        • J Jeetu
          4 Mar 2022, 07:49

          @jsulm Yes, you are right but how do I get one?
          Thank you for responding, your response is appreciated.

          For better understanding,
          I am running my python code inside Docker container on EC2(Ubuntu:18.04) instance.
          Looking forward to get the solution.
          Thanks

          J Offline
          J Offline
          jsulm
          Lifetime Qt Champion
          wrote on 4 Mar 2022, 07:55 last edited by
          #4

          @Jeetu I'm not a Docker expert. You should search for running GUI applications in Docker. For example: https://l10nn.medium.com/running-x11-applications-with-docker-75133178d090

          https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0
          • J Offline
            J Offline
            Jeetu
            wrote on 4 Mar 2022, 07:59 last edited by
            #5

            @jsulm , Thank you for your response. I have been searching the same but yet not get any solution.
            Thanks

            1 Reply Last reply
            0
            • M Offline
              M Offline
              Minahil
              wrote on 21 Oct 2024, 09:56 last edited by
              #6

              This solves any display related issues from within docker containers
              docker run -it --name $CONTAINER_NAME --network host -e DISPLAY -e TERM -e QT_X11_NO_MITSHM=1 $IMAGE_NAME bash

              1 Reply Last reply
              0

              • Login

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • Users
              • Groups
              • Search
              • Get Qt Extensions
              • Unsolved