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
Forum Updated to NodeBB v4.3 + New Features

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

Scheduled Pinned Locked Moved Unsolved General and Desktop
7 Posts 3 Posters 23.1k 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 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

    JonBJ 1 Reply Last reply
    0
    • S 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

      JonBJ Online
      JonBJ Online
      JonB
      wrote on 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
      1
      • S Offline
        S Offline
        Slei
        wrote on 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 :(

        JonBJ 1 Reply Last reply
        0
        • S Slei

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

          JonBJ Online
          JonBJ Online
          JonB
          wrote on 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 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

            JonBJ 1 Reply Last reply
            0
            • S 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

              JonBJ Online
              JonBJ Online
              JonB
              wrote on 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
              • JonBJ JonB

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