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



  • Hi, I know this question was brought up like a million times but none of them actually worked.
    Well, maybe because my environment is little different (?).

    I am currently using macOS and ssh to CentOS Linux 7. I downloaded qt5 to local directory (not /usr/local.. more specifically, /home/....../qt5/build/)

    First of all, can I open (well, I actually don't even have to open GUI, as long as it runs) my software that is using qt5?

    when I run >> export QT_DEBUG_PLUGINS=1

    QFactoryLoader::QFactoryLoader() checking directory path "/usr/lib64/kde4/plugins/platforms" ...
    QFactoryLoader::QFactoryLoader() checking directory path "/usr/lib/kde4/plugins/platforms" ...
    QFactoryLoader::QFactoryLoader() checking directory path "/home/dkang0602/ITK_SNAP/qt5/build/qtbase/plugins/platforms" ...
    QFactoryLoader::QFactoryLoader() looking at "/home/dkang0602/ITK_SNAP/qt5/build/qtbase/plugins/platforms/libqeglfs.so"
    Found metadata in lib /home/dkang0602/ITK_SNAP/qt5/build/qtbase/plugins/platforms/libqeglfs.so, metadata=
    {
        "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
        "MetaData": {
            "Keys": [
                "eglfs"
            ]
        },
        "archreq": 1,
        "className": "QEglFSIntegrationPlugin",
        "debug": true,
        "version": 330752
    }
    
    
    Got keys from plugin meta data ("eglfs")
    QFactoryLoader::QFactoryLoader() looking at "/home/dkang0602/ITK_SNAP/qt5/build/qtbase/plugins/platforms/libqlinuxfb.so"
    Found metadata in lib /home/dkang0602/ITK_SNAP/qt5/build/qtbase/plugins/platforms/libqlinuxfb.so, metadata=
    {
        "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
        "MetaData": {
            "Keys": [
                "linuxfb"
            ]
        },
        "archreq": 1,
        "className": "QLinuxFbIntegrationPlugin",
        "debug": true,
        "version": 330752
    }
    
    
    Got keys from plugin meta data ("linuxfb")
    QFactoryLoader::QFactoryLoader() looking at "/home/dkang0602/ITK_SNAP/qt5/build/qtbase/plugins/platforms/libqminimal.so"
    Found metadata in lib /home/dkang0602/ITK_SNAP/qt5/build/qtbase/plugins/platforms/libqminimal.so, metadata=
    {
        "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
        "MetaData": {
            "Keys": [
                "minimal"
            ]
        },
        "archreq": 1,
        "className": "QMinimalIntegrationPlugin",
        "debug": true,
        "version": 330752
    }
    
    
    Got keys from plugin meta data ("minimal")
    QFactoryLoader::QFactoryLoader() looking at "/home/dkang0602/ITK_SNAP/qt5/build/qtbase/plugins/platforms/libqminimalegl.so"
    Found metadata in lib /home/dkang0602/ITK_SNAP/qt5/build/qtbase/plugins/platforms/libqminimalegl.so, metadata=
    {
        "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
        "MetaData": {
            "Keys": [
                "minimalegl"
            ]
        },
        "archreq": 1,
        "className": "QMinimalEglIntegrationPlugin",
        "debug": true,
        "version": 330752
    }
    
    
    Got keys from plugin meta data ("minimalegl")
    QFactoryLoader::QFactoryLoader() looking at "/home/dkang0602/ITK_SNAP/qt5/build/qtbase/plugins/platforms/libqoffscreen.so"
    Found metadata in lib /home/dkang0602/ITK_SNAP/qt5/build/qtbase/plugins/platforms/libqoffscreen.so, metadata=
    {
        "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
        "MetaData": {
            "Keys": [
                "offscreen"
            ]
        },
        "archreq": 1,
        "className": "QOffscreenIntegrationPlugin",
        "debug": true,
        "version": 330752
    }
    
    
    Got keys from plugin meta data ("offscreen")
    QFactoryLoader::QFactoryLoader() looking at "/home/dkang0602/ITK_SNAP/qt5/build/qtbase/plugins/platforms/libqvnc.so"
    Found metadata in lib /home/dkang0602/ITK_SNAP/qt5/build/qtbase/plugins/platforms/libqvnc.so, metadata=
    {
        "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
        "MetaData": {
            "Keys": [
                "vnc"
            ]
        },
        "archreq": 1,
        "className": "QVncIntegrationPlugin",
        "debug": true,
        "version": 330752
    }
    
    
    Got keys from plugin meta data ("vnc")
    QFactoryLoader::QFactoryLoader() looking at "/home/dkang0602/ITK_SNAP/qt5/build/qtbase/plugins/platforms/libqwayland-egl.so"
    Found metadata in lib /home/dkang0602/ITK_SNAP/qt5/build/qtbase/plugins/platforms/libqwayland-egl.so, metadata=
    {
        "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
        "MetaData": {
            "Keys": [
                "wayland-egl"
            ]
        },
        "archreq": 1,
        "className": "QWaylandEglPlatformIntegrationPlugin",
        "debug": true,
        "version": 330752
    }
    
    
    Got keys from plugin meta data ("wayland-egl")
    QFactoryLoader::QFactoryLoader() looking at "/home/dkang0602/ITK_SNAP/qt5/build/qtbase/plugins/platforms/libqwayland-generic.so"
    Found metadata in lib /home/dkang0602/ITK_SNAP/qt5/build/qtbase/plugins/platforms/libqwayland-generic.so, metadata=
    {
        "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
        "MetaData": {
            "Keys": [
                "wayland"
            ]
        },
        "archreq": 1,
        "className": "QWaylandIntegrationPlugin",
        "debug": true,
        "version": 330752
    }
    
    
    Got keys from plugin meta data ("wayland")
    QFactoryLoader::QFactoryLoader() looking at "/home/dkang0602/ITK_SNAP/qt5/build/qtbase/plugins/platforms/libqwayland-xcomposite-egl.so"
    Found metadata in lib /home/dkang0602/ITK_SNAP/qt5/build/qtbase/plugins/platforms/libqwayland-xcomposite-egl.so, metadata=
    {
        "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
        "MetaData": {
            "Keys": [
                "wayland-xcomposite-egl"
            ]
        },
        "archreq": 1,
        "className": "QWaylandXCompositeEglPlatformIntegrationPlugin",
        "debug": true,
        "version": 330752
    }
    
    
    Got keys from plugin meta data ("wayland-xcomposite-egl")
    QFactoryLoader::QFactoryLoader() looking at "/home/dkang0602/ITK_SNAP/qt5/build/qtbase/plugins/platforms/libqwayland-xcomposite-glx.so"
    Found metadata in lib /home/dkang0602/ITK_SNAP/qt5/build/qtbase/plugins/platforms/libqwayland-xcomposite-glx.so, metadata=
    {
        "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
        "MetaData": {
            "Keys": [
                "wayland-xcomposite-glx"
            ]
        },
        "archreq": 1,
        "className": "QWaylandXCompositeGlxPlatformIntegrationPlugin",
        "debug": true,
        "version": 330752
    }
    
    
    Got keys from plugin meta data ("wayland-xcomposite-glx")
    QFactoryLoader::QFactoryLoader() looking at "/home/dkang0602/ITK_SNAP/qt5/build/qtbase/plugins/platforms/libqwebgl.so"
    Found metadata in lib /home/dkang0602/ITK_SNAP/qt5/build/qtbase/plugins/platforms/libqwebgl.so, metadata=
    {
        "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
        "MetaData": {
            "Keys": [
                "webgl"
            ]
        },
        "archreq": 1,
        "className": "QWebGLIntegrationPlugin",
        "debug": true,
        "version": 330752
    }
    
    
    Got keys from plugin meta data ("webgl")
    QFactoryLoader::QFactoryLoader() looking at "/home/dkang0602/ITK_SNAP/qt5/build/qtbase/plugins/platforms/libqxcb.so"
    Found metadata in lib /home/dkang0602/ITK_SNAP/qt5/build/qtbase/plugins/platforms/libqxcb.so, metadata=
    {
        "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
        "MetaData": {
            "Keys": [
                "xcb"
            ]
        },
        "archreq": 1,
        "className": "QXcbIntegrationPlugin",
        "debug": true,
        "version": 330752
    }
    
    
    Got keys from plugin meta data ("xcb")
    QFactoryLoader::QFactoryLoader() checking directory path "/home/dkang0602/ITK_SNAP/build/platforms" ...
    loaded library "/home/dkang0602/ITK_SNAP/qt5/build/qtbase/plugins/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.
    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, wayland-egl, wayland, wayland-xcomposite-egl, wayland-xcomposite-glx, webgl, xcb.
    

    When I run >> ldd

    [dkang0602@b2 build]$ ldd /home/dkang0602/ITK_SNAP/qt5/build/qtbase/plugins/platforms/libqxcb.so
    	linux-vdso.so.1 =>  (0x00007ffdd39e4000)
    	libQt5XcbQpa.so.5 => /home/dkang0602/ITK_SNAP/qt5/build/qtbase/lib/libQt5XcbQpa.so.5 (0x00007fca16f65000)
    	libfontconfig.so.1 => /lib64/libfontconfig.so.1 (0x00007fca16d23000)
    	libfreetype.so.6 => /lib64/libfreetype.so.6 (0x00007fca16a64000)
    	libz.so.1 => /lib64/libz.so.1 (0x00007fca1684e000)
    	libQt5Gui.so.5 => /home/dkang0602/ITK_SNAP/qt5/build/qtbase/lib/libQt5Gui.so.5 (0x00007fca16127000)
    	libQt5DBus.so.5 => /home/dkang0602/ITK_SNAP/qt5/build/qtbase/lib/libQt5DBus.so.5 (0x00007fca172bf000)
    	libQt5Core.so.5 => /home/dkang0602/ITK_SNAP/qt5/build/qtbase/lib/libQt5Core.so.5 (0x00007fca159e8000)
    	libGL.so.1 => /lib64/libGL.so.1 (0x00007fca1575c000)
    	libpthread.so.0 => /lib64/libpthread.so.0 (0x00007fca15540000)
    	libX11-xcb.so.1 => /lib64/libX11-xcb.so.1 (0x00007fca1533e000)
    	libxcb.so.1 => /lib64/libxcb.so.1 (0x00007fca15116000)
    	libXrender.so.1 => /lib64/libXrender.so.1 (0x00007fca14f0b000)
    	libXext.so.6 => /lib64/libXext.so.6 (0x00007fca14cf9000)
    	libX11.so.6 => /lib64/libX11.so.6 (0x00007fca149bb000)
    	libm.so.6 => /lib64/libm.so.6 (0x00007fca146b9000)
    	libSM.so.6 => /lib64/libSM.so.6 (0x00007fca144b1000)
    	libICE.so.6 => /lib64/libICE.so.6 (0x00007fca14295000)
    	libxkbcommon.so.0 => /lib64/libxkbcommon.so.0 (0x00007fca14055000)
    	libdl.so.2 => /lib64/libdl.so.2 (0x00007fca13e51000)
    	libstdc++.so.6 => /lib64/libstdc++.so.6 (0x00007fca13b4a000)
    	libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007fca13934000)
    	libc.so.6 => /lib64/libc.so.6 (0x00007fca13566000)
    	libgthread-2.0.so.0 => /lib64/libgthread-2.0.so.0 (0x00007fca13364000)
    	libglib-2.0.so.0 => /lib64/libglib-2.0.so.0 (0x00007fca1304e000)
    	libexpat.so.1 => /lib64/libexpat.so.1 (0x00007fca12e24000)
    	libuuid.so.1 => /lib64/libuuid.so.1 (0x00007fca12c1f000)
    	libbz2.so.1 => /lib64/libbz2.so.1 (0x00007fca12a0f000)
    	libpng15.so.15 => /lib64/libpng15.so.15 (0x00007fca127e4000)
    	libharfbuzz.so.0 => /lib64/libharfbuzz.so.0 (0x00007fca12547000)
    	libdbus-1.so.3 => /lib64/libdbus-1.so.3 (0x00007fca122f7000)
    	libicui18n.so.50 => /lib64/libicui18n.so.50 (0x00007fca11ef8000)
    	libicuuc.so.50 => /lib64/libicuuc.so.50 (0x00007fca11b7f000)
    	libicudata.so.50 => /lib64/libicudata.so.50 (0x00007fca105ac000)
    	/lib64/ld-linux-x86-64.so.2 (0x00007fca171a5000)
    	libGLX.so.0 => /lib64/libGLX.so.0 (0x00007fca1037a000)
    	libGLdispatch.so.0 => /lib64/libGLdispatch.so.0 (0x00007fca100c4000)
    	libXau.so.6 => /lib64/libXau.so.6 (0x00007fca0fec0000)
    	libpcre.so.1 => /lib64/libpcre.so.1 (0x00007fca0fc5e000)
    	libgraphite2.so.3 => /lib64/libgraphite2.so.3 (0x00007fca0fa30000)
    	libsystemd.so.0 => /lib64/libsystemd.so.0 (0x00007fca0f7ff000)
    	libcap.so.2 => /lib64/libcap.so.2 (0x00007fca0f5fa000)
    	librt.so.1 => /lib64/librt.so.1 (0x00007fca0f3f2000)
    	libselinux.so.1 => /lib64/libselinux.so.1 (0x00007fca0f1cb000)
    	liblzma.so.5 => /lib64/liblzma.so.5 (0x00007fca0efa5000)
    	liblz4.so.1 => /lib64/liblz4.so.1 (0x00007fca0ed90000)
    	libgcrypt.so.11 => /lib64/libgcrypt.so.11 (0x00007fca0eb0f000)
    	libgpg-error.so.0 => /lib64/libgpg-error.so.0 (0x00007fca0e90a000)
    	libresolv.so.2 => /lib64/libresolv.so.2 (0x00007fca0e6f0000)
    	libdw.so.1 => /lib64/libdw.so.1 (0x00007fca0e49f000)
    	libattr.so.1 => /lib64/libattr.so.1 (0x00007fca0e29a000)
    	libelf.so.1 => /lib64/libelf.so.1 (0x00007fca0e082000)
    

    Also, I am concerned that this issue occurred because of /lib64/ directory. This server apparently has really old versions of qt in /lib64 directory (I don't know why but there is qt3.3, qt4, and qt5).
    Anything else I can try? or Can I not run this software because it is ssh connected?



  • I guess the centos you use is a desktop manager or similar. If you are using putty then you must configure X11 forwarding: check out https://web.archive.org/web/20110318060418/http://www.cse.unsw.edu.au/~helpdesk/documentation/Putty.html. Another simpler way is to use vnc instead of ssh.



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

    vnc

    First of all, Thank you so much for the quick response.
    Apparently vnc does not work saying it is not able to connect the display. I guess the server that I want to connect to does not have a screen and It is a just a big solid server.

    also when I run putty (>> plink dkang0602@b......org -P <port number> -X
    it also gives me an error...

    shell-init: error retrieving current directory: getcwd: cannot access parent directories: Operation not permitted
    shell-init: error retrieving current directory: getcwd: cannot access parent directories: Operation not permitted
    

    I guess this is also because it does not have a screen..?



  • Guest said in qt.qpa.xcb: could not connect to display:

    Can I not run this software because it is ssh connected?

    No, you can run it remotely via SSH given that you connect with X Forwarding enabled.

    Another simpler way is to use vnc instead of ssh.

    I don't think you need to get into that extra step given that I am currently using macOS so you should have an X server already running, and SSH X Forwarding should do the trick.

    So why putty is mentioned


Log in to reply