我尝试用以下命令启动 chrome xvfb-run
:
- Ubuntu 18.04.5 LTS
- 铬105.0.5173.0
如果我指定显示数量为76,xvfb-run
则无法启动:
$ xvfb-run --error-file=/tmp/Xvfb-errors.log -s ":76 -auth /tmp/xvfb.auth -ac -screen 0 1920x1080x24" chrome >./chrome.log 2>&1 &
$
[1]+ Exit 1 xvfb-run -s ":76 -auth /tmp/xvfb.auth -ac -screen 0 1920x1080x24" chrome > ./chrome.log 2>&1
$ cat chrome.log
[25736:25736:0819/203148.686095:ERROR:ozone_platform_x11.cc(246)] Missing X server or $DISPLAY
[25736:25736:0819/203148.686137:ERROR:env.cc(226)] The platform failed to initialize. Exiting.
一张支票显示那张支票/tmp/Xvfb-errors.log
是空的。
如果我指定显示数量为99,则xvfb-run
成功。并被:99 :99
传递给xvfb:
$ xvfb-run -s ":99 -auth /tmp/xvfb.auth -ac -screen 0 1920x1080x24" chrome >./chrome.log 2>&1 &
$ ps -ef | ag xv
rb_user 25836 25820 0 20:32 pts/0 00:00:00 /bin/sh /usr/bin/xvfb-run -s :99 -auth /tmp/xvfb.auth -ac -screen 0 1920x1080x24 chrome
rb_user 25847 25836 0 20:32 pts/0 00:00:00 Xvfb :99 :99 -auth /tmp/xvfb.auth -ac -screen 0 1920x1080x24 -nolisten tcp -auth /tmp/xvfb-run.FWVOd6/Xauthority
$ xdpyinfo -display :99
name of display: :99
version number: 11.0
vendor string: The X.Org Foundation
vendor release number: 11906000
X.Org version: 1.19.6
maximum request size: 16777212 bytes
motion buffer size: 256
bitmap unit, bit order, padding: 32, LSBFirst, 32
image byte order: LSBFirst
number of supported pixmap formats: 6
...
谁能解释为什么后一种方法有效而前一种方法无效?