13

I've hooked up the raspberry pi to a display. I have ssh'd in from another machine and I was wondering how, if possible, to open a browser window via epiphany http://example.com from my ssh session and have it appear on the screen.

25

Presuming you are logged in as the same user that's running the X display, this is fairly easy. First you need to know the display identifier; if there is only one running instance, it is probably :0. To check, use who. You'll see output including stuff like this:

goldilocks   pts/5        2015-02-16 07:18 (:1)
goldilocks   pts/6        2015-02-16 07:18 (:1)
goldilocks   pts/7        2015-02-16 07:36 (:1)

The display identifier is in parenthesis at the end, in this case :1. You need to set that in the environment of your ssh session. For most shells including bash (the default on raspbian):

export DISPLAY=:0

Or :1, as the case may be. To now start epiphany there:

epiphany http://example.com &

The & backgrounds this, otherwise it will block and you won't get the prompt back in ssh.

9

As an addition to Goldilocks' answer, for epiphany you can set the display using the --display option:

epiphany --display=:0 http://example.com &
  • …but this solution only works with epiphany?! – BenRoe Dec 12 '16 at 21:49
  • Works with chromium-browser as well. – JDavis Aug 9 at 22:55
0
ssh -o ForwardX11=yes pi@192.168.0.37

Open an ssh with X11 port forwarding and you can run some Xwindows command from the terminal

ssh -o ForwardX11=yes <userName>@<your pi's hostname or ip address>
  • 1
    I don't think this is an answer to the question. The OP is asking how to start applications on the remote display (i.e., the one attached to the pi) via ssh from another machine. X11 forwarding is about running remote GUI applications on the local display. – goldilocks Mar 15 '17 at 10:25
  • Use ssh -X pi@192.168.0.37 if you are in hurry. (and I agree with @goldilocks: seems he want's to display epiphany on the remote display) – MadMike Mar 15 '17 at 10:54

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.