在Linux中使用Chrome通过Selenium运行的NaCl帮助程序进程没有沙箱错误 [英] NaCl helper process running without a sandbox error using Chrome through Selenium in Linux
问题描述
在Linux中通过Selenium使用Chrome浏览器时遇到以下错误:
I am facing the following error using Chrome through Selenium in Linux:
ERROR:browser_main_loop.cc(1512)] Unable to open X display.
ERROR:nacl_helper_linux.cc(308)] NaCl helper process running without a sandbox!
您是否有解决以下错误的方法?
Do you have solution for the below error?
推荐答案
此错误消息...
ERROR:nacl_helper_linux.cc(308)] NaCl helper process running without a sandbox!
...表示您的系统中沙盒的 setuid 未配置,因此该程序无法启动/产生新的浏览上下文,即 Chrome浏览器会话.
...implies that the setuid of the sandbox in your system is not configured, hence the program was unable to initiate/spawn a new Browsing Context i.e. Chrome Browser session.
一种快速的解决方案是,如果您想运行Chrome并且仅使用名称空间沙箱,则可以设置标志:
A quick solution will be, if you want to run Chrome and only use the namespace sandbox, you can set the flag:
--disable-setuid-sandbox
此标志将禁用setuid沙箱(仅Linux).但是,如果在没有名称空间沙箱适当内核支持的主机上执行此操作,Chrome将不会启动.另外,您也可以使用标志:
This flag will disable the setuid sandbox (Linux only). But if you do so on a host without appropriate kernel support for the namespace sandbox, Chrome will not spin up. As an alternative you can also use the flag:
--no-sandbox
此标志将为通常被沙盒化的所有进程类型禁用沙盒.
This flag will disable the sandbox for all process types that are normally sandboxed.
示例:
chromeOptions: {
args: ['--disable-setuid-sandbox', '--no-sandbox']
},
这篇关于在Linux中使用Chrome通过Selenium运行的NaCl帮助程序进程没有沙箱错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!