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.

topher
  • 323
  • 1
  • 2
  • 9

3 Answers3

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.

goldilocks
  • 58,859
  • 17
  • 112
  • 227
9

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

epiphany --display=:0 http://example.com &
topher
  • 323
  • 1
  • 2
  • 9
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>
Bex
  • 2,929
  • 3
  • 25
  • 34
  • 2
    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