I am testing a Qt-based GUI application, generated with Qt creator in Ubuntu 20.04. This application uses a library, for which root privileges are required. Nevertheless, it is not possible to launch the application as root, because it cannot access the display.
If I start the application as normal user I get a modprobe error on the library:
$ CGUTLGUI_Qt
qt.core.qobject.connect: QObject::connect: No such signal QSignalMapper::mapped(int) in ../src/cgosfunc/cgosgpio.cpp:242
qt.core.qobject.connect: QObject::connect: (receiver name: 'CgosGPIO')
modprobe: ERROR: could not insert 'cgosdrv': Operation not permitted
If I start the application as root, it cannot connect to the display:
$ sudo CGUTLGUI_Qt
No protocol specified
qt.qpa.xcb: could not connect to display :1
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, vkkhrdisplay, vnc, wayland-egl, wayland, wayland-xcomposite-egl, wayland-xcomposite-glx, xcb.
I just need to to run the program in one way or another, it doesn't mind if I cannot fix both error. It would be fine either to start the GUI as root or to link the library as normal user.
The xhost program can be used to allow other users or systems access to the X display.
To allow root to access your X server, use this command:
$ xhost local:root
Related
When I'm connected through ssh, and tried to run kdbg I took this problem:
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.
Failed to create wl_display (No such file or directory)
qt.qpa.plugin: Could not load the Qt platform plugin "wayland" 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: wayland-org.kde.kwin.qpa, eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, wayland-egl, wayland, wayland-xcomposite-egl, wayland-xcomposite-glx, xcb.
I use KDE Plasma (X11), and Arch Linux.
I tried to reinstall qt6-base package, install qt5-base package, also found a lot of the same questions in other forums, but nothing helped to me
Firstly, as I understand, this concerned not only kdbg, but any program with a graphical interface.
Second I found explanations on Arch wiki in the article about OpenSSH https://wiki.archlinux.org/title/OpenSSH#X11_forwarding
So all i had to do, to solve this problem is add -X to the command. So instead of
ssh user#server-address
I wrote ssh -X user#server-address
While running a TensorFlow based Deep learning model in Graph mode execution, I got the error:
qt.qpa.xcb: could not connect to display
qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "/home/username/.conda/envs/slt/lib/python3.9/site-packages/cv2/qt/plugins" 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: xcb, eglfs, minimal, minimalegl, offscreen, vnc.
Aborted (core dumped)
I am running my code on a server via a local remote host and it's a ubuntu 20 Server-based single user os. ( That is no GUI Based Desktop Manager).
What is the above error mean?
If I'm not wrong and according to my understanding, QT Platform and its plugins are not installed. So how to install the QT Platform in the ubuntu server if my assumption is correct.
If not how to solve the above error. Can anyone please help me out
Setup: Windows -> WSL Ubuntu -> Docker
The first time I've started a project, it worked correctly. Second time, it cannot find the display for an unknown reason, as the container is executed with XAuth passed, and even in privileged mode it fails.
Project: Cutter docker dev build
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, xcb.
I am trying create a qt5 application on yocto using qtwayland. When I run my application, the 'Apllication Output' displays this error
"Failed to create display (No such file or directory) Application
finished with exit code 1." .
However, the bin file actually has successfully been deployed and I can run it on my board by opening the file manually. I can't debug on my board,either.
How can I figure it out, thank you.
I assume you are trying to create a Qt client application and run it on a wayland server?
On Wayland, Failed to create display (No such file or directory) means that a Wayland client couldn't connect to the compositor/display server.
So you should verify that your compositor is running. Which one are you using?
The environment variable, XDG_RUNTIME_DIR, also needs to be set both when the compositor is started and when your client is started.
If clients start when you run them on the device, it might be that the default platform for your qt installation is eglfs, not Wayland. In order to run the applications on Wayland, start it like this:
./myapp -platform wayland
or set
export QT_QPA_PLATFORM=wayland
Note that if you are running a Qt-based compositor, then the compositor should probably still be run with the eglfs backend
I've been using Qt library for several years, and recently tried it on Raspberry (Qt 5.6.0) for demonstration purposes and stuck on following item:
a) there was no problem in configuring/making library on host machine and following deployment to RPi
b) the console applications works well on RPi
c) the GUI application tells next on start (absense of EGLFS plugin):
root#rpi:/home/pi# ./testpi2
This application failed to start because it could not find or load the Qt platform plugin "eglfs"
in "".
Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen.
d) I checked that plugins are located in folder where "Qt" placed (in my case /usr/local/qt5pi/plugins/platforms), so plugins have been built and deployed)
e) I tried: export QT_PLUGIN_DIR=/usr/local/qt5pi/plugins
as well as: export QT_PLUGIN_DIR=/usr/local/qt5pi/plugins/platforms
but it didn't help.
Can you guess me in following steps ?