I have configured an Ubuntu server (16.04.1), with minimum dependencies, to be able to run Google Chrome on that server via the command line.

I installed: X11, Xvfb, xorg, and Google Chrome, but when I try to start Chrome, I receive the error message:

[ERROR:browser_main_loop.cc(265)] Gtk: cannot open display.

I could use any hint about what's wrong or steps that I can follow to start Chrome on a server.

  • Don't forget the 'Gtk libraries... – jc__ Dec 13 '16 at 14:45
  • This Q/A may help. – jc__ Dec 13 '16 at 15:03

You need to install and start a desktop environment then run Google Chrome within it. You can choose from any one really but if you want something lightweight like lxde.

sudo apt-get install lxde

Install that and then add exec startlxde, on its own line, to the end of the ~/.xsession file.

Finally run startx and then from within lxde run Google Chrome.

| improve this answer | |

You must of course start a graphical session before starting Google Chrome; for example, startx. Then launch the browser from withing the graphical session.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.