pythonxvfbpyvirtualdisplay

Xvfb - Browser window does not fit display


I'm trying to run a web browser in a virtual display, using the Python library pyvirtualdisplay, which relies on Xvfb. The problem is that I need that browser to be maximized, something I'm not achieving. I start a display with a size of 1024x768, but the browser just takes a portion of the screen, and can't maximize it. I even tried to run the browser with flags that should open it maximized (google-chrome -start-maximized), with no success. As there is no button to maximize the window, I tried pressing F11 to enter in full screen mode, but just takes the same portion of the screen. The result can be seen in the image below:

enter image description here

The code I use to start the display:

from pyvirtualdisplay import Display

Display(visible=1, size=(1024,768)).start()

Solution

  • Problem was that I was not using a window manager, so installing Fluxbox (a lightweight one) and running it after starting the virtual display did the trick.