LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

xvfb-run

Run commands in virtual X server

TLDR

Run a command in a virtual X server
$ xvfb-run [command]
copy
Auto-select a free server number
$ xvfb-run -a [command]
copy
Pass server arguments for screen resolution and depth
$ xvfb-run -s "-screen 0 1024x768x24" [command]
copy
Log Xvfb errors to a file
$ xvfb-run -e [/tmp/xvfb.log] [command]
copy
Use a specific server number
$ xvfb-run -n [44] [command]
copy

SYNOPSIS

xvfb-run [OPTIONS] COMMAND

DESCRIPTION

xvfb-run runs a command in a virtual X server environment using Xvfb (X Virtual Frame Buffer). This allows running graphical applications on systems without a display.The tool is useful for automated testing, CI/CD pipelines, and headless server environments.

PARAMETERS

-a, --auto-servernum

Try to get a free server number, starting at 99 or the argument to --server-num
-s, --server-args ARGS
Arguments passed to Xvfb server (default: "-screen 0 640x480x8")
-n, --server-num NUM
Use specified server number (default: 99)
-e, --error-file FILE
Store output from xauth and Xvfb in file (default: /dev/null)
-f, --auth-file FILE
Use specified X authority file
-l, --listen-tcp
Enable TCP port listening in the X server (disabled by default for security)
-p, --xauth-protocol PROTO
X authority protocol to use (default: MIT-MAGIC-COOKIE-1)
-w, --wait DELAY
Wait delay seconds after launching Xvfb before starting the command (default: 3)
-h, --help
Display usage information and exit

CAVEATS

Xvfb must be installed. Some applications may behave differently in virtual X. Performance may vary for GPU-intensive applications.

SEE ALSO

xvfb(1), xinit(1), xauth(1)

Copied to clipboard
Kai