Xvfb
   HOME

TheInfoList



OR:

Xvfb or X virtual framebuffer is a
display server In computing, a windowing system (or window system) is software that manages separately different parts of display screens. It is a type of graphical user interface (GUI) which implements the WIMP (windows, icons, menus, pointer) paradigm for ...
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 provides the basic framework for a GUI environment: drawing and moving windows on the display device and interacting wi ...
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
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 ...
, 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 graphics card (also called a video card, display card, graphics adapter, VGA card/VGA, video adapter, display adapter, or mistakenly GPU) is an expansion card which generates a feed of output images to a display device, such as a computer moni ...
, a
screen Screen or Screens may refer to: Arts * Screen printing (also called ''silkscreening''), a method of printing * Big screen, a nickname associated with the motion picture industry * Split screen (filmmaking), a film composition paradigm in which mul ...
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, mouse, scanners, cameras ...
. 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.


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 In the X Window System, the program xwd (X Window dump) captures the content of a screen or of a window and optionally saves it into a file. xwd runs in one of two ways: if a user specifies the whole screen or the name or identifier of a win ...
program or a similar program for capturing a
screenshot screenshot (also known as screen capture or screen grab) is a digital image that shows the contents of a computer display. A screenshot is created by the operating system or software running on the device powering the display. Additionally, s ...
can be used to actually see the result) # Running programs that require an X server to be active even when they do not use it. (e.g.
Clover Clover or trefoil are common names for plants of the genus ''Trifolium'' (from Latin ''tres'' 'three' + ''folium'' 'leaf'), consisting of about 300 species of flowering plants in the legume or pea family Fabaceae originating in Europe. The genus ...
HTML reports)


Usage examples


Screenshot example

As an example, the following sequence of commands runs a virtual framebuffer X server as display :1, runs a program on it, and captures the virtual screen in the file image.png using the import command of
ImageMagick ImageMagick, invoked from the command line as magick, is a free and open-source cross-platform software suite for displaying, creating, converting, modifying, and editing raster images. Created in 1987 by John Cristy, it can read and write ove ...
: Xvfb :1 & xv -display :1 & import -display :1 -window root image.png The result can be shown by running the ImageMagick display program (display image.png) or xv (xv image.png). 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 Virtual Network Computing (VNC) is a graphical desktop-sharing system that uses the Remote Frame Buffer protocol (RFB) to remotely control another computer. It transmits the keyboard and mouse input from one computer to another, relaying the g ...
over
SSH The Secure Shell Protocol (SSH) is a cryptographic network protocol for operating network services securely over an unsecured network. Its most notable applications are remote login and command-line execution. SSH applications are based on a ...
is slightly 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 provides the basic framework for a GUI environment: drawing and moving windows on the display device and interacting wi ...
over SSH. 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 desk ...
or Openbox) and a VNC server such as
X11vnc x11vnc is a Virtual Network Computing (VNC) server program. It allows remote access from a remote client to a computer hosting an X Window session and the x11vnc software, continuously polling the X server's frame buffer for changes. This allows ...
. 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 fire up a SSH client such as
PuTTY Putty is a material with high plasticity, similar in texture to clay or dough, typically used in domestic construction and repair as a sealant or filler. Although some types of putty (typically those using linseed oil) slowly polymerise and be ...
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 usually found on a Unix or Unix-like operating system. Topics covered include computer programs (including library and system calls), formal standards and conventions, and ev ...
also contains instructions. Xvnc (not to be confused with x11vnc) is very similar to Xvfb.


See also

*
X11vnc x11vnc is a Virtual Network Computing (VNC) server program. It allows remote access from a remote client to a computer hosting an X Window session and the x11vnc software, continuously polling the X server's frame buffer for changes. This allows ...
* headless software


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 current and a ...

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