I was trying to play a video on my laptop using SSH command from my android phone(JuiceSSH). but the video started playing in bytes in my phone's terminal. the player was VLC player. how can I make it run the movie on the laptop not on my phone terminal.
Asked
Active
Viewed 93 times
0
-
Is there someone logged in on the laptop's console? – Celada Mar 08 '16 at 08:48
-
@Celada yes. does it make any differences? – Mar 08 '16 at 09:09
-
Makes it easier, especially if it's the same user logged in to the console and logging in by SSH. Therefore I thought it would be relevant info to include in your question. But it looks like you got an answer so it's all good. – Celada Mar 09 '16 at 21:30
1 Answers
0
VLC
would be using the X Window System for the pictures. If you have a session running on the laptop, e.g., its desktop, X would be running.
From the desktop you can make a connection to X without problem, and use xhost
to add your phone to the "computers" which can connect to the X display. Something like this (in a terminal on the laptop):
xhost +myphone
where myphone is the hostname of your phone. Then in the phone, you would set the DISPLAY
variable (if VLC has no suitable command-line option) to point to that X display, e.g,
export DISPLAY=mylaptop
vlc
In the DISPLAY
variable, you have to use the screen number (usually 0 for the actual computer), e.g., "mylaptop:0".
Further reading:
- What does this
xhost …
command do? - Xhost (Arch wiki)

Thomas Dickey
- 76,765
-
-
Uh? The video is being played by a process running on the laptop, to display on the laptop.
xhost
is useless and dangerous. – Gilles 'SO- stop being evil' Mar 08 '16 at 22:34 -
I explictly pointed to opening up the specific hostname, as well as providing suitable reading to cover the problems with the approach. Everyone knows about
xhost +
; it seems that some people never noticed the "+". – Thomas Dickey Mar 09 '16 at 21:55