Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

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



  • Hi, I've been trying to set up QtSLiM and it isn't working.

    I enter export LIBGL_ALWAYS_INDIRECT=; export DISPLAY=:0; ~/build/QtSLiM

    and then this is the result
    ubuntu issue.PNG

    Any help would be greatly appreciated


  • Lifetime Qt Champion

    Hi and welcome to devnet,

    Start your application with the QT_DEBUG_PLUGINS environment variable set to 1. That will give you more information about what is going wrong.

    If you have a recent version of Qt, I would guess you are missing libxinerama.

    [edit: added missing words SGaist]



  • What command do I do to set the plugins to 1

    when I tried what you put, this popped up

    qt debug.PNG



  • @SSJCarti
    It's an environment variable. export QT_DEBUG_PLUGINS=1.



  • When I did that, nothing happenedexport qt.PNG


  • Lifetime Qt Champion

    Now you have to start your application to see the debug output.



  • So now I should try this command again? export LIBGL_ALWAYS_INDIRECT=; export DISPLAY=:0; ~/build/QtSLiM

    Also I can only post once every 600 seconds

    I am also doing thin on a windows 10 computer using ubuntu



  • @SSJCarti said in qt.qpa.xcb: could not connect to display :0:

    So now I should try this command again? export LIBGL_ALWAYS_INDIRECT=; export DISPLAY=:0; ~/build/QtSLiM

    Yes.



  • @SSJCarti said in qt.qpa.xcb: could not connect to display :0:

    QtSLiM

    It would be great you had provided a link to such application

    and then this is the result

    Please paste the output as text, not an screenshot so it's easier to copy/reply to such output

    export DISPLAY=:0

    If you export such variable, it's likely you want some X server to be available.
    Which seems not the case by looking at your output could not connect to display :0



  • This is the link to the instructions for running the QtSlim, you have to go to section 2.4.5
    http://benhaller.com/slim/SLiM_Manual.pdf
    After running that this is what popped up

    adduser@DESKTOP-991BCVH:~$ export LIBGL_ALWAYS_INDIRECT=; export DISPLAY=:0; ~/build/QtSLiM
    QFactoryLoader::QFactoryLoader() checking directory path "/usr/lib/x86_64-linux-gnu/qt5/plugins/platforms" ...
    QFactoryLoader::QFactoryLoader() looking at "/usr/lib/x86_64-linux-gnu/qt5/plugins/platforms/libqeglfs.so"
    Found metadata in lib /usr/lib/x86_64-linux-gnu/qt5/plugins/platforms/libqeglfs.so, metadata=
    {
    "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
    "MetaData": {
    "Keys": [
    "eglfs"
    ]
    },
    "archreq": 0,
    "className": "QEglFSIntegrationPlugin",
    "debug": false,
    "version": 330752
    }

    Got keys from plugin meta data ("eglfs")
    QFactoryLoader::QFactoryLoader() looking at "/usr/lib/x86_64-linux-gnu/qt5/plugins/platforms/libqlinuxfb.so"
    Found metadata in lib /usr/lib/x86_64-linux-gnu/qt5/plugins/platforms/libqlinuxfb.so, metadata=
    {
    "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
    "MetaData": {
    "Keys": [
    "linuxfb"
    ]
    },
    "archreq": 0,
    "className": "QLinuxFbIntegrationPlugin",
    "debug": false,
    "version": 330752
    }

    Got keys from plugin meta data ("linuxfb")
    QFactoryLoader::QFactoryLoader() looking at "/usr/lib/x86_64-linux-gnu/qt5/plugins/platforms/libqminimal.so"
    Found metadata in lib /usr/lib/x86_64-linux-gnu/qt5/plugins/platforms/libqminimal.so, metadata=
    {
    "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
    "MetaData": {
    "Keys": [
    "minimal"
    ]
    },
    "archreq": 0,
    "className": "QMinimalIntegrationPlugin",
    "debug": false,
    "version": 330752
    }

    Got keys from plugin meta data ("minimal")
    QFactoryLoader::QFactoryLoader() looking at "/usr/lib/x86_64-linux-gnu/qt5/plugins/platforms/libqminimalegl.so"
    Found metadata in lib /usr/lib/x86_64-linux-gnu/qt5/plugins/platforms/libqminimalegl.so, metadata={
    "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
    "MetaData": {
    "Keys": [
    "minimalegl"
    ]
    },
    "archreq": 0,
    "className": "QMinimalEglIntegrationPlugin",
    "debug": false,
    "version": 330752
    }

    Got keys from plugin meta data ("minimalegl")
    QFactoryLoader::QFactoryLoader() looking at "/usr/lib/x86_64-linux-gnu/qt5/plugins/platforms/libqoffscreen.so"
    Found metadata in lib /usr/lib/x86_64-linux-gnu/qt5/plugins/platforms/libqoffscreen.so, metadata=
    {
    "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
    "MetaData": {
    "Keys": [
    "offscreen"
    ]
    },
    "archreq": 0,
    "className": "QOffscreenIntegrationPlugin",
    "debug": false,
    "version": 330752
    }

    Got keys from plugin meta data ("offscreen")
    QFactoryLoader::QFactoryLoader() looking at "/usr/lib/x86_64-linux-gnu/qt5/plugins/platforms/libqvnc.so"
    Found metadata in lib /usr/lib/x86_64-linux-gnu/qt5/plugins/platforms/libqvnc.so, metadata=
    {
    "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
    "MetaData": {
    "Keys": [
    "vnc"
    ]
    },
    "archreq": 0,
    "className": "QVncIntegrationPlugin",
    "debug": false,
    "version": 330752
    }

    Got keys from plugin meta data ("vnc")
    QFactoryLoader::QFactoryLoader() looking at "/usr/lib/x86_64-linux-gnu/qt5/plugins/platforms/libqxcb.so"
    Found metadata in lib /usr/lib/x86_64-linux-gnu/qt5/plugins/platforms/libqxcb.so, metadata=
    {
    "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
    "MetaData": {
    "Keys": [
    "xcb"
    ]
    },
    "archreq": 0,
    "className": "QXcbIntegrationPlugin",
    "debug": false,
    "version": 330752
    }

    Got keys from plugin meta data ("xcb")
    QFactoryLoader::QFactoryLoader() checking directory path "/home/adduser/build/platforms" ...
    loaded library "/usr/lib/x86_64-linux-gnu/qt5/plugins/platforms/libqxcb.so"
    qt.qpa.xcb: could not connect to display :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: eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, xcb.

    Aborted



  • @SSJCarti said in qt.qpa.xcb: could not connect to display :0:

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

    it seems you haven't looked at my previous post. You may need an X server running



  • I have a VcXsrv running. Also known as XLaunch



  • @SSJCarti said in qt.qpa.xcb: could not connect to display :0:

    I have a VcXsrv running

    According to this site:

    VcXsrv makes it possible to run Linux GUI programs installed with WSL, the Windows Subsystem for Linux. In bash for Windows, setting the DISPLAY environment variable allows WSL programs to use the Windows GUI. For instance, if VcXsrv is configured to use display number zero, the command DISPLAY=:0 etr would run the game Extreme Tux Racer

    Given that you're running VcXsrv, you may need to double check its configuration and what display it's exporting/providing to the Linux side of the Windows WSL (sorry but I don't have experience with Windows WSL to help more).

    You may also want to check the videos here about VcXsrv & Win10 Linux Subsystems



  • thank you. Is there anyone else with potential ideas?



  • @JonB Do you have any ideas?



  • @SSJCarti

    loaded library "/usr/lib/x86_64-linux-gnu/qt5/plugins/platforms/libqxcb.so"
    qt.qpa.xcb: could not connect to display :0
    qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.
    

    I know little about, less than you or @Pablo-J-Rogina . But it does seem to me that whatever he is trying to ask/tell you about an X server --- either not running or somehow not found? --- is what is causing the problem here, given that it has said

    loaded library "/usr/lib/x86_64-linux-gnu/qt5/plugins/platforms/libqxcb.so"
    Could not load the Qt platform plugin "xcb" in "" even though it was found.

    ?

    There are many Google hits for Could not load the Qt platform plugin "xcb", and we usually find that is an absent library like libxcb-xinerama.so.0. But here I am thinking you should Google for could not load the qt platform plugin "xcb" in "" even though it was found. The "even though it was found" being key. There are a bunch of hits on that, things like XDG_RUNTIME_DIR not giving you a good X environment. If I understood any of this :) that is what I would look through.



  • @JonB alright thank you ill look for that



  • @SSJCarti
    One thing: It seems to me there is a related discussion going on in https://forum.qt.io/topic/120349/run-qt-gui-application-inside-docker. I assume that Poster is not yourself too. At least, that seems to get the same message as you do:

    loaded library "/home/user/app/platforms/libqxcb.so"
    qt.qpa.xcb: could not connect to display
    qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.

    So maybe worth a look?

    EDIT @Pablo-J-Rogina has said below this would not be helpful to you, so don't! :)



  • @JonB said in qt.qpa.xcb: could not connect to display :0:

    So maybe worth a look?

    I don't think the goals/environments are the same... I'd say it will mislead OP here



  • @Pablo-J-Rogina so is my Xlaunch a xserver?



  • @SSJCarti said in qt.qpa.xcb: could not connect to display :0:

    is my Xlaunch a xserver?

    Once again, you failed to provided a link to such component/application... Make life easier for the ones that may help you.

    If you're referring to this Xlaunch, I'm not familiar with it but from its documentation it is not an X server:

    XLaunch is a wizard to make starting X server sessions easy

    In addition, have you checked the videos I suggested?



  • @Pablo-J-Rogina I do not know what an xserver is, I am very new to this whole type of stuff



  • @SSJCarti said in qt.qpa.xcb: could not connect to display :0:

    what an xserver is

    I guess you'll find lots of references, documentation, tutorials about the X windowing system.
    One of the videos I linked before does a good job at describing the purpose and some details of an X server.


Log in to reply