Linux command
Xvfb 命令
文本
复制后可按需替换文件名、目录或参数。
常用示例
Start virtual display
Xvfb :99
Start with specific screen size
Xvfb :99 -screen 0 [1920x1080x24]
Start with multiple screens
Xvfb :1 -screen 0 [1280x1024x24] -screen 1 [800x600x16]
Use shared memory
Xvfb :99 -shmem -screen 0 [1024x768x24]
Store framebuffer in directory
Xvfb :99 -fbdir [/tmp/xvfb]
Run application with xvfb-run
xvfb-run -a [application]
xvfb-run with custom screen
xvfb-run -s "-screen 0 1280x1024x24" [application]
说明
Xvfb (X Virtual FrameBuffer) is an X server that performs all graphical operations in memory without any physical display. It implements the X11 protocol, allowing X applications to run without visible output. Common use cases include running GUI applications on headless servers, automated testing of graphical applications, rendering graphics for web services, and CI/CD pipelines that require X applications. The xvfb-run wrapper script simplifies usage by automatically selecting a display number and handling authentication. Default screen configuration is 1280x1024x24 (width x height x depth in bits).
参数
- :display
- Display number (default: 0).
- -screen _num_ _WxHxD_
- Configure screen: number, width x height x depth.
- -pixdepths _list_
- Additional pixmap depths to support.
- -fbdir _dir_
- Directory for memory-mapped framebuffer files.
- -shmem
- Use shared memory for framebuffer.
- -linebias _n_
- Adjust line pixelization.
- -blackpixel _value_
- Set black pixel value.
- -whitepixel _value_
- Set white pixel value.
FAQ
What is the Xvfb command used for?
Xvfb (X Virtual FrameBuffer) is an X server that performs all graphical operations in memory without any physical display. It implements the X11 protocol, allowing X applications to run without visible output. Common use cases include running GUI applications on headless servers, automated testing of graphical applications, rendering graphics for web services, and CI/CD pipelines that require X applications. The xvfb-run wrapper script simplifies usage by automatically selecting a display number and handling authentication. Default screen configuration is 1280x1024x24 (width x height x depth in bits).
How do I run a basic Xvfb example?
Run `Xvfb :99` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does :display do in Xvfb?
Display number (default: 0).