starting headless firefox with Xvfb does not work

2019-06-13 21:48发布

I try to run firefox in headless mode for selenium.

$xvfb-run firefox seems to work.

I run firefox through selenium so i cannot run xvfb-run directly.

So i start

Xvfb :1 -screen 0 1024x768x24 &

and then

set DISPLAY:=1 env DISPLAY:=1

Still when i run firefox i get

Error: no display specified

I run on centos 6 and firefox 38 ESR.

What can be done?

2条回答
在下西门庆
2楼-- · 2019-06-13 22:37

can you try that? export DISPLAY=:1

查看更多
We Are One
3楼-- · 2019-06-13 22:40

start firefox with --display arg

/usr/bin/firefox --display=:1
查看更多
登录 后发表回答