Skip to content

[email protected] fails with error: No usable sandbox! #16631

Closed

Description

@vladimiry

electron: 5.0.0-beta.1
platform: linux x64

Actual behavior

https://github.com/electron/electron-quick-start app fails to start with the following error:

[3937:0131/003107.790938:FATAL:zygote_host_impl_linux.cc(116)] No usable sandbox! Update your kernel or see https://chromium.googlesource.com/chromium/src/+/master/docs/linux_suid_sandbox_development.md for more information on developing with the SUID sandbox. If you want to live dangerously and need an immediate workaround, you can try using --no-sandbox.

To Reproduce

  • git clone https://github.com/electron/electron-quick-start.git
  • cd electron-quick-start
  • npm install
  • npm add --only=dev [email protected]
  • any of the following commands fail:
    • npm start
    • node_modules/.bin/electron --version

Additional Information

Worth to mention that event just node_modules/.bin/electron --version execution fails with the same error.

CC @nornagon

Activity

  1. nornagon commented on Jan 30, 2019

    @nornagon
    Contributor

    Are you running electron inside docker?

  2. vladimiry commented on Jan 31, 2019

    @vladimiry
    Author

    I'm not running it insider docker. But there will be a need to run it on Travis CI (e2e tests in headless mode).

  3. MarshallOfSound commented on Jan 31, 2019

    @MarshallOfSound
    Member

    @vladimiry What machine / environment are you currently running this on to get this error.

    OS? Is it containerized? OS Version? User Permisions? Running as sudo? Etc.

    As much info as you can provide about your environment would be incredibly helpful

  4. vladimiry commented on Jan 31, 2019

    @vladimiry
    Author

    Linux manjaro 4.20.3-1-MANJARO. No sudo. Regular user. No containerization.

    Running sudo sysctl kernel.unprivileged_userns_clone=1 makes [email protected] work. But I don't believe that stable electron@5 version will require users to modify the system settings in order to allow electron@v5 based apps starting.

    I understand it's probably due to the sandboxing enabled by default without testing sandboxing support by the system. Besides, there might be needed a way to detect at the app level whether sandboxing supported by the system, method like app.isSandboxingSupported(). So there would be a way to inform app user with the respective message and recommendations.

  5. MarshallOfSound commented on Jan 31, 2019

    @MarshallOfSound
    Member

    @vladimiry Can you confirm that chromium runs on that system with no extra configuration.

  6. vladimiry commented on Jan 31, 2019

    @vladimiry
    Author

    I'm able to start chromium-71.0.3578.98-3 on that system. Here is the console output:

    [15156:15156:0131/095653.119829:ERROR:sandbox_linux.cc(364)] InitializeSandbox() called with multiple threads in process gpu-process.
    [15126:15126:0131/095653.252765:ERROR:x11_input_method_context_impl_gtk.cc(144)] Not implemented reached in virtual void libgtkui::X11InputMethodContextImplGtk::SetSurroundingText(const base::string16 &, const gfx::Range &)
    

    Console output remains the same regardless of the kernel.unprivileged_userns_clone value.

  7. nornagon commented on Jan 31, 2019

    @nornagon
    Contributor
  8. vladimiry commented on Jan 31, 2019

    @vladimiry
    Author

    Does your distro modify chromium?

    It seems to be including the following patches https://git.archlinux.org/svntogit/packages.git/tree/trunk?h=packages/chromium

    Manjaro Linux goes with kernel.unprivileged_userns_clone disabled by default. But even if a user has intentionally disabled that option having it enabled by default, I think that any electron app still should be able to start.

  9. vladimiry commented on Jan 31, 2019

    @vladimiry
    Author

    @nornagon by the way if I run chromium-71.0.3578.98-3 like this chromium --disable-setuid-sandbox I get the error same as in original message:

    [3138:3138:0131/102333.898710:FATAL:zygote_host_impl_linux.cc(116)] No usable sandbox! Update your kernel or see https://chromium.googlesource.com/chromium/src/+/master/docs/linux_suid_sandbox_development.md for more information on developing with the SUID sandbox. If you want to live dangerously and need an immediate workaround, you can try using --no-sandbox.
    Trace/breakpoint trap (core dumped)
    

    And it starts well with --no-sandbox option added chromium --no-sandbox --disable-setuid-sandbox.

  10. vladimiry commented on Jan 31, 2019

    @vladimiry
    Author

    sandbox

  11. nornagon commented on Jan 31, 2019

    @nornagon
    Contributor

    Interesting. The setuid sandbox has been deprecated for a long time in Chromium, see e.g. https://chromium.googlesource.com/chromium/src/+/HEAD/docs/linux_suid_sandbox.md, and hasn't ever been supported in Electron to my knowledge. But according to https://chromium.googlesource.com/chromium/src/+/HEAD/docs/linux_sandboxing.md#sandbox-types-summary it's still maintained. Perhaps we should consider supporting it in Electron.

  12. vladimiry commented on Jan 31, 2019

    @vladimiry
    Author

    Arch Linux and distributives based on it are quite popular on desktop and [email protected] fails there since user namespaces sandboxing is forced. User namespaces sandboxing can only be enabled on those systems by manual kernel.unprivileged_userns_clone option tweaking (root/sudo access rights required). So I'd imagine electron to try user namespaces sandbox first and fallback to setuid sandbox if the primary option is unsupported by the system.

  13. sebakerckhof commented on Feb 13, 2019

    @sebakerckhof
    Contributor

    I'm seeing the same issue on Debian 9.5

  14. vladimiry commented on Mar 25, 2019

    @vladimiry
    Author

    Just tried v5.0.0-beta.6 and I confirm that setuid sandbox works for me now.

    For those who use electron-builder the simplest way to run chmod 4755 ./dist/linux-unpacked/chrome-sandbox before packaging is doing that in after-pack script, something to this one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions