This is the mail archive of the cygwin-xfree mailing list for the Cygwin XFree86 project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: [Fwd: Re: Multiple Session Question]


=============================================

Holger Krull>> You will need Xwin :1 for the second and 
			Xwin :2 for the third session and so on.

That's the solution - I forgot - is the same way on linux.
Thank you very much, works *GREAT*

For those reading this (via a search engine), if it is not specified, the
default is :0 Which is Display 0, 

Below is a resulting template script that works very nicely, for me, with
some limitations.

I could - via additional shell tricks, do the following:

1)  In the directory: /tmp/.X11-unix/ are unix "?sockets?" 
    (visible only under CYGWIN not via windows). 

	In my case, right now, I have these two files:

		/tmp/.X11-unix/X0
	And	/tmp/.X11-unix/X2

   Thus right now, Display 0, and 2 are active, yours may be different.

2) I could write shellscript stuff that finds a free display number
   And uses that number - instead of hard coding the display number.
   I'll leave that as an exercise for you, the reader.

3) Also - one must deal with "cleanup" of stale files laying around.
   in some clean and graceful way.

=============================================

Holger Krull> But i wonder how your first connect works anyway, have you
setup ssh tunneling somewhere?

Yes, I have, via my "~/.ssh/config" file - I have lots of things setup
Including X-11 forwarding, my identity file, etc. That way I do not have to
re-specify a zillion options everyplace I script SSH.

Again, for those reading this via a search engine, my ssh_config file looks
sort of like this I have many accounts, in this example I use R and X. Both
Accounts have different user names.

I could - specify -X, -L, -I, and -<lots-of-options> on every command line
everywhere I use SSH --yuck, and --double-yuck Or - I can use an SSH config
file (which hides/collects that sort of stuff in one nice little file.

Blow is an example short snippit of an ssh config file (maybe with typos), I
can type: 'ssh rrr' or 'ssh xxx' and it works just fine, see "man
ssh_config" for more details I could add other host entries - like: "ssh
plant1" or "ssh plant2" or "ssh home" and, if needed, with the cygwinX
shellscript (and a fat pipe) run X sessions from anywhere in the world. 


File: ~/.ssh/config

	Host  rrr
      Hostname   rrr.someplace.special.com
      ForwardX11 yes
      ForwardX11Trusted yes
      IdentityFile id_rsa_rrr
      User dellis
	
	[blank lines]

	Host  xxx
      Hostname   xxx.other.place.com
      ForwardX11 yes
      ForwardX11Trusted yes
      IdentityFile id_rsa_xxx
      User duane
	
-- SCRIPT -- 


#-----------------------
#! /bin/sh
# Important variables are:
#   TARGET = hostname you want to connect to.
#   WHO = who (username) you want to connect as. 
#   D_NUM = display number to use for this session.

TARGET=myhostname
WHO=myusername
D_NUM=2

export DISPLAY=127.0.0.1:${D_NUM}.0
export PATH=/usr/X11R6/bin:"$PATH"
export XAPPLRESDIR=/usr/X11R6/lib/X11/app-defaults
export XCMSDB=/usr/X11R6/lib/X11/Xcms.txt
export XKEYSYMDB=/usr/X11R6/lib/X11/XKeysymDB
export XNLSPATH=/usr/X11R6/lib/X11/locale

XWin :${D_NUM} -clipboard -silent-dup-error &

ssh -l $WHO $TARGET "startkde" &

exit



--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://x.cygwin.com/docs/
FAQ:                   http://x.cygwin.com/docs/faq/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]