I'm trying to run chromium-browser on my raspberry pi remotely through SSH.

I want chromium-browser to use the display of the raspberry pi (not the local display of my Windows machine).

Even when I run

arthur@raspberrypi:~ $ export DISPLAY=:0.0
arthur@raspberrypi:~ $ chromium-browser


arthur@raspberrypi:~ $ export DISPLAY=:0
arthur@raspberrypi:~ $ chromium-browser

I still get the same error :

(chromium-browser:1330): Gtk-WARNING **: cannot open display: :0.0

I'm using Putty, X11 forwarding is disabled both in sshd_config and Putty settings.

This is meant to be a one-shot run. I do not want to control anything remotely after the browser is started. The ultimate goal is to be able to run chromium with an URL as parameter, so the page displays on the HDMI the raspberry is hooked up to. That's basically it, I don't want to control anything further than that.

Is there anything else I can try to launch chromium on the remote display ?

  • X11 forwarding is disabled there's one problem, it needs to be ENABLED to work ... the other is, do you have an X server on the PC? – Jaromanda X Apr 10 '19 at 1:11
  • Ooooh okay, I thought X11 forward was meant to work the opposite way. Will try with X11 enabled. Though, why is it necessary to have some other component on the PC (you mention an X server) ? Why isn't the TTY clever enough to understand that a command should launch a GUI program on a given display ? – Arthur Attout Apr 10 '19 at 6:39
  • Everything is supposed to be ran remotely, why is it necessary to add a GUI handler on the terminal side ? – Arthur Attout Apr 10 '19 at 6:41
  • because X11 is a protocol - you have to have something on the PC that talks X11 - I'm assuming the PC isn't running Linux – Jaromanda X Apr 10 '19 at 6:41
  • you could just use vnc instead though - then you don't even have to ssh – Jaromanda X Apr 10 '19 at 6:41

It appears the problem lies somewhere between the setup of X on the Pi and adding a new user to the Pi. The new user does not seem to have full access to the X server so can't launch GUI applications from the command line but can use su to login as the pi user and run the desired applications.

Not exactly an answer but more of a workaround, I'm afraid.

If the Pi is set up to auto-login as pi and launch straight to the desktop then I think the pi user's X client (the window manager?) has exclusive access to the display so it would make sense that a second user logging in would be unable to use the same display. If this is the case you could try logging pi out of the desktop on the physical Pi and then running your command from the command line as the second user.

| 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.