Run application remotely in Wayland from Qt Creator
-
I have a Zynq Ultrascale+ device running a Linux operating system with Wayland (Weston) as the windowing system. I can run a Qt application from the SD card through the Wayland Terminal without issue. For development, I need to be able to transfer the application over the network and run it remotely. This process works without Wayland when I used the linuxfb platform so I believe the Device setup in Qt Creator is correct. But, I get the following output when I have Wayland running and try to launch an application from Qt Creator.
loaded library "/usr/lib/plugins/platforms/libqwayland-generic.so"
Failed to create wl_display (Permission denied)
Failed to create wl_display (Permission denied)
qt.qpa.plugin: Could not load the Qt platform plugin "wayland" in "/usr/lib/plugins/platforms" 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 (from /usr/lib/plugins/platforms), linuxfb (from /usr/lib/plugins/platforms), minimal (from /usr/lib/plugins/platforms), minimalegl (from /usr/lib/plugins/platforms), offscreen (from /usr/lib/plugins/platforms), vnc (from /usr/lib/plugins/platforms), wayland-egl (from /usr/lib/plugins/platforms), wayland (from /usr/lib/plugins/platforms), xcb (from /usr/lib/plugins/platforms), eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, wayland-egl, wayland, xcb.
The run environment variables set in Qt Creator are below:
DISPLAY=:0.0
QT_DEBUG_PLUGINS=1
QT_QPA_PLATFORM=wayland
QT_QPA_PLATFORM_PLUGIN_PATH=/usr/lib/plugins/platforms
XDG_RUNTIME_DIR=/run/user/0I believe Wayland requires root privileges to run applications and Qt Creator is set up as user in the Device menu. I am not sure what is usually done in this situation. Any help will be greatly appreciated.
-
Hi, yes sure looks like a root user vs. non-root user problem, see for example here
-
Hi, yes sure looks like a root user vs. non-root user problem, see for example here
Thank you for the quick reply. Unfortunately, that did not work for me.
I ran the following successfully on the device:sudo -E weston-launch -t /dev/tty7 -u petalinux &
(petalinux is the username)
But the Application Output in Qt Creator is the same. Do I need to change the Terminal field under Tools->Options->Environment->System->Terminal ?
-
I was able to run an application from Qt Creator in Wayland. I did this by providing the user as root in the Device menu in Qt Creator and providing the root password. In order to do this in Petalinux 2022.1, it is necessary to first enable "debug-tweaks" and then change the root password under the terminal for the device. "debug-tweaks" must be disabled during production for security.
Are there any reasons to not use this solution?