HOME

TheInfoList



OR:

Xvfb or X virtual framebuffer is a display server implementing the
X11 The X Window System (X11, or simply X) is a windowing system for bitmap displays, common on Unix-like operating systems. X originated as part of Project Athena at Massachusetts Institute of Technology (MIT) in 1984. The X protocol has been at ...
display server protocol. In contrast to other display servers, Xvfb performs all graphical operations in virtual memory without showing any screen output. From the point of view of the X
client Client(s) or The Client may refer to: * Client (business) * Client (computing), hardware or software that accesses a remote service on another computer * Customer or client, a recipient of goods or services in return for monetary or other valuable ...
app, 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 have any kind of graphics adapter, a screen or any
input device In computing, an input device is a piece of equipment used to provide data and control signals to an information processing system, such as a computer or information appliance. Examples of input devices include keyboards, computer mice, scanne ...
. Only a
network Network, networking and networked may refer to: Science and technology * Network theory, the study of graphs as a representation of relations between discrete objects * Network science, an academic field that studies complex networks Mathematics ...
layer is necessary. Xvfb supports several X Protocol Extensions, such as Compositing and OpenGL
GLX GLX (initialism for "OpenGL Extension to the X Window System") is an extension to the X Window System core protocol providing an interface between OpenGL and the X Window System as well as extensions to OpenGL itself. It enables programs wishin ...
support via
Mesa A mesa is an isolated, flat-topped elevation, ridge, or hill, bounded from all sides by steep escarpments and standing distinctly above a surrounding plain. Mesas consist of flat-lying soft sedimentary rocks, such as shales, capped by a ...
.


Usage scenarios

Xvfb is primarily used for testing: # Since it shares code with the real X server, it can be used to test the parts of the code that are not related to the specific hardware. # It can be used to test clients in various conditions that would otherwise require a range of different hardware; for example, it can be used to test whether clients work correctly at depths or screen sizes that are rarely supported by hardware. # Background running of clients. (the xwd program or a similar program for capturing a
screenshot A screenshot (also known as screen capture or screen grab) is an analog or digital image that shows the contents of a computer display. A screenshot is created by a (film) camera shooting the screen or the operating system An operating sys ...
can be used to actually see the result) # In General, Running programs that require an X server to be active even when they do not display anything with it. (e.g. Browser Testing automation such as
Selenium Selenium is a chemical element; it has symbol (chemistry), symbol Se and atomic number 34. It has various physical appearances, including a brick-red powder, a vitreous black solid, and a grey metallic-looking form. It seldom occurs in this elem ...
or Jenkins, Jira's
Clover Clovers, also called trefoils, are plants of the genus ''Trifolium'' (), consisting of about 300 species of flowering plants in the legume family Fabaceae originating in Europe. The genus has a cosmopolitan distribution with the highest diversit ...
HTML reports, etc.)


Usage examples


Screenshot example

As an example, the following sequence of commands runs a virtual framebuffer X server as display :1, runs a program (xclock) on it, and captures the virtual screen in the file image.xwd using the xwd command: Xvfb :1 & xclock -display :1 & xwd -display :1 -silent -root -out image.xwd The result can be shown by running the xwud program (xwud -in image.xwd). The program xvfb-run is often used to automate the process of finding an available display and managing authentication: xvfb-run command


Remote control over SSH

Xvfb is also used for remote control. VNC over SSH can be faster than
X11 The X Window System (X11, or simply X) is a windowing system for bitmap displays, common on Unix-like operating systems. X originated as part of Project Athena at Massachusetts Institute of Technology (MIT) in 1984. The X protocol has been at ...
over SSH, specially reducing latency over the internet. In this case, Xvfb is often combined with a lightweight window manager (such as
Fluxbox Fluxbox is a stacking window manager for the X Window System, which started as a fork of Blackbox 0.61.1 in 2001, with the same aim to be lightweight. Its user interface has only a taskbar, a pop-up menu accessible by right-clicking on the d ...
or
Openbox Openbox is a free, stacking window manager for the X Window System, licensed under the GNU General Public License. Originally derived from Blackbox 0.65.0 (a C++ project), Openbox has been completely re-written in the C programming language ...
) and a VNC server such as X11vnc. A possible sequence of commands to start this on the server is: export DISPLAY=:1 Xvfb "$DISPLAY" -screen 0 1024x768x24 & fluxbox & x11vnc -display "$DISPLAY" -bg -nopw -listen localhost -xkb The next step is to start a SSH client such as
PuTTY PuTTY () is a free and open-source terminal emulator, serial console and network file transfer application. It supports several network protocols, including SCP, SSH, Telnet, rlogin, and raw socket connection. It can also connect to a se ...
with tunneling to localhost port 5900 enabled. A vncviewer can then connect to localhost to get remote control over the server. ssh -N -T -L 5900:localhost:5900 user@remotehost & vncviewer -encodings 'copyrect tight zrle hextile' localhost:5900 x11vnc's
man page A man page (short for manual page) is a form of software documentation found on Unix and Unix-like operating systems. Topics covered include programs, system libraries, system calls, and sometimes local system details. The local host administr ...
also contains instructions. Xvnc (not to be confused with x11vnc) is very similar to Xvfb.


See also

* X11vnc *
headless software Headless software (e.g. "headless Linux",) is software capable of working on a device without a graphical user interface. Such software receives inputs and provides output through other interfaces like network or serial port and is common on serv ...


References

{{Reflist


External links


Xvfb manual page


– making automatic screenshots of web pages, using Xvfb and
Mozilla Firefox Mozilla Firefox, or simply Firefox, is a free and open-source web browser developed by the Mozilla Foundation and its subsidiary, the Mozilla Corporation. It uses the Gecko rendering engine to display web pages, which implements curren ...

Xpra
an alternative to Xvfb using a plain X11 server with dummy drivers X servers