Xvfb

Last updated
Xvfb
Type Display server
Website x.org/releases/X11R7.7/doc/man/man1/Xvfb.1.xhtml

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 virtual memory without showing any screen output. From the point of view of the X client 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. Only a network layer is necessary.

Contents

Xvfb supports several X Protocol Extensions, such as Compositing and Open GL GLX support, via Mesa [1] .

Usage scenarios

Xvfb is primarily used for testing:

  1. 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.
  2. 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.
  3. Background running of clients. (the xwd program or a similar program for capturing a screenshot can be used to actually see the result)
  4. 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 [2] or Jenkins [3] , Jira's Clover 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-outimage.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-runcommand

Remote control over SSH

Xvfb is also used for remote control. VNC over SSH can be faster than X11 over SSH [4] , specially reducing latency over the internet [5] . In this case, Xvfb is often combined with a lightweight window manager (such as Fluxbox or Openbox) and a VNC server such as X11vnc. A possible sequence of commands to start this on the server is:

exportDISPLAY=:1 Xvfb"$DISPLAY"-screen01024x768x24&fluxbox&x11vnc-display"$DISPLAY"-bg-nopw-listenlocalhost-xkb 

The next step is to fire up a SSH client such as PuTTY with tunneling to localhost port 5900 enabled. A vncviewer can then connect to localhost to get remote control over the server.

ssh-N-T-L5900:localhost:5900user@remotehost&vncviewer-encodings'copyrect tight zrle hextile'localhost:5900 

x11vnc's man page also contains instructions.

Xvnc (not to be confused with x11vnc) is very similar to Xvfb.

See also

Related Research Articles

<span class="mw-page-title-main">X Window System</span> Windowing system for bitmap displays on UNIX-like systems

The X Window System is a windowing system for bitmap displays, common on Unix-like operating systems.

<span class="mw-page-title-main">Windowing system</span> Software that manages separately different parts of display screens

In computing, a windowing system is a software suite that manages separately different parts of display screens. It is a type of graphical user interface (GUI) which implements the WIMP paradigm for a user interface.

<span class="mw-page-title-main">Virtual Network Computing</span> Graphical desktop-sharing system

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 graphical-screen updates, over a network.

<span class="mw-page-title-main">Damn Small Linux</span> Lightweight, desktop-oriented Linux distribution

Damn Small Linux (DSL) is a computer operating system for the x86 family of personal computers. It is free and open-source software under the terms of the GNU GPL and other free and open-source licenses. It was designed to run graphical user interface applications on older PC hardware, for example, machines with 486 and early Pentium microprocessors and very little random-access memory (RAM). DSL is a live CD with a size of 50 megabytes (MB). What originally began as an experiment to see how much software could fit in 50 MB eventually became a full Linux distribution. It can be installed on storage media with small capacities, like bootable business cards, USB flash drives, various memory cards, and Zip drives.

X.Org Server is the free and open-source implementation of the X Window System (X11) display server stewarded by the X.Org Foundation.

TightVNC is a free and open-source remote desktop software server and client application for Linux and Windows. A server for macOS is available under a commercial source code license only, without SDK or binary version provided. Constantin Kaplinsky developed TightVNC, using and extending the RFB protocol of Virtual Network Computing (VNC) to allow end-users to control another computer's screen remotely.

RealVNC is a company that provides remote access software. Their VNC Connect software consists of a server and client application, which exchange data over the RFB protocol to allow the Viewer to control the Server's screen remotely. The application is used, for example, by IT support engineers to provide helpdesk services to remote users.

chroot is an operation on Unix and Unix-like operating systems that changes the apparent root directory for the current running process and its children. A program that is run in such a modified environment cannot name files outside the designated directory tree. The term "chroot" may refer to the chroot(2) system call or the chroot(8) wrapper program. The modified environment is called a chroot jail.

The X video extension, often abbreviated as XVideo or Xv, is a video output mechanism for the X Window System. The protocol was designed by David Carver; the specification for version 2 of the protocol was written in July 1991. It is mainly used today to resize video content in the video controller hardware in order to enlarge a given video or to watch it in full screen mode. Without XVideo, X would have to do this scaling on the main CPU. That requires a considerable amount of processing power, which could slow down or degrade the video stream; video controllers are specifically designed for this kind of computation, so can do it much more cheaply. Similarly, the X video extension can have the video controller perform color space conversions, and change the contrast, brightness, and hue of a displayed video stream.

RFB is an open simple protocol for remote access to graphical user interfaces. Because it works at the framebuffer level it is applicable to all windowing systems and applications, including Microsoft Windows, macOS, the X Window System and Wayland. RFB is the protocol used in Virtual Network Computing (VNC) and its derivatives.

<span class="mw-page-title-main">Direct Rendering Infrastructure</span> Framework

The Direct Rendering Infrastructure (DRI) is the framework comprising the modern Linux graphics stack which allows unprivileged user-space programs to issue commands to graphics hardware without conflicting with other programs. The main use of DRI is to provide hardware acceleration for the Mesa implementation of OpenGL. DRI has also been adapted to provide OpenGL acceleration on a framebuffer console without a display server running.

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 the user to control their X11 desktop from a remote computer either on the user's own network, or from over the Internet as if the user were sitting in front of it. x11vnc can also poll non-X11 frame buffer devices, such as webcams or TV tuner cards, iPAQ, Neuros OSD, the Linux console, and the Mac OS X graphics display. x11vnc is part of the LibVNCServer project and is free software available under the GNU General Public License. x11vnc was written by Karl Runge.

In the X Window System, the program xwd captures the content of a screen or of a window and optionally saves it into a file.

In the X Window System, programs run as X clients, and as such they connect to the X display server, possibly via a computer network. Since the network may be accessible to other users, a method for forbidding access to programs run by users different from the one who is logged in is necessary.

<span class="mw-page-title-main">AIGLX</span> Open source project

Accelerated Indirect GLX ("AIGLX") is an open source project founded by Red Hat and the Fedora community, led by Kristian Høgsberg, to allow accelerated indirect GLX rendering capabilities to the X.Org Server and DRI drivers. This allows remote X clients to get fully hardware accelerated rendering over the GLX protocol; coincidentally, this development was required for OpenGL compositing window managers to function with hardware acceleration.

Core OpenGL, or CGL, is Apple Inc.'s Macintosh Quartz windowing system interface to the OS X implementation of the OpenGL specification. CGL is analogous to GLX, which is the X11 interface to OpenGL, as well as WGL, which is the Microsoft Windows interface to OpenGL.

VirtualGL is an open-source software package that redirects the 3D rendering commands from Unix and Linux OpenGL applications to 3D accelerator hardware in a dedicated server and sends the rendered output to a (thin) client located elsewhere on the network. On the server side, VirtualGL consists of a library that handles the redirection and a wrapper program that instructs applications to use this library. Clients can connect to the server either using a remote X11 connection or using an X11 proxy such as a VNC server. In case of an X11 connection some client-side VirtualGL software is also needed to receive the rendered graphics output separately from the X11 stream. In case of a VNC connection no specific client-side software is needed other than the VNC client itself.

In computing, the term remote desktop refers to a software- or operating system feature that allows a personal computer's desktop environment to be run remotely from one system, while being displayed on a separate client device. Remote desktop applications have varying features. Some allow attaching to an existing user's session and "remote controlling", either displaying the remote control session or blanking the screen. Taking over a desktop remotely is a form of remote administration.

This page is a comparison of notable remote desktop software available for various platforms.

A headless computer is a computer system or device that has been configured to operate without a monitor, keyboard, and mouse. A headless system is typically controlled over a network connection, although some headless system devices require a serial connection to be made over RS-232 for administration of the device. Headless operation of a server is typically employed to reduce operating costs.

References

  1. "904851 – xvfb-run glxinfo fails". bugzilla.redhat.com. -- I think you also won't get GLX if you don't have mesa-dri-drivers installed in the chroot. -- Thanks. That helped.
  2. "How to Run Your Tests Headless with Xvfb | Elemental Selenium". elementalselenium.com. 18 June 2024.
  3. "Xvfb". plugins.jenkins.io. 14 July 2021.
  4. "Accelerating Remote X Performance". dav.lbl.gov.
  5. "VNC: A Faster Alternative to X11 - HECC Knowledge Base". www.nas.nasa.gov.