0

I apologize if this question has been asked before, but I don't really know the vocabulary to be able to do the research myself.

Say I have a Linux machine (Raspbian on a Raspberry Pi in my case) hooked up to a monitor. If I had a mouse plugged into this machine, I could double click on, say, Scratch, and have it open and be visible on that monitor.

Now say I don't have a mouse hooked up to it, but I am able to SSH into it from another machine. How would I launch a program in that same way? In other words, I don't want to launch it in the SSH window, and I don't want it X11 forwarded to me. I want it launched on that machine, visible on that monitor, as if I had double clicked it.

Hope my question was clear, but I'd be happy to clarify if anyone is confused!

2 Answers 2

1

Find out the correct environment.. One of the ways of doing that is issuing w on your ssh-terminal:

USER     TTY      FROM             LOGIN@   IDLE   JCPU   PCPU WHAT
user1   tty7     :0               15:49   12:56   1.90s  0.01s gdm-session-wor
user1   pts/0    :0.0             15:50    8:11   0.17s  0.70s gnome-terminal
user1   pts/1    tbpc             15:54    0.00s  0.08s  0.00s w

Now mostly it would be :0 for you. From your ssh terminal issue:

env DISPLAY=:0 command

So in case you want to launch firefox:

env DISPLAY=:0 firefox&

Sign up to request clarification or add additional context in comments.

2 Comments

The user that's logged in is the same as the user that I'm SSH-ing with. When I run the W command via SSH, I see only one user, and under "From", it lists the 'sending' IP address. I don't see anything with :0 in it.
can you install finger and see if finger <user> returns all the logins. Also try who command and see if all the logged in users are visible. I also had one more idea of solving this. If you are in the same network you can also use synergy-foss.org
0

Log in to the server using the -X option like so: ssh -X [email protected]. This will require the ssh on the server to have been configured to allow X11 forwarding.

2 Comments

This is the reverse of what I'm going for - I don't want to use X11 forwarding to open something on my computer from the linux computer, I want to launch something on the linux computer from my computer. In other words, if I had a mouse plugged into the Linux box, I could double click something and launch a GUI on that machine. From another machine, I can SSH into my Linux box, but now I want to launch, say, an image viewer, on that Linux box (and not on my local machine)
Ah, apologies. For your case I believe balwa's answer is probably the one you are looking for.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.