You are not logged in.
Hello,
i want to start the media player app via SSH in an existing X-Session (real display) on the ssh target (ssh user = x-session user, all same machine). I do not mean X-forwarding! After the app is started, i want to disconnect the ssh connection and all should be still running. Any ideas?
Greetings,
Sebastian
Offline
Start a tmux or screen session. Then do a
export DISPLAY=:0
Then run your command, detach from the screen or tmux session and you can safely end the ssh session.
Offline
Thank you, this worked. I thougth all the time, "export DISPLAY=:0" will export it to my local display, like with x-forwarding?
By the way, using tmux/screen is not requied, you can simply add a "&"-char at the end of the command, that it will run detached from the console.
Offline
The difference:
#remote display
ssh user@host DISPLAY=:0 some_command
# although you might assume it get's passed through ssh, it does not and is displayed on the remote machine
ssh -X user@host DISPLAY=:0 some_command
# local display
DISPLAY=:0 ssh -X user@host some_command
Also have a look at the man pages of disown and nohup to learn how to remove the program from your running shell, so you can close the ssh connection.
By the way: export only means, that the variable is exported to the shell. If I run "export TERMINAL=xterm", then until I close the shell, I can for example "echo $TERMINAL" to read "xterm". The shell is always on the host you are connected to. I assume there is a way to bind a remote X server to a DISPLAY (say :100), so you could DISPLAY=:100 to automatically show it on the remote host (or your local host, depending on what machine you sit in front of). I only assume because there is always a way, but I have never tested it or really thought about it.
Offline