tags:

views:

464

answers:

2

I installed all the necessary packages for running GUI programs in Cygwin.

Right now, I have to do these things to launch an XWindow program:

1) /bin/startxwin.sh
2) It starts a separate window (the X Window?)
2) In that X Window, ssh -X user@server (this is the remote box where I want to run that box's programs)
3) Then in that X Window, I can launch GUI programs like "xclock".

My question is, can I directly do ssh -X user@server under my original Cygwin window, and launch GUI programs directly, instead of launching a separate X Window and doing it there?

Any instructions are appreciated!!!!

+1  A: 

No, you have to launch X Window server (run startxwin.sh). "ssh -X" is actually not nesessary. You can set environment variable like

export DISPLAY=Cygwin:0.0

in normal cygwin window then launch GUI programs directly.

kcwu
Hmm. I tried doing export DISPLAY=Cygwin:0.0.When I launch the GUI app directly under Cygwin, it says "Cygwin: unknown host (no address associated with name)"
Saobi
+1  A: 

If you want a nice GUI , AFAIK you need an X server to display graphics from your remote "X client".

If what bother you is to manually lauch the X server (?) you may still launch your X server at startup. On my work desktop I do that personnaly (while it don't use X server provided by Cygwin but a commercial one).


Edit: accordinly to the whole comments, You must try with : export DISPLAY=xxx:0.0 , xxx being you the IP address of the machine hosting the x server and add it in your .profile file (or .bashrc file should be fine, but I remember .profile is better for that kind of stuff, nevertheless I may wrong ..)

yves Baumes
Hmm. I don't mind launching the X server, but do I have to work under the X server window to launch GUI apps? Or can I launch the X server, and go back to Cygwin's window and launch GUI apps there?
Saobi
Yes. if i 1) can get rid of that shell ( not too important, just a nuisance, I will investigate that myself, thanks) 2) launch GUI app directly from cygwin and not from the shell (I tried export DISPLAY=Cygwin:0.0, but to no success, see the first post's comment)
Saobi
You must try with : export DISPLAY=xxx:0.0 , xxx being you the IP address of the machine hosting the x server.
yves Baumes
Ok i will try. And can i include that in my .bash_rc (or is it .bash_profile) ?
Saobi
I would include it in my .profile file. But either should do the trick I guess..
yves Baumes
Whats the diff between rc and profile btw ?
Saobi
As far as I remember .profle is read whever you launch your bash for login (it is launch that way once you've log into the system by login program , with bash -login I presume , or something like that) or when you when you launch it "by hand". .bashrc is read only in that last case I think ... But it's better to check with google or man bash ! ;-)
yves Baumes
Great, thanks for everyone's help!.
Saobi