Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Running as root without --no-sandbox is not supported

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

Scheduled Pinned Locked Moved Unsolved General and Desktop
7 Posts 3 Posters 22.8k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Slei
    wrote on 18 Sept 2018, 13:47 last edited by Slei
    #1

    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

    J 1 Reply Last reply 18 Sept 2018, 14:04
    0
    • S Slei
      18 Sept 2018, 13:47

      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

      J Offline
      J Offline
      JonB
      wrote on 18 Sept 2018, 14:04 last edited by
      #2

      @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 .)

      G 1 Reply Last reply 28 Jan 2023, 20:54
      1
      • S Offline
        S Offline
        Slei
        wrote on 18 Sept 2018, 14:25 last edited by
        #3

        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 :(

        J 1 Reply Last reply 18 Sept 2018, 14:32
        0
        • S Slei
          18 Sept 2018, 14:25

          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 :(

          J Offline
          J Offline
          JonB
          wrote on 18 Sept 2018, 14:32 last edited by
          #4

          @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?

          1 Reply Last reply
          0
          • S Offline
            S Offline
            Slei
            wrote on 19 Sept 2018, 07:44 last edited by Slei
            #5

            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

            J 1 Reply Last reply 19 Sept 2018, 08:11
            0
            • S Slei
              19 Sept 2018, 07:44

              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

              J Offline
              J Offline
              JonB
              wrote on 19 Sept 2018, 08:11 last edited by
              #6

              @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.

              1 Reply Last reply
              0
              • J JonB
                18 Sept 2018, 14:04

                @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 .)

                G Offline
                G Offline
                gillianshanks
                wrote on 28 Jan 2023, 20:54 last edited by
                #7

                @JonB This worked for me. Thanks a lot.

                1 Reply Last reply
                0

                • Login

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • Users
                • Groups
                • Search
                • Get Qt Extensions
                • Unsolved