LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   SUSE / openSUSE (https://www.linuxquestions.org/questions/suse-opensuse-60/)
-   -   How to start remote GUI app? (https://www.linuxquestions.org/questions/suse-opensuse-60/how-to-start-remote-gui-app-408668/)

ZiGiE 01-27-2006 01:37 PM

How to start remote GUI app?
 
I'm trying to start a GUI application on remote server. My goal is to be able to open SSH client, run the startup script, like so
Code:

./runapp.sh
and have it started and open its window on the screen of the remote machine.

I would really like not to use VNC or transfer X session to my local machine. I don't need to see the window on my local machine - just need to start the app. I do, however, want the application window to be visible on the screen of the remote machine.

Is the any way to do what I'm trying to achieve? I'm running SLES 9 on the remote server with XDM and FVWM.

Sorry, if this question has been answered before. I've been looking for info on this for some time with no success.

Jelle 01-27-2006 01:47 PM

make sure you have acces to the remote display. Make sure that ssh is not doing X-forwarding (read manpage) and set your display manually to :0. that should put the app on the first display on the remote host.

ZiGiE 01-27-2006 01:50 PM

Quote:

make sure you have acces to the remote display.
How do I do that?

Thanks for the prompt response...

dbogdan 01-27-2006 01:52 PM

export DISPLAY=:0

ZiGiE 01-27-2006 01:53 PM

No, how do I make sure I have access to remote display. Not "how I set environment variable".

Jelle 01-27-2006 01:55 PM

First try it out. If you don't get permission i believe you can fix that with xhost, but read the manpage for that too.

ZiGiE 01-27-2006 02:05 PM

Sweet! It works! After I set the DISPLAY value to :0.
Quote:

export DISPLAY=:0.
I ran xhost and it gave me a ddifferent result this time:
Quote:

access control enabled, only authorized clients can connect
instead of original:
Quote:

xhost: unable to open display ""
or:
Quote:

xhost: unable to open display "localhost:0.0"
(before I tried to set my DISPLAY to "localhost:0.0", obviously that didn't work). So now I can execute remote GUI application and it opens up on remote screen. Thanks for help!

ZiGiE 01-27-2006 04:31 PM

Argh...

Now I know why I was having trouble getting results before. This works only if I have already logged in through X. So if I have an X session open on the remote computer, i.e. I have manually logged in using graphical interface. If I restart remote server and don't login using graphical prompt, I cannot start the application remotely, get the following error:
Quote:

Xlib: connection to ":0.0" refused by server
Xlib: No protocol specified
Looks like I need advice from X experts.

Brian1 01-27-2006 05:50 PM

To me it seems you need to run vncserver and set it to display 1 or 2. That way that gui as that user is already up. Then do the same as above except point to display 2

Just a thought.
Brian1

spooon 01-27-2006 10:53 PM

You shouldn't do any DISPLAY or xhost stuff or anything, just do "ssh -Y ..." when you connect using ssh and it will forward X for you.

Brian1 01-28-2006 01:02 PM

Yes using the ssh -Y is great but I think he need to start a gui type app on the remote machine and it needs to remain on the remote machine. It is confusing not knowing exactly what ./runapp.sh is doing. The more I think about it unless the gui is running then the app will never start. Even if a vncserver on display 2 is created then the app starts on display 2. It can be sent to display 0 but once again the gui on display 0 needs to be running. Only way out I see is to setup the login manager to autologin with a default user account. Then if rstarted it will auto login and start the gui session. My thoughts are related to KDE and Gnome. More simplier guis like icevm or twm might be able be started but again that will be on display 0 and if you really what KDE or Gnome it will need to be started to display1 and so on.

Better stop there I keep running into a block wall.
Brian1

Jelle 01-28-2006 01:37 PM

true he wanted to program to show up on the remote host, so DISPLAY and xhost is appropriate if he is not the user running the desktop.
But even when [xkg]dm is waiting for a login, the X-server is already running. I suppose with the right xhost stuff, you could make it display a program other than xdm.

ZiGiE 01-30-2006 02:31 PM

Quote:

To me it seems you need to run vncserver and set it to display 1 or 2. That way that gui as that user is already up. Then do the same as above except point to display 2
This might be an option. Not a prefered one, but if nothing else works, I guess I will have to try doing that.

Quote:

You shouldn't do any DISPLAY or xhost stuff or anything, just do "ssh -Y ..." when you connect using ssh and it will forward X for you.
Please read from the beginning of the post carefuly before replying.

Quote:

It is confusing not knowing exactly what ./runapp.sh is doing.
Just a script that starts a server Java app. Application uses GUI so, unfortunately, I'm forced to run X or have to rewrite the app.

Quote:

Only way out I see is to setup the login manager to autologin with a default user account. Then if rstarted it will auto login and start the gui session.
That what I'm thinking too. Unfortunately my knowledge of X is close to 0. The Linux server doesn't run KDE or Gnome, we're trying to keep it as light as possible. I was already forced to install X just for this app. What we're running right now is XDM and FVWM. Can anyone help me configure this machine so it can autologin with some user account at boot, have the GUI running and then autostart the app.

Man, what an cumbersome way of doing things... but what else am I going to do?

Brian1 01-30-2006 06:35 PM

Check out this link to setup auto login and setting to startx to start the gui. Haven't used FVWM much. http://www.linuxgazette.com/issue72/chung.html

Brian1


All times are GMT -5. The time now is 02:08 PM.