Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

FATAL: Running as root without --no-sandbox is not supported using Electron 7.1.3. on Debian 8, 9

I installed Electron 7.1.3, when I try to run the app this error appears:

FATAL:atom_main_delegate.cc(211)] Running as root without --no-sandbox is not supported. See https://crbug.com/638180

This happens when I use Debian 8 or 9. I used it on Windows and this runs with no problem. I was searching info about this problem but I didn't find something concrete with Electron and Debian, only run: electron --no-sandbox

If someone knows how to solve this, I wanna use Debian here.

like image 777
Oscar Avatar asked Dec 05 '19 20:12

Oscar


2 Answers

I had a similar issue when I run my electron app with sudo:

sudo ./MyElectronApp

[5612:0301/101026.813638:FATAL:electron_main_delegate.cc(211)] Running as root without --no-sandbox is not supported. See https://crbug.com/638180.

so In order to add --no-sandbox parameter I did:

sudo ./MyElectronApp --no-sandbox

and it worked!! :)

I thought I had to build my app with parameter but it does not work.

like image 148
Nexus242 Avatar answered Nov 03 '22 06:11

Nexus242


Quote from Process Sandboxing to explain what a sandbox does:

One key security feature in Chromium is that processes can be executed within a sandbox. The sandbox limits the harm that malicious code can cause by limiting access to most system resources — sandboxed processes can only freely use CPU cycles and memory. To perform operations requiring additional privilege, sandboxed processes use dedicated communication channels to delegate tasks to more privileged processes.

In Chromium, sandboxing is applied to most processes other than the main process. This includes renderer processes, as well as utility processes such as the audio service, the GPU service, and the network service.

And quote from Disabling Chromium's sandbox (testing only):

You can also disable Chromium's sandbox entirely with the --no-sandbox CLI flag, which will disable the sandbox for all processes (including utility processes). We highly recommend that you only use this flag for testing purposes, and never in production.

To disable it, run <your-app-name> --no-sandbox.

like image 1
Wenfang Du Avatar answered Nov 03 '22 05:11

Wenfang Du