Tell me more ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

Possible Duplicate:
Open a window on a remote X display (why “Cannot open display”)?

I have a computer running debian, connected to my TV, running an xorg session. What I want to do is ssh into that machine and start an application that will also display on that machine. For example, I want to be able to ssh to it from my laptop and start mplayer on the host, playing a file on the host and showing it on the TV. Is this possible? I have a feeling it should be (relatively) trivial, but I just can't seem to figure it out.

Just to clarify, simply running

$ ssh -X host
$ mplayer movie.avi &

won't cut it, because it will start displaying on my laptop's display.

share|improve this question

marked as duplicate by Gilles, Michael Mrozek Nov 17 '11 at 21:25

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

2 Answers

up vote 3 down vote accepted

If you know what $DISPLAY your ssh host's X server is using, e.g. :0.0, the following works for me:

ssh host
export DISPLAY=:0.0

Now you can run any graphical app of your choice on your host. You won't be able to see or control the graphical aspects on/from your laptop, of course.

share|improve this answer

Another tip to place the program in background and detached from the ssh session:

ssh host '(DISPLAY=:0.0 mplayer movie.avi >/dev/null </dev/null 2>&1  &)'
share|improve this answer

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