Open a running process on a device host from a device client with SSH access

If I started a process on my pinephone terminal, but for no particular reason I want to watch the process on my PC that has SSH access to the phone, is it possible?

Hi @fch,

It is indeed yes. I’ve seen GUI apps on Ubuntu ‘piped’ to Windows over SSH on over the 'net.

So I know it can be done. I just haven’t done it myself yet. I THINK you have to look into setting the DISPLAY= environment variable before running said command. But I might be wrong.

Edit:

I believe the term you’re looking for is X11 forwarding

1 Like

There might be an additional problem, though, because the OP is talking about ssh-ing into a phone.

So if it’s a GUI app on the phone that the OP is seeking to get the output of on the PC’s monitor, then chances are that the GUI app on the phone is not an X11 app ─ phones usually use their own display server protocol, and most phone apps are written in Java.

Now, I’m not sure what the Pinephone is using, but it might be Wayland, and Wayland is not network-transparent. But if the phone runs an X11 server and X11 apps, then X11 forwarding would indeed be the way to go.

If the process is just a command line process, a tool like screen or tmux can be used to detach form the shell (the process is still running after that) and later attach to it from the system.

Of course screen or tmux can do a lot more, but the ability to detach from a shell without stopping the process is real nice.

2 Likes

Thank you all for the anwers I will try those solutions!