electron: [Bug]: The SUID sandbox helper binary was found, but is not configured correctly. Rather than run without sandboxing I'm aborting now.
Preflight Checklist
- I have read the Contributing Guidelines for this project.
- I agree to follow the Code of Conduct that this project adheres to.
- I have searched the issue tracker for a bug report that matches the one I want to file, without success.
Electron Version
30.1.0
What operating system are you using?
Ubuntu
Operating System Version
Kubuntu 24.04
What arch are you using?
x64
Last Known Working Electron version
Unknown
Expected Behavior
Upgrading Kubuntu from 23.10 to 24.04 should not cause this error even after clearing node_modules and running yarn cache clean.
I also manually ensured there were no cached versions of Electron.
Actual Behavior
This error persists and I cannot run our project.
Testcase Gist URL
No response
Additional Information
Only began after upgrading Kubuntu to 24.04.
About this issue
- Original URL
- State: open
- Created 2 years ago
- Reactions: 66
- Comments: 67 (27 by maintainers)
Links to this issue
Commits related to this issue
- Fix CI/CD runtime checks failing on Ubuntu 24.04 GitHub runners now use Ubuntu 24.04, which introduces new restrictions on unprivileged user namespaces affecting AppImages. This causes runtime checks... — committed to undergroundwires/privacy.sexy by undergroundwires 2 years ago
- Fix CI/CD runtime checks failing on Ubuntu 24.04 GitHub runners now use Ubuntu 24.04, which introduces new restrictions on unprivileged user namespaces affecting AppImages. This causes runtime checks... — committed to undergroundwires/privacy.sexy by undergroundwires 2 years ago
- Fix CI/CD runtime checks failing on Ubuntu 24.04 GitHub runners now use Ubuntu 24.04, which introduces two issues affecting Electron application runtime checks: 1. AppArmor restrictions on unprivile... — committed to undergroundwires/privacy.sexy by undergroundwires 2 years ago
- fix startup error on ubuntu 24.04.1 https://github.com/electron/electron/issues/42510 — committed to dyllandry/desktop-clocks by dyllandry 2 years ago
- Fix Electron CI Ref: https://github.com/Level/classic-level/pull/112#issuecomment-2614519926 Ref: https://github.com/electron/electron/issues/42510#issuecomment-2171583086 Category: none — committed to Level/classic-level by vweevers 2 years ago
- Fix: Ubuntu GitHub test action (#643) The `ubuntu-latest` tag was changed to point to Ubuntu 24.04 and has caused regressions. See https://github.com/microsoft/playwright/issues/34251 and https://git... — committed to brafdlog/caspion by whatuserever 2 years ago
- Upgrade electron-builder to v26 Fixes a bug where running the app in Linux would not work due to the chrome-sandbox not being accessible. See: https://github.com/electron/electron/issues/42510 See: ... — committed to ulkuehn/Deus-In-Machina by FinnWoelm 2 years ago
- don't make AppImages Ubuntu won't run AppImages because of sandboxing: see https://github.com/electron/electron/issues/42510 — committed to numbas/numbas-lockdown-app by christianp 2 years ago
- Remove AppImages per github.com/electron/electron/issues/42510 — committed to quine-global/hyper by philip-peterson 2 years ago
- Revert "Remove AppImages per github.com/electron/electron/issues/42510" This reverts commit e10f637999c6bccc7da016a90a8a43b3d70ee30f. — committed to quine-global/hyper by philip-peterson 2 years ago
- ci: Upgrade linux jobs' Ubuntu image The `ubuntu-20.04` image has been deprecated since 2025-04-15 and jobs still using it are automatically cancelled by Github Actions. See https://github.com/... — committed to cozy-labs/cozy-desktop by taratatach 2 years ago
- Fix CI/CD runtime checks failing on Ubuntu 24.04 GitHub runners now use Ubuntu 24.04, which introduces two issues affecting Electron application runtime checks: 1. AppArmor restrictions on unprivile... — committed to Debric008/privacy.sexy by Debric007 2 years ago
I found why it is failing, and I also found the solution.
2.3.2 AppImage fails to start due to missing sandboxing #2429 As mentioned in the reference documentation, the problem is that Ubuntu 24.04 implemented new restrictions for AppImage apps, which restricts the use of sandboxes.
The solution is to lift the restrictions that Ubuntu 24.04 implements in the AppImages.
for deactivate restrictions
for activate restrictions
I hope it serves as a temporary solution.
After reading through all of this and so much more, I believe I found the solution that works for me. I will simply uninstall and find a different product to use. No more issue.
o7 Thank you and have a nice day.
For all of you sticking it out, I truly hope you find a workable answer. Good luck.
Same for me - after update to ubuntu 24.04.
I’ve been following this thread and there’s a lot of struggle here. While I don’t think I can solve everyone’s sadness on this thread I can share what we at Foxglove have done for our Electron application which works across Ubuntu 22 and 24. I learned this from this issue: https://github.com/electron/electron/issues/41066
For Ubuntu, we distribute our application via a
.debfile which you can download from our website. When we make this deb file, we include apostinstscript. This is a feature ofdebpackages and offers a script which runs on the user’s machine as part of the install process. This typically happens as “root” via “sudo” or similar invocation likesudo apt install /path/to/file.debor equivalentdpkgcommand to install a file.For your application’s
postinstfile you would update the references to/opt/Foxglove\ Studio/foxglove-studioto whatever is appropriate for your app name and binary path.With this file you get a file that works on Ubuntu 22 and Ubuntu 24. There are other ways you could detect Ubuntu 22 but this is what we went with and its been working for many months.
This is the full error message:
Needing to run that every time we reinstall our dependencies is very tedious, and in a case where someone is not allowed root access then this becomes impossible to work around?
How can we even use Electron-Fiddle now? This leads to bug upon bug upon bug trying to do simple debugging and in 7 months we’ve seen a single message from a single Electron team member and no resolution or even workaround.
To say nothing of the serious issues this causes for users of application.
I don’t have stakes in the strategies here but will highlight some of the differences on the above and why the apparmor approach can be seen as different.
You are disabling the sandboxing features of Chrome which has implications on what code you might run in your renderer is able to execute on your system. Depending on the kind of app you have this may or may not matter to you or your users.
You are disabling this setting system wide for any application. Why this is a new restriction that Ubuntu feels is important in Ubuntu 24 I cannot say (I am sure there are long debate threads on this issue somewhere). However, allowing namespaces for whatever feature needs from them in Chrome is still allowing the “sandbox” behavior to function which again is a layer of “protection” depending on your app.
You are working around the new Ubuntu default for your one specific application thus not increasing the risk profile of the user’s machine away from the default choices of their system.
I just hit this running the cursor ai app image cursor-0.41.3x86_64.AppImage and I can’t see an easy way to work around it.
We are experiencing a similar issue with our Electron-based CLI application on Ubuntu 24. The application fails to run, and no suggested workarounds (e.g., using --no-sandbox or modifying permissions) have not resolved the issue.
Environment Details: OS Version: Ubuntu 24 Electron Version: 28.2.3 Error Context: Similar to the reported, the sandbox helper binary configuration seems to cause the problem. Additional Notes: This impacts the CLI functionality of our application, rendering it unusable on Ubuntu 24.
We would appreciate any updates or suggestions for how to fix this issue or an ETA on a potential fix.
I have such a hard time believing that
--no-sandboxis less secure than literally giving the Electron app root access so it can create an AppArmor profile. What am I missing?./SomeElectronAppFromTheInternet.AppImage --no-sandbox: That’s so insecure, are you crazy?sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0: That’s so insecure, are you crazy?sudo ./SomeElectronAppFromTheInternet.AppImage --create-apparmor-profile: Ah, yes. The secure way to handle things. Finally, we’re taking security seriously.Hello, this is a little bit late. I also encounter the same error once I shifted my OS to Lubuntu 24.04. Since I didn’t want to grant unprivileged access using root, I just did this on my
package.jsoneverytime I runnpm start. Take note this is for my scenario and personal preference. Anyways, if you’ll try this, tell me if you encounter any problems. Thanks."scripts": { "start": "electron . --no-sandbox" },To make the changes suggested by @frfernandezdev persist after a reboot, I added this line to
/etc/sysctl.conf:kernel.apparmor_restrict_unprivileged_userns=0Disclaimer: Probably not the best move from a security standpoint, but whatever.
In my case, this solution was not successful.
A more targeted and safe, although more tedious, temporary solution is:
sudo chown root ./node_modules/electron/dist/chrome-sandbox && sudo chmod 4755 ./node_modules/electron/dist/chrome-sandboxBut you’ll have to reapply it any time the
node_modulesis rewritten, so it’s really very tedious. It can also cause permission errors because it can cause folders you create to end up owned byroot, and then inaccessible to normal users.Thanks work on Ubuntu 24 LTS
x2
@SociallyDyslexic @Nantris @ejrydhfs
you know the meme that says it’s not a bug, it’s a feature? well, fairly enough i guess this is the case with this issue
it’s related to the security updates following the release of Ubuntu 23.##~
Ubuntu 24.04 implements a stricter security model through AppArmor that specifically targets unprivileged user namespaces2.
you can review the full article that i made after encountering the same issue with similar apps that uses sandboxing and AppImages~
For a complete understanding of this issue, including technical details, implementation specifics, you can take a look at:
For a more direct practical solutions, you can take a look at:
pretty sure they’ll be helpfull and provide recommended solutions along with work arounds
Greetings
A similar issue was reported here: https://github.com/mullvad/mullvadvpn-app/issues/6128#issuecomment-2425147247.
The resolution proposed was the implementation of an AppArmor profile.
Hi, after the last update to version 5.3.0 on ubuntu 24.04 I got this error:
I solved with the following
Probably the best way to solve the problem is to create an apparmor profile which allows the application to make use of unprivileged usernamespaces.
https://askubuntu.com/a/1528215
I ran into this issue as well, but it doesn’t seem to affect all electron apps. (At least not on my PC). I recently upgraded my machine to Ubuntu 24.04.1 LTS and I use a self-made Electron app (test tool). The app was built some time ago (half a year or so) and not with the latest and greatest dependencies. It ran fine after upgrading. A few days ago, I needed to implement something new in it and decided to upgrade all the libs (angular primarily) as well as electron and electron-builder. After all the updates (electron 22.0.0 to 32.1.0 and electron-builder 22.14 to 25.0.5), I ran into this issue (from a .deb file). I downgraded all the way back to electron 22, but kept seeing the same. Until I downgraded electron-builder to 22 again and it magically worked… After some more trial-and-error, I now have a working version with electron 32.1.0 and electron-builder 24.13.3 (AppImage version also starts, BTW). I verified that kernel.apparmor_restrict_unprivileged_userns is still 1 on my machine.
hey @Nantris, I’m using Kubuntu 24.04 and Electron 30.0.7
Hey! it’d be great to have an official solution for this. My users are going through all kinds of trouble to open an app. It’s ridiculous.
I’m not saying you should fix it right now, but at least let us know where we’re at with this. This is one of my 3 biggest issues with Electron and the other 2 have been unaddressed.
I hope this one doesn’t run the same fate. I’ll be working on a migration strategy in the meantime because this is a blocking problem.
I don’t know what this means?
We use
electron-builderto build the app. I have to manage like 6 different installers with their own build processes already.Why does the Electron team not offer even a smidgen of advice to their many affected users, is a better question in my view.
Both seem unacceptably problematic to me. They’re fine for personal use, but can I really be recommending either to my users? I’m not so sure.
Perhaps I need to more clearly outline that it’s only for development. At the time I wasn’t even aware
AppImagewas affected, and god how much worse the problem is because of that…I’ve looked into this. You’ll probably have better luck trying to resolve the
AppImageproblem, sadly. Flatpak publishing is something of a nightmare for Electron.My thinking is that my solution might be adaptable for
AppImage, but somehow you have to deal with the fact thatAppImageis mounted to a random path - and I don’t know if or how that could be achieved.Hello everyone! Chiming in, as well.
I’m running into this problem with testing my own fork of LM Studio.
@Nantris’ solution isn’t working on my build. I have yet to try @defunctzombie’s method, but to do so would imply that I would need to re-factor my codebase to build
.debpackages rather than.AppImage. I’d rather avoid that rigmarole, but perhaps this is a lesson to not use.AppImage? Opinions will be diverse on this subject, but (and I can’t believe I’m saying this) due to this issue and others I’ve faced withAppImage, maybe I need to start looking atflatpakas my distribution alternative.For now, for my own local debugging and testing purposes, @arfeloreed’s script will suffice.
This is rough, needless to say. However, thanks everyone for posting their thoughts and workarounds regarding this issue. Below are my specs, if that helps anyone.
The saga continues. Wu-Tang.
https://www.electronjs.org/docs/latest/tutorial/sandbox
To the best of my understanding, sandboxing is considered important mostly because Electron is a web browser, which can parse and execute remote resources. For example, if your Electron app allows the user to find their way onto an external web page, it can be exposed to third-party code, which may be malign or just plain buggy. With no sandbox, these could crash or perhaps even infect the user’s PC.
If your Electron app permits no possible way to interact with arbitrary remote resources, then I think the worst case of
--no-sandboxis only that your buggy code might do bad things to the user’s system, like write files in the wrong place.@codebytere this affects the build
AppImagefiles.[132603:0822/194610.010414:FATAL:setuid_sandbox_host.cc(158)] The SUID sandbox helper binary was found, but is not configured correctly. Rather than run without sandboxing I'm aborting now. You need to make sure that /tmp/.mount_myappIHU3ft/chrome-sandbox is owned by root and has mode 4755.End users cannot meaningfully work around this because the affected file is in
tmp. I also can’t ask my users to just disable security features system-wide though.We need a more targeted solution here.
Electron 31.4.0 with electron-builder 24.14.3 and we’re completely dead in the water here. I haven’t gotten to try Electron 32 yet but I’d be fairly shocked if it “just works.”
I’m using electron 31.0.1 and electron-builder 24.13.3 and it’s not working for me.
Could we set up a script that does something like https://github.com/electron/electron/issues/42510#issuecomment-2332919348 on first boot if we detect that it’s needed? Prompt a user for sudo or something? I suppose if we’re prompting the user for sudo we could also chown or chmod the sandbox binary…
I mean, it’s pretty hilarious to say “running with
--no-sandboxis insecure, run with sudo instead!” but it would unbreak things. Running an AppImage you downloaded from the internet in userspace, are you crazy? Only running it as root is secure!thanks @Nantris! this helped me get past the initial error, but now I have another permissions error where
setuidis not running asrootI’ll keep looking into it but just wanted to say thank you 🙂
@8ionic thanks for sharing. What system did that help you on? That didn’t help us at all. It simply returns:
chromium-browser is already the newest version (2:1snap1-0ubuntu2).@gflujan sorry for any confusion. Here’s the file I have now, with a slight improvement:
@arfeloreed @maxbarry Thank you for the explanation 😃 This helps a lot!
Hi, as far as I know about it, I suggest not to use
--no-sandboxfor production environment. Never. It risks security vulnerabilities. Chromium sandboxing was mainly added for security features for electron apps. I was a little bit late in realizing this as well. Now, I only used it for development purposes since it was much easier, and it saves a lot of time. I can’t say for other Linux ditros if they are encountering this same problem or it is just an Ubuntu based. For running production build electron apps on my machine, I wrote a shell script to toggle this feature on and off. As you can see, I am a little bit lazy.@codebytere is this something that can be resolved or will we need to revert to using 23.10 indefinitely to avoid this? Every
yarn installbrings this issue back and it’s really making development a pain.Thanks for investigating and sharing! But it’s affecting even development where the app isn’t packaged. Is that still relevant?