chrome-launcher icon indicating copy to clipboard operation
chrome-launcher copied to clipboard

unsupported flag --disable-setuid-sandbox

Open 1gluk opened this issue 8 years ago • 9 comments

I suggest removing this code, the flag is no longer used in chrome.

if (process.platform === 'linux') {
           flags.push('--disable-setuid-sandbox');
        }

1gluk avatar Sep 18 '17 13:09 1gluk

AFAIk this flag IS used: https://cs.chromium.org/search/?q=kDisableSetuidSandbox&sq=package:chromium&type=cs

See the zygote_host_impl_linux.cc results.

paulirish avatar Sep 19 '17 06:09 paulirish

Hi guys, I need to launch a headless chrome without this flag to run my tests. There is any particular reason to this flag be obligatory on Linux?

paulequilibrio avatar Sep 24 '17 02:09 paulequilibrio

This flag would cause this error and cannot launch chrome

27907:27907:0205/194525.657250:FATAL:zygote_host_impl_linux.cc(107)] 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.
[1]    27907 abort      /usr/bin/google-chrome-stable --disable-translate --disable-extensions 

zaaack avatar Feb 05 '18 11:02 zaaack

Any reason why @samccone's commit wasn't merged? I'd love to get rid of this annoying warning :thinking:

calebeby avatar Jul 06 '19 03:07 calebeby

@calebeby see https://github.com/GoogleChrome/chrome-launcher/pull/68#issuecomment-377825645, if you'd like to be the one to pick it up, be our guest :)

patrickhulce avatar Jul 06 '19 15:07 patrickhulce

@patrickhulce I'm not sure I completely understand the relation between this issue and the linked PR. If I submitted a PR that just removed the --disable-setuid-sandbox flag, but didn't do anything else related to Alpine linux, would that be accepted?

calebeby avatar Jul 06 '19 15:07 calebeby

any update on this?

marklochrie50265 avatar Aug 19 '19 14:08 marklochrie50265

This flag is still in use in the Chromium codebase AFAICT, so we would like to continue supporting it, but we've added ignoreDefaultFlags as a way to disable other default flags in chrome-launcher that doesn't yet affect this one.

If anyone would like to submit a PR that adds a check for ignoreDefaultFlags to https://github.com/GoogleChrome/chrome-launcher/blob/e67a10dffccd1d7509d671145b0b4ee368e34528/src/chrome-launcher.ts#L150-L152

I think that sounds good! 👍

patrickhulce avatar Aug 19 '19 15:08 patrickhulce

I have found a workaround for this on Linux.

You can use the ignoreDefaultFlags setting as follows:

const ChromeLauncher = require('chrome-launcher');

var flags = ChromeLauncher.Launcher.defaultFlags();

// optional: filter out flags
// Eg. Enabling extensions and Audio
// flags = flags.filter(flag => flag !== '--disable-extensions' && flag !== '--mute-audio')

// optional: Add you own flags
// flags.push('--proxy-server=192.168.101.200:8213')

ChromeLauncher.launch({
   startingUrl: ''
  ,userDataDir: '/dpool/vcmain/sys/chrome/profiles/CORP_DEV_LOCAL'
  ,ignoreDefaultFlags: true
  ,chromeFlags: flags
}).then(chrome => {
  console.log(`Chrome debugging port running on ${chrome.port}`);
});

JavaScriptDude avatar Oct 26 '21 23:10 JavaScriptDude