@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 of User= 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.