NaCl帮助程序在Linux中通过Selenium使用Chrome运行,没有沙箱错误,但没有沙箱错误[重复]

问题描述 投票:-3回答:1

我在Linux中通过Selenium使用Chrome浏览器时遇到以下错误:

ERROR:browser_main_loop.cc(1512)] Unable to open X display.
ERROR:nacl_helper_linux.cc(308)] NaCl helper process running without a sandbox!

您是否有解决以下错误的方法?

linux selenium google-chrome ubuntu sandbox
1个回答
0
投票

此错误消息...

ERROR:nacl_helper_linux.cc(308)] NaCl helper process running without a sandbox!

...表示未配置系统中sandboxsetuid,因此程序无法启动/产生新的Browsing Context,即Chrome Browser] >会话。


解决方案

一种快速的解决方案是,如果您想运行Chrome并且仅使用名称空间沙箱,则可以设置标志:

--disable-setuid-sandbox

此标志将禁用setuid沙箱(仅Linux)。但是,如果您在没有适当的内核支持名称空间沙箱的主机上执行此操作,Chrome将不会启动。另外,您也可以使用标志:

--no-sandbox

此标志将为通常被沙盒化的所有进程类型禁用沙盒。

示例:

chromeOptions: {
      args: ['--disable-setuid-sandbox', '--no-sandbox']
},
© www.soinside.com 2019 - 2024. All rights reserved.