Unable to Open X Display When Running Google Chrome on Ubuntu
When you try to run Google Chrome on a headless Ubuntu machine, you may see:$DISPLAY environment variable is not set. The solution is to use Xvfb (X Virtual Framebuffer), which provides a virtual display without requiring physical hardware.
sudo apt-get -y install xorg xvfb gtk2-engines-pixbuf
sudo apt-get -y install dbus-x11 xfonts-base xfonts-100dpi xfonts-75dpi xfonts-cyrillic xfonts-scalable
Add the following to your
.bashrc or .profile so the virtual display starts automatically on login:The
:99 is an arbitrary display number. You can choose any unused display number. The 1280x1024x16 sets the screen resolution and colour depth.