Xvfb or X virtual framebuffer is a display server implementing the X11
display server protocol. In contrast to other display servers Xvfb
performs all graphical operations in memory without showing any screen
output. From the point of view of the client, it acts exactly like any
other X display server, serving requests and sending events and errors
as appropriate. However, no output is shown. This virtual server does
not require the computer it is running on to even have a screen or any
input device.
首先,您没有指定服务器上是否安装了桌面环境(或X)?
不管怎样,您可以使用
xvfb
来实现蜘蛛的无头设置:首先,在服务器上安装
xvfb
。假设您正在使用apt-get
:现在,在一个自定义的显示号码上运行xvfb服务,比如:
之后,通过导出显示号并运行应用程序,您可以在虚拟帧缓冲区中运行任何需要
X
的应用程序:DISPLAY
只为当前终端会话设置,因此在实现此步骤的自动化时请记住这一点。可能您是通过ssh运行应用程序的?然后,您需要在本地PC上运行X服务器。如果不是,则应正确设置DISPLAY环境变量。最近,Ubuntu上的sudo命令没有传输环境变量。如果在sudo上运行应用程序,请确保$DISPLAY是否已设置。
附加
是个侏儒虫。你的应用程序应该依赖于gtk小部件。
https://bugs.launchpad.net/ubuntu/+source/software-center/+bug/800574
相关问题 更多 >
编程相关推荐