Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Running as root without --no-sandbox is not supported



  • Hey

    I'm trying to run my QT UI app as root (which uses the webengineview stuff in qml), but I get the following error:

    ERROR:zygote_host_impl_linux.cc(90)] Running as root without --no-sandbox is not supported. See https://crbug.com/638180
    

    I've done a little research and the solution seems to be adding --no-sandbox as argument when executing my app:

    sudo ./MyApp --no-sandbox

    but somehow i still get the same issue.

    Can anyone help?

    BTW: I'm using cmake for my project, and the issue only occurs on Ubuntu/Linux, running with root on OSX works fine



  • @Slei

    To explicitly disable sandboxing, the QTWEBENGINE_DISABLE_SANDBOX environment variable can be set to 1 or alternatively the --no-sandbox command line argument can be passed to the user application executable.

    Does the environment variable work for you instead? (I assume that would be sudo env QTWEBENGINE_DISABLE_SANDBOX=1 ./MyApp.)



  • I've tried to use it but with export in a script
    which didn't work, but your example seems to work find.

    Only issue I have now is taht my Systemtray Icon is missing when executing it this way :(



  • @Slei

    • You could show me whatever you tried in a script (and how you invoked it) to see if I can spot why you say does not work compared against my env ... command-line.

    • I don't know a lot about "system tray icons" (they don't exist in my Ubuntu with Unity desktop)! Why is this any different whether you invoke it with environment variable vs command-line argument?



  • my initial guess is that the context is fuckedup when trying to start the ui with sudo while the desktop itself is not running with sudo and therefore has issues with the systemtray icon. Seems like it is bad in general to run ui's in sudo for linux



  • @Slei
    I would never want to run a UI app under sudo!

    But this has nothing to do with whether you run yours with command-line argument versus environment variable, which is what I thought you were saying was the issue with the latter. But it appears not. If you still want me to look at your script attempt then post it.


Log in to reply