Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Start pyqt5 app automatically on start-up in docker
QtWS25 Last Chance

Start pyqt5 app automatically on start-up in docker

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 3 Posters 358 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.
  • V Offline
    V Offline
    voqtuyen
    wrote on last edited by
    #1

    I am running an pyqt5 app inside docker normally with commands

    xhost +si:localuser:root
    docker run -it -e DISPLAY=$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix -v /etc/localtime:/etc/localtime:ro loggingface_ui
    

    However, when i need add it to auto-start on system start-up or even from remote ssh, i am unable to start it and get the logs:

    qt.qpa.screen: QXcbConnection: Could not connect to display localhost:10.0
    Could not connect to any X display.

    How do i solve this issue?

    jsulmJ 1 Reply Last reply
    0
    • V voqtuyen

      I am running an pyqt5 app inside docker normally with commands

      xhost +si:localuser:root
      docker run -it -e DISPLAY=$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix -v /etc/localtime:/etc/localtime:ro loggingface_ui
      

      However, when i need add it to auto-start on system start-up or even from remote ssh, i am unable to start it and get the logs:

      qt.qpa.screen: QXcbConnection: Could not connect to display localhost:10.0
      Could not connect to any X display.

      How do i solve this issue?

      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @voqtuyen said in Start pyqt5 app automatically on start-up in docker:

      qt.qpa.screen: QXcbConnection: Could not connect to display localhost:10.0

      Looks like there is no X11 running at that time. But I'm not docker expert.

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

      1 Reply Last reply
      2
      • Kent-DorfmanK Offline
        Kent-DorfmanK Offline
        Kent-Dorfman
        wrote on last edited by
        #3

        localhost:10 is usually the ssh passthrough for x11 forwarding to your local display. I know its insecure but temporarily enable any x11 connection (on the machine you logged in and are running X11 by using xhost + ...I can guarantee your problem is xauth related, but not enough information to tell ou how to fix without turning off all X11 authentication.

        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