using the Std Out on a remote computer through SSH
Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
using the Std Out on a remote computer through SSH
I have written a program on a remote computer that I want to execute through an SSH connection and have that program draw on its own screen.
The program works. I can run it from that computers terminal and it runs with no errors and draws on the screen. However, if I ssh into that computer from a remote computer and then run the program, I get errors. I am assuming the errors are because it can't draw on my remote terminal through the ssh connection.
So, how do I get the program on the remote computer to draw on it's own screen when executed through a remote connection.
What do you mean, exactly, by 'drawing on the screen'? If you ssh in, you're in a CLI - not any kind of GUI environment. If you have an x environment running on your remote PC where you're ssh'ing from, you can open windows thru the ssh tunnel if you have your DISPLAY environment variable set correctly AND you're allowed to.
man xhost
for more info about setting up the access.
Or are you opening an ssh tunnel more along the lines of a vpn? I have no idea what you're really asking ...
Computer B:
on this computer resides a program written in C using the SDL lib.
The program does some simple graphics rendering. Basically just draws a Bit Map over the whole screen.
Ex.1
On computer B I open a terminal and run the program.
root@over:#./SDL_Program
And the program runs great.
Ex.2
I use a terminal on Computer A to SSH into Computer B, and run the SDL program.
Fedora-dev:$ssh root@192.168.1.2
root@over:/# ./SDL_Program
Doing it this way I get errors.
I think the program running on computer B is trying to draw the bitmap on computer A, and getting errors. I need to launch the SDL program residing on computer B from computer A and have it draw on computer B.
I think it should work. I have a game program on my other computer (I think it was written with SDL). I can run it over ssh, but can't really play it as graphics slow down at lot when it is tunneled through X11 on ssh. (Especially if you are using wireless like me). Check /etc/ssh/sshd_config and see whether you have X11 forwarding enabled.
Can you explain, why you want to do such thing? Having program showing their output somewhere else than where you are running them seems like bad idea to me.
For clarification: OP does not want to see the output of hos program on the computer he is using as ssh client, but rather to be displayed on the host screen. I have no idea whether it is easily doable. As Linux is multi user system, the display on that computer might be used by someone else at that time and you would be effectively highjacking his display.
This is an "embedded" system, and I will be controlling it through a remote connection. Because it is embedded and the only control I have is through an ssh connection, I need to be able to stop and launch programs from my remote computer. However, when I launch my program, from the ssh connection, that outputs to the embedded systems display, it crashes.
Ex. User is looking at my prototype "embedded system", which has no user inputs, and I want to show different UIs or different programs, I need to be able to launch these from my computer.
I misunderstood the OP purpose. I think that having a remote user access the display/framebuffer would be a security threat and I am not sure that would be advised or allowed.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.