Running as root without --no-sandbox is not supported
-
wrote on 18 Sept 2018, 13:47 last edited by Slei
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
-
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
wrote on 18 Sept 2018, 14:04 last edited byTo 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
.) -
wrote on 18 Sept 2018, 14:25 last edited by
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 :(
-
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 :(
wrote on 18 Sept 2018, 14:32 last edited by-
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?
-
-
wrote on 19 Sept 2018, 07:44 last edited by Slei
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
-
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
wrote on 19 Sept 2018, 08:11 last edited by@Slei
I would never want to run a UI app undersudo
!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.
-
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
.)wrote on 28 Jan 2023, 20:54 last edited by@JonB This worked for me. Thanks a lot.