Xvfb
From Wikipedia, the free encyclopedia
In the X Window System, Xvfb or X virtual framebuffer is an X11 server that performs all graphical operations in memory, not showing any screen output. From the point of view of the client, it acts exactly like any other 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. Only a network layer is necessary.
Xvfb is mainly 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 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
As an example, the following sequence of commands runs the virtual framebuffer as display ":1"
, run a program on it, and capture the virtual screen in the file image.xwd
:
Xvfb :1 & xv -display :1 & xwd -display :1 -root -out image.xwd
The result can be shown by running xwud -in image.xwd
or xv image.xwd
.