Skip to content
This repository has been archived by the owner on Feb 16, 2024. It is now read-only.

Running as root without --no-sandbox is not supported. See https://crbug.com/638180. #94

Closed
vivekvardha opened this issue Jun 23, 2021 · 3 comments

Comments

@vivekvardha
Copy link

I am facing the error in title when I try to run the app with sudo privileges.

I created the new window as follows.

	var w *astilectron.Window
	if w, err = a.NewWindow("sample/logs.html", &astilectron.WindowOptions{
		Center:   astikit.BoolPtr(true),
		Height:   astikit.IntPtr(700),
		Width:    astikit.IntPtr(700),
		MinWidth: astikit.IntPtr(100),
		**WebPreferences: &astilectron.WebPreferences{Sandbox: astikit.BoolPtr(false)}**,
	}); err != nil {
		log.Println(fmt.Sprintf("main: new window failed: %w", err))
	}

By initializing Sandbox under WebPreferences to 'false', I thought it would solve the problem but it did not work.
Any leads to fix/workaround this would be of great help.

@asticode
Copy link
Owner

You could try using ElectronSwitches. Basically they are flags you can provide to Electron.

In your case you could try setting it to []string{"--no-sandbox"}

@vivekvardha
Copy link
Author

@asticode thanks a lot for the quick input.
It worked :)

@asticode
Copy link
Owner

Cheers

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants