Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Resizing an Xvfb display

Simple Question: Is there a way to resize a Xvfb display?

I tried with RandR but it seems that the RandR extension is not supported by Xvfb. Are there other ways to resize the screen?

Thanks for your help!

like image 703
Erik Avatar asked Jun 15 '11 10:06

Erik


People also ask

What is XVFB run?

Xvfb (short for X virtual framebuffer) is an in-memory display server for UNIX-like operating system (e.g., Linux). It enables you to run graphical applications without a display (e.g., browser tests on a CI server) while also having the ability to take screenshots.


2 Answers

You can use the server-args command line argument to specify a custom resolution for the virtual frame buffer being created, but this does not change the resolution of an existing virtual frame buffer:

xvfb-run --server-args="-screen 0, 1024x768x24" ...
like image 100
edigu Avatar answered Oct 24 '22 08:10

edigu


Most distributions now ship a version of Xvfb with randr support. The code was committed in late 2015 vfb: add randr support (v2).

To resize you will first need to define a new mode (you can use tools like gtf to get the modeline definition values), add it to the virtual output, and then you can switch to it.

ie for 1280x1024:

xrandr --newmode "1280x1024"  109.00  1280 1368 1496 1712  1024 1027 1034 1063 -hsync +vsync
xrandr --addmode screen 1280x1024
xrandr -s 1280x1024
like image 6
totaam Avatar answered Oct 24 '22 08:10

totaam