Dear Toradex team,
A third party Qt GUI application does not display when executed as user root
but is displayed when executed as user torizon
. How does the user id affects display on a weston container ?
Here is a bit of context :
I try to run a third party application to manage a USB3 camera (IDS-imaging drivers and GUI interface -
IDS peak 2.8.0 for Linux ARMv8 (64-bit) - Debian package)
The application runs in its own debug container (privileged=true and user : 0:0) and depends on weston-vivante:3.
The application needs to run as root
in order to access the USB3 camera (the camera is then correctly detected - The camera won’t be detected if executed as user torizon
). I can test the camera detection using some command line interface.
Now, I also would like to use the IDS-Imaging GUI front-end (showing video on the HDMI screen), but it does not launch as root
due to a display issue (see logs here below with QT_DEBUG_PLUGINS=1). However, when the GUI is ran as user torizon
, it nicely displays (see second log here after). In other words I have one part of the application that must run as root
(camera detection) while the other part must run as torizon
(image display). But I would like to have both at the same time !
Here are the logs depending on user :
Third party IDS-Imaging GUI ran as user root
fails
root@apalis-imx8-14716873:/# export QT_DEBUG_PLUGINS=1
root@apalis-imx8-14716873:/# export QT_QPA_PLATFORM="xcb"
root@apalis-imx8-14716873:/# /usr/lib/ids/bin/ids_peak_cockpit
QFactoryLoader::QFactoryLoader() checking directory path "/usr/lib/aarch64-linux-gnu/qt5/plugins/platforms" ...
QFactoryLoader::QFactoryLoader() looking at "/usr/lib/aarch64-linux-gnu/qt5/plugins/platforms/libqeglfs.so"
Found metadata in lib /usr/lib/aarch64-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": 331520
< ...
many more similar messages
...>
Got keys from plugin meta data ("xcb")
QFactoryLoader::QFactoryLoader() checking directory path "/usr/lib/ids/bin/platforms" ...
loaded library "/usr/lib/aarch64-linux-gnu/qt5/plugins/platforms/libqxcb.so"
Authorization required, but no authorization protocol specified
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 (core dumped)
Third party IDS-Imaging GUI ran as user torizon
succeeds
root@apalis-imx8-14716873:/# su torizon
$ export QT_DEBUG_PLUGINS=1
$ export QT_QPA_PLATFORM="xcb"
$ /usr/lib/ids/bin/ids_peak_cockpit
QFactoryLoader::QFactoryLoader() checking directory path "/usr/lib/aarch64-linux-gnu/qt5/plugins/platforms" ...
QFactoryLoader::QFactoryLoader() looking at "/usr/lib/aarch64-linux-gnu/qt5/plugins/platforms/libqeglfs.so"
Found metadata in lib /usr/lib/aarch64-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": 331520
}
<...
many more similar messages
...>
Got keys from plugin meta data ("xcb_glx")
QFactoryLoader::QFactoryLoader() checking directory path "/usr/lib/ids/bin/xcbglintegrations" ...
loaded library "/usr/lib/aarch64-linux-gnu/qt5/plugins/xcbglintegrations/libqxcb-glx-integration.so"
loaded library "/usr/lib/aarch64-linux-gnu/qt5/plugins/xcbglintegrations/libqxcb-egl-integration.so"
QFactoryLoader::QFactoryLoader() checking directory path "/usr/lib/aarch64-linux-gnu/qt5/plugins/accessiblebridge" ...
QFactoryLoader::QFactoryLoader() checking directory path "/usr/lib/ids/bin/accessiblebridge" ...
Now, a custom application I have developed also run as root
but in this case the GUI is shown successfully. Here are the logs :
Custom GUI as user root
succeed.
qt.core.plugin.factoryloader: checking directory path "/usr/lib/aarch64-linux-gnu/qt6/plugins/platforms" ...
qt.core.plugin.factoryloader: looking at "/usr/lib/aarch64-linux-gnu/qt6/plugins/platforms/libqminimal.so"
qt.core.plugin.loader: Found metadata in lib /usr/lib/aarch64-linux-gnu/qt6/plugins/platforms/libqminimal.so, metadata=
{
"IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
"MetaData": {
"Keys": [
"minimal"
]
},
"archlevel": 0,
"className": "QMinimalIntegrationPlugin",
"debug": false,
"version": 394240
}
<...
many more similar messages
...>
qt.core.plugin.factoryloader: Got keys from plugin meta data QList("vnc")
qt.core.plugin.factoryloader: checking directory path "/root/app/platforms" ...
qt.core.library: "/usr/lib/aarch64-linux-gnu/qt6/plugins/platforms/libqwayland-generic.so" loaded library
QStandardPaths: runtime directory '/tmp/1000-runtime-dir' is not owned by UID 0, but a directory permissions 0700 owned by UID 1000 GID 0
qt.core.plugin.factoryloader: checking directory path "/usr/lib/aarch64-linux-gnu/qt6/plugins/platformthemes" ...
qt.core.plugin.factoryloader: checking directory path "/root/app/platformthemes" ...
qt.core.plugin.factoryloader: checking directory path "/usr/lib/aarch64-linux-gnu/qt6/plugins/styles" ...
qt.core.plugin.factoryloader: checking directory path "/root/app/styles" ...
So it seems there is no fundamental limitation to display on Weston when launched as user root
but it does not work for all applications.
Do you have some hint why it behaves like this ? Is there some environment variable I should set on the application side, or alternatively modify the Weston configuration ?
Best regards,
Fabian