Do B2QT programs always have to run as root
-
We're building a system that runs in a Raspberry Pi3 using B2QT. Is seems to me that applications compiled to run under B2QT are always run as root. Is this true?
-
Hi,
Boot2Qt being a commercial product, you should bring this question to the Qt Company. You can try the interest mailing list. You'll find there Qt's developers/maintainers. This forum is more user oriented.
-
Wouldn't it be very relevant to users of the non-commercial meta-b2qt layer?
http://blog.qt.io/blog/2016/07/01/aligning-with-the-yocto-project/
-
Sure it is, however, I don't know have many of the forum users may have used that meta layer and could answer that question hence pointing @GregWilsonLindberg to potentially better place to get an answer.
-
@GregWilsonLindberg said in Do B2QT programs always have to run as root:
We're building a system that runs in a Raspberry Pi3 using B2QT. Is seems to me that applications compiled to run under B2QT are always run as root. Is this true?
It is indeed possible to run a B2Qt application as user (not root), but of course the user needs access to required devices, the most fundamental ones being video and input devices.
As a small example add your user to the video and input groups:
usermod -a -G video,input myuser
and then create an appropriate
XDG_RUNTIME_DIR
:mkdir /run/user/1000
and set the corresponding value in
/etc/default/qt
.
Last, adjust the value ofUser=
parameter in the systemd service (e.g.:/lib/systemd/system/qtlauncher.service
).Additional permissions may be required for other features like reproducing audio, etc, but with the above tweaks the application should at least start the B2Qt application as
myuser
.