美文网首页
Xvfb -- 虚拟X server

Xvfb -- 虚拟X server

作者: WooWoods | 来源:发表于2017-02-07 17:05 被阅读446次

主角:

Xvfb − virtual framebuffer X server for X Version 11

需要在服务器用一个基于 PyQt 的程序画图,而 PyQt 要求有 X server 支持。服务器上一般不会装 X Window的,这时候就轮到 Xvfb出场了!

对于 Xvfb 并不了解,我是在遇到问题后 google 到的解决方案,下面是官方的描述:

Xvfb is an X server that can run on machines with no display hardware and no physical input devices. It emulates a dumb framebuffer using virtual memory.
  1. 安装
  2. 启动 Xvfb
Xvfb -ac :7 -screen 0 1280x1024x8 > /dev/null 2>&1
export DISPLAY=:7
# DISPLAY 后的编号须与启动时的编号一致,这里是 ":7"。

之后就可以像在X Window中一样使用各种GUI程序了。

Python 中还有更原生的方式:PyVirtualDisplay

相关文章

网友评论

      本文标题:Xvfb -- 虚拟X server

      本文链接:https://www.haomeiwen.com/subject/gzlmittx.html