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. Qt app on linux: permission denied when opening framebuffer
Forum Updated to NodeBB v4.3 + New Features

Qt app on linux: permission denied when opening framebuffer

Scheduled Pinned Locked Moved Solved Installation and Deployment
6 Posts 3 Posters 2.5k Views 1 Watching
  • 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.
  • G Offline
    G Offline
    gvanvoor
    wrote on last edited by
    #1

    I'm attempting to port an existing application to linux and am running in some problems at application startup.
    After the platform plugin (linuxfb) is loaded, it fails to open the framebuffer with a permission denied error. Several other devices seem to fail to open and the operation ultimately fails with the mention "Cannot create window: no screens available"

    In case that makes any difference: the application uses cmake as its build system and Qt was built from source..
    I turned on plugin debugging to get some hopefully useful output:

    gregoryvv@lolly:/Development/Projects/AppPort$ export QT_QPA_PLATFORM=linuxfb
    gregoryvv@lolly:/Development/Projects/AppPort$ ./Application 
    QFactoryLoader::QFactoryLoader() checking directory path "/usr/local/Qt-5.13.2/plugins/platforms" ...
    QFactoryLoader::QFactoryLoader() looking at "/usr/local/Qt-5.13.2/plugins/platforms/libqlinuxfb.so"
    Found metadata in lib /usr/local/Qt-5.13.2/plugins/platforms/libqlinuxfb.so, metadata=
    {
        "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
        "MetaData": {
            "Keys": [
                "linuxfb"
            ]
        },
        "archreq": 0,
        "className": "QLinuxFbIntegrationPlugin",
        "debug": false,
        "version": 331008
    }
    
    
    Got keys from plugin meta data ("linuxfb")
    QFactoryLoader::QFactoryLoader() looking at "/usr/local/Qt-5.13.2/plugins/platforms/libqminimal.so"
    Found metadata in lib /usr/local/Qt-5.13.2/plugins/platforms/libqminimal.so, metadata=
    {
        "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
        "MetaData": {
            "Keys": [
                "minimal"
            ]
        },
        "archreq": 0,
        "className": "QMinimalIntegrationPlugin",
        "debug": false,
        "version": 331008
    }
    
    
    Got keys from plugin meta data ("minimal")
    QFactoryLoader::QFactoryLoader() looking at "/usr/local/Qt-5.13.2/plugins/platforms/libqoffscreen.so"
    Found metadata in lib /usr/local/Qt-5.13.2/plugins/platforms/libqoffscreen.so, metadata=
    {
        "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
        "MetaData": {
            "Keys": [
                "offscreen"
            ]
        },
        "archreq": 0,
        "className": "QOffscreenIntegrationPlugin",
        "debug": false,
        "version": 331008
    }
    
    
    Got keys from plugin meta data ("offscreen")
    QFactoryLoader::QFactoryLoader() looking at "/usr/local/Qt-5.13.2/plugins/platforms/libqvnc.so"
    Found metadata in lib /usr/local/Qt-5.13.2/plugins/platforms/libqvnc.so, metadata=
    {
        "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
        "MetaData": {
            "Keys": [
                "vnc"
            ]
        },
        "archreq": 0,
        "className": "QVncIntegrationPlugin",
        "debug": false,
        "version": 331008
    }
    
    
    Got keys from plugin meta data ("vnc")
    QFactoryLoader::QFactoryLoader() checking directory path "/Development/Projects/AppPort/platforms" ...
    loaded library "/usr/local/Qt-5.13.2/plugins/platforms/libqlinuxfb.so"
    Failed to open framebuffer /dev/fb0 (Permission denied)
    linuxfb: Failed to initialize screen
    QFactoryLoader::QFactoryLoader() checking directory path "/usr/local/Qt-5.13.2/plugins/platforminputcontexts" ...
    QFactoryLoader::QFactoryLoader() looking at "/usr/local/Qt-5.13.2/plugins/platforminputcontexts/libqtvirtualkeyboardplugin.so"
    Found metadata in lib /usr/local/Qt-5.13.2/plugins/platforminputcontexts/libqtvirtualkeyboardplugin.so, metadata=
    {
        "IID": "org.qt-project.Qt.QPlatformInputContextFactoryInterface.5.1",
        "MetaData": {
            "Keys": [
                "qtvirtualkeyboard"
            ]
        },
        "archreq": 0,
        "className": "QVirtualKeyboardPlugin",
        "debug": false,
        "version": 331008
    }
    
    
    Got keys from plugin meta data ("qtvirtualkeyboard")
    QFactoryLoader::QFactoryLoader() checking directory path "/Development/Projects/AppPort/platforminputcontexts" ...
    [9;0]Device discovery cannot open device "/dev/input/event0"
    Device discovery cannot open device "/dev/input/event1"
    Device discovery cannot open device "/dev/input/event10"
    Device discovery cannot open device "/dev/input/event11"
    Device discovery cannot open device "/dev/input/event12"
    Device discovery cannot open device "/dev/input/event13"
    Device discovery cannot open device "/dev/input/event14"
    Device discovery cannot open device "/dev/input/event15"
    Device discovery cannot open device "/dev/input/event2"
    Device discovery cannot open device "/dev/input/event3"
    Device discovery cannot open device "/dev/input/event4"
    Device discovery cannot open device "/dev/input/event5"
    Device discovery cannot open device "/dev/input/event6"
    Device discovery cannot open device "/dev/input/event7"
    Device discovery cannot open device "/dev/input/event8"
    Device discovery cannot open device "/dev/input/event9"
    Device discovery cannot open device "/dev/input/mice"
    Device discovery cannot open device "/dev/input/mouse0"
    Device discovery cannot open device "/dev/input/event0"
    Device discovery cannot open device "/dev/input/event1"
    Device discovery cannot open device "/dev/input/event10"
    Device discovery cannot open device "/dev/input/event11"
    Device discovery cannot open device "/dev/input/event12"
    Device discovery cannot open device "/dev/input/event13"
    Device discovery cannot open device "/dev/input/event14"
    Device discovery cannot open device "/dev/input/event15"
    Device discovery cannot open device "/dev/input/event2"
    Device discovery cannot open device "/dev/input/event3"
    Device discovery cannot open device "/dev/input/event4"
    Device discovery cannot open device "/dev/input/event5"
    Device discovery cannot open device "/dev/input/event6"
    Device discovery cannot open device "/dev/input/event7"
    Device discovery cannot open device "/dev/input/event8"
    Device discovery cannot open device "/dev/input/event9"
    Device discovery cannot open device "/dev/input/mice"
    Device discovery cannot open device "/dev/input/mouse0"
    Device discovery cannot open device "/dev/input/event0"
    Device discovery cannot open device "/dev/input/event1"
    Device discovery cannot open device "/dev/input/event10"
    Device discovery cannot open device "/dev/input/event11"
    Device discovery cannot open device "/dev/input/event12"
    Device discovery cannot open device "/dev/input/event13"
    Device discovery cannot open device "/dev/input/event14"
    Device discovery cannot open device "/dev/input/event15"
    Device discovery cannot open device "/dev/input/event2"
    Device discovery cannot open device "/dev/input/event3"
    Device discovery cannot open device "/dev/input/event4"
    Device discovery cannot open device "/dev/input/event5"
    Device discovery cannot open device "/dev/input/event6"
    Device discovery cannot open device "/dev/input/event7"
    Device discovery cannot open device "/dev/input/event8"
    Device discovery cannot open device "/dev/input/event9"
    Device discovery cannot open device "/dev/input/mice"
    Device discovery cannot open device "/dev/input/mouse0"
    no screens available, assuming 24-bit color
    QFactoryLoader::QFactoryLoader() checking directory path "/usr/local/Qt-5.13.2/plugins/styles" ...
    QFactoryLoader::QFactoryLoader() checking directory path "/Development/Projects/AppPort/styles" ...
    QFactoryLoader::QFactoryLoader() checking directory path "/usr/local/Qt-5.13.2/plugins/accessiblebridge" ...
    QFactoryLoader::QFactoryLoader() checking directory path "/Development/Projects/AppPort/accessiblebridge" ...
    QFactoryLoader::QFactoryLoader() checking directory path "/usr/local/Qt-5.13.2/plugins/iconengines" ...
    QFactoryLoader::QFactoryLoader() looking at "/usr/local/Qt-5.13.2/plugins/iconengines/libqsvgicon.so"
    Found metadata in lib /usr/local/Qt-5.13.2/plugins/iconengines/libqsvgicon.so, metadata=
    {
        "IID": "org.qt-project.Qt.QIconEngineFactoryInterface",
        "MetaData": {
            "Keys": [
                "svg",
                "svgz",
                "svg.gz"
            ]
        },
        "archreq": 0,
        "className": "QSvgIconPlugin",
        "debug": false,
        "version": 331008
    }
    
    
    Got keys from plugin meta data ("svg", "svgz", "svg.gz")
    QFactoryLoader::QFactoryLoader() checking directory path "/Development/Projects/AppPort/iconengines" ...
    Cannot create window: no screens available
    Aborted (core dumped)
    
    
    jsulmJ 1 Reply Last reply
    0
    • G gvanvoor

      I'm attempting to port an existing application to linux and am running in some problems at application startup.
      After the platform plugin (linuxfb) is loaded, it fails to open the framebuffer with a permission denied error. Several other devices seem to fail to open and the operation ultimately fails with the mention "Cannot create window: no screens available"

      In case that makes any difference: the application uses cmake as its build system and Qt was built from source..
      I turned on plugin debugging to get some hopefully useful output:

      gregoryvv@lolly:/Development/Projects/AppPort$ export QT_QPA_PLATFORM=linuxfb
      gregoryvv@lolly:/Development/Projects/AppPort$ ./Application 
      QFactoryLoader::QFactoryLoader() checking directory path "/usr/local/Qt-5.13.2/plugins/platforms" ...
      QFactoryLoader::QFactoryLoader() looking at "/usr/local/Qt-5.13.2/plugins/platforms/libqlinuxfb.so"
      Found metadata in lib /usr/local/Qt-5.13.2/plugins/platforms/libqlinuxfb.so, metadata=
      {
          "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
          "MetaData": {
              "Keys": [
                  "linuxfb"
              ]
          },
          "archreq": 0,
          "className": "QLinuxFbIntegrationPlugin",
          "debug": false,
          "version": 331008
      }
      
      
      Got keys from plugin meta data ("linuxfb")
      QFactoryLoader::QFactoryLoader() looking at "/usr/local/Qt-5.13.2/plugins/platforms/libqminimal.so"
      Found metadata in lib /usr/local/Qt-5.13.2/plugins/platforms/libqminimal.so, metadata=
      {
          "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
          "MetaData": {
              "Keys": [
                  "minimal"
              ]
          },
          "archreq": 0,
          "className": "QMinimalIntegrationPlugin",
          "debug": false,
          "version": 331008
      }
      
      
      Got keys from plugin meta data ("minimal")
      QFactoryLoader::QFactoryLoader() looking at "/usr/local/Qt-5.13.2/plugins/platforms/libqoffscreen.so"
      Found metadata in lib /usr/local/Qt-5.13.2/plugins/platforms/libqoffscreen.so, metadata=
      {
          "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
          "MetaData": {
              "Keys": [
                  "offscreen"
              ]
          },
          "archreq": 0,
          "className": "QOffscreenIntegrationPlugin",
          "debug": false,
          "version": 331008
      }
      
      
      Got keys from plugin meta data ("offscreen")
      QFactoryLoader::QFactoryLoader() looking at "/usr/local/Qt-5.13.2/plugins/platforms/libqvnc.so"
      Found metadata in lib /usr/local/Qt-5.13.2/plugins/platforms/libqvnc.so, metadata=
      {
          "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
          "MetaData": {
              "Keys": [
                  "vnc"
              ]
          },
          "archreq": 0,
          "className": "QVncIntegrationPlugin",
          "debug": false,
          "version": 331008
      }
      
      
      Got keys from plugin meta data ("vnc")
      QFactoryLoader::QFactoryLoader() checking directory path "/Development/Projects/AppPort/platforms" ...
      loaded library "/usr/local/Qt-5.13.2/plugins/platforms/libqlinuxfb.so"
      Failed to open framebuffer /dev/fb0 (Permission denied)
      linuxfb: Failed to initialize screen
      QFactoryLoader::QFactoryLoader() checking directory path "/usr/local/Qt-5.13.2/plugins/platforminputcontexts" ...
      QFactoryLoader::QFactoryLoader() looking at "/usr/local/Qt-5.13.2/plugins/platforminputcontexts/libqtvirtualkeyboardplugin.so"
      Found metadata in lib /usr/local/Qt-5.13.2/plugins/platforminputcontexts/libqtvirtualkeyboardplugin.so, metadata=
      {
          "IID": "org.qt-project.Qt.QPlatformInputContextFactoryInterface.5.1",
          "MetaData": {
              "Keys": [
                  "qtvirtualkeyboard"
              ]
          },
          "archreq": 0,
          "className": "QVirtualKeyboardPlugin",
          "debug": false,
          "version": 331008
      }
      
      
      Got keys from plugin meta data ("qtvirtualkeyboard")
      QFactoryLoader::QFactoryLoader() checking directory path "/Development/Projects/AppPort/platforminputcontexts" ...
      [9;0]Device discovery cannot open device "/dev/input/event0"
      Device discovery cannot open device "/dev/input/event1"
      Device discovery cannot open device "/dev/input/event10"
      Device discovery cannot open device "/dev/input/event11"
      Device discovery cannot open device "/dev/input/event12"
      Device discovery cannot open device "/dev/input/event13"
      Device discovery cannot open device "/dev/input/event14"
      Device discovery cannot open device "/dev/input/event15"
      Device discovery cannot open device "/dev/input/event2"
      Device discovery cannot open device "/dev/input/event3"
      Device discovery cannot open device "/dev/input/event4"
      Device discovery cannot open device "/dev/input/event5"
      Device discovery cannot open device "/dev/input/event6"
      Device discovery cannot open device "/dev/input/event7"
      Device discovery cannot open device "/dev/input/event8"
      Device discovery cannot open device "/dev/input/event9"
      Device discovery cannot open device "/dev/input/mice"
      Device discovery cannot open device "/dev/input/mouse0"
      Device discovery cannot open device "/dev/input/event0"
      Device discovery cannot open device "/dev/input/event1"
      Device discovery cannot open device "/dev/input/event10"
      Device discovery cannot open device "/dev/input/event11"
      Device discovery cannot open device "/dev/input/event12"
      Device discovery cannot open device "/dev/input/event13"
      Device discovery cannot open device "/dev/input/event14"
      Device discovery cannot open device "/dev/input/event15"
      Device discovery cannot open device "/dev/input/event2"
      Device discovery cannot open device "/dev/input/event3"
      Device discovery cannot open device "/dev/input/event4"
      Device discovery cannot open device "/dev/input/event5"
      Device discovery cannot open device "/dev/input/event6"
      Device discovery cannot open device "/dev/input/event7"
      Device discovery cannot open device "/dev/input/event8"
      Device discovery cannot open device "/dev/input/event9"
      Device discovery cannot open device "/dev/input/mice"
      Device discovery cannot open device "/dev/input/mouse0"
      Device discovery cannot open device "/dev/input/event0"
      Device discovery cannot open device "/dev/input/event1"
      Device discovery cannot open device "/dev/input/event10"
      Device discovery cannot open device "/dev/input/event11"
      Device discovery cannot open device "/dev/input/event12"
      Device discovery cannot open device "/dev/input/event13"
      Device discovery cannot open device "/dev/input/event14"
      Device discovery cannot open device "/dev/input/event15"
      Device discovery cannot open device "/dev/input/event2"
      Device discovery cannot open device "/dev/input/event3"
      Device discovery cannot open device "/dev/input/event4"
      Device discovery cannot open device "/dev/input/event5"
      Device discovery cannot open device "/dev/input/event6"
      Device discovery cannot open device "/dev/input/event7"
      Device discovery cannot open device "/dev/input/event8"
      Device discovery cannot open device "/dev/input/event9"
      Device discovery cannot open device "/dev/input/mice"
      Device discovery cannot open device "/dev/input/mouse0"
      no screens available, assuming 24-bit color
      QFactoryLoader::QFactoryLoader() checking directory path "/usr/local/Qt-5.13.2/plugins/styles" ...
      QFactoryLoader::QFactoryLoader() checking directory path "/Development/Projects/AppPort/styles" ...
      QFactoryLoader::QFactoryLoader() checking directory path "/usr/local/Qt-5.13.2/plugins/accessiblebridge" ...
      QFactoryLoader::QFactoryLoader() checking directory path "/Development/Projects/AppPort/accessiblebridge" ...
      QFactoryLoader::QFactoryLoader() checking directory path "/usr/local/Qt-5.13.2/plugins/iconengines" ...
      QFactoryLoader::QFactoryLoader() looking at "/usr/local/Qt-5.13.2/plugins/iconengines/libqsvgicon.so"
      Found metadata in lib /usr/local/Qt-5.13.2/plugins/iconengines/libqsvgicon.so, metadata=
      {
          "IID": "org.qt-project.Qt.QIconEngineFactoryInterface",
          "MetaData": {
              "Keys": [
                  "svg",
                  "svgz",
                  "svg.gz"
              ]
          },
          "archreq": 0,
          "className": "QSvgIconPlugin",
          "debug": false,
          "version": 331008
      }
      
      
      Got keys from plugin meta data ("svg", "svgz", "svg.gz")
      QFactoryLoader::QFactoryLoader() checking directory path "/Development/Projects/AppPort/iconengines" ...
      Cannot create window: no screens available
      Aborted (core dumped)
      
      
      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @gvanvoor Did you try to change the access rights on the device file or add your user the the group with access to device file?

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

      G 1 Reply Last reply
      1
      • jsulmJ jsulm

        @gvanvoor Did you try to change the access rights on the device file or add your user the the group with access to device file?

        G Offline
        G Offline
        gvanvoor
        wrote on last edited by
        #3

        @jsulm No I didn't. Can you tell me how? This goes beyond my limited linux knowledge :-(

        jsulmJ 1 Reply Last reply
        0
        • G gvanvoor

          @jsulm No I didn't. Can you tell me how? This goes beyond my limited linux knowledge :-(

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

          @gvanvoor There should be something like /dev/fb0 (file name can be different). Find out what is used in your case and check access rights:

          ls -lh /dev/fb0
          

          You will then see which group is set on the device file. And your user to that group.

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

          1 Reply Last reply
          1
          • G Offline
            G Offline
            gvanvoor
            wrote on last edited by gvanvoor
            #5

            That did the trick. There are still problems but that's in my own code.
            Thanks.

            L 1 Reply Last reply
            0
            • G gvanvoor

              That did the trick. There are still problems but that's in my own code.
              Thanks.

              L Offline
              L Offline
              lixu
              wrote on last edited by
              #6

              @gvanvoor
              I've had the same problem. Use the following command to solve your current problem:

              export QT_QPA_PLATFORM=linuxfb:tty=/dev/fb0

              Now, however, there are new problem:

              Failed to mmap framebuffer (Invalid argument)
              linuxfb: Failed to initialize screen
              Segmentation fault

              Have you encountered this problem in debugging and solve it?

              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