Report this

What is the reason for this report?

I'm having trouble with virtual monitor when running a droplet with python running google chrome

Posted on December 3, 2024

I’m trying to run google chrome with python and it’s not giving me any errors. I am trying to understand how to use the virtual monitor but it’s of no use.

ubuntu 20.04, python 3.12 tried xvfb-run



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Hi Ibrahim,

Would you mind sharing the exact error messages you’re encountering?

Also, if possible, could you share a snippet of the code you’re running and the command you’re using with xvfb-run? That will help pinpoint the issue better!

- Bobby

To run Google Chrome with Python in a virtual monitor environment like Xvfb on Ubuntu 20.04, the most common issue arises from the configuration of the virtual frame buffer however, I might be mistaken. Can you share a bit more about your setup so that we can provide you with a better pinpoint answer?

Heya,

You can ensure that you run the script with xvfb-run:

xvfb-run python3 chrome_xvfb.py

Also the chromedriver must match the version of Google Chrome. As alternative you can use a different virtual display manager like VNC (x11vnc) to see what the virtual screen is rendering.

Regards

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.