Multiple Session Question

2007-06-07 Thread Duane Ellis
Hello,

I've got cygwin working well via SSH to single host, single window. 
I connect via SSH, and run startkde - I get the KDE desktop in one 
single window. Works great!

How do I connect to a second machine at the same time.

See below for details.

-Duane.


For example:
I login as my self - with ssh  a remote session
And I login as another person to the same machine.
 In my case, I have two accounts:
A development account
And A Test account.

Likewise, I have this situation:
I login to Machine1 - and it works.
I login to Machine2 - and it works.

Problem:
I can only have 1 connection to 1 machine at a time.
Both should have separate window/display.

I have done this with commercial X11 packages, but not CygwinX.

This does not seem to work, and I can't seem to find in the user docs
any thing that reasonably describes some things.

(1) Yes, I have tried using a different display, ie:
127.0.0.1:0.0
And 127.0.0.1:1.0

  That does not work when I have 2 sessions.
  The two displays work - independent of each other

(2) I'm not sure what is going on with the /tmp/.X11-unix/dir
And can't find docs for it - I suspect it is part of the problem.
 
(3) I'm not sure what the --screen options do for the Xwin program.

The script I to start the session (via SSH and public keys) is below,

The difference between the two is WHO and DISPLAY.

The script below - deletes the old /tmp/.X11-dir, which I know is a bad
thing with 2 sessions. I have tried not deleting it - that does not seem to
help.


#!/bin/bash

TARGET=linxbox

WHO=duane
#WHO=testaccount

export DISPLAY=127.0.0.1:0.0
#export DISPLAY=127.0.0.1:1.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

rm -rf /tmp/.X11-unix

XWin -clipboard -silent-dup-error 

echo STARTING KDE REMOTEL
ssh -l $WHO $TARGET startkde 
echo DONE RUNNING KDE REMOTELY

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/



Re: Multiple Session Question

2007-06-07 Thread Holger Krull
Duane Ellis schrieb:
 I've got cygwin working well via SSH to single host, single window. 
 I connect via SSH, and run startkde - I get the KDE desktop in one 
 single window. Works great!
 
 How do I connect to a second machine at the same time.

You will need Xwin :1 for the second and Xwin :2 for the third session
and so on.
But i wonder how your first connect works anyway, have you setup ssh
tunneling somewhere?

 (1) Yes, I have tried using a different display, ie:
 127.0.0.1:0.0
 And 127.0.0.1:1.0

You will need this

 (2) I'm not sure what is going on with the /tmp/.X11-unix/dir
 And can't find docs for it - I suspect it is part of the problem.

I don't think so.

 (3) I'm not sure what the --screen options do for the Xwin program.

not needed here

 The script below - deletes the old /tmp/.X11-dir, which I know is a bad

Don't

 #!/bin/bash
 
 TARGET=linxbox
 
 WHO=duane
 #WHO=testaccount
 
 export DISPLAY=127.0.0.1:0.0
 #export DISPLAY=127.0.0.1:1.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
 
 rm -rf /tmp/.X11-unix
 
 XWin -clipboard -silent-dup-error 
 


--
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/



RE: [Fwd: Re: Multiple Session Question]

2007-06-07 Thread Duane Ellis
No that does not work - session1 starts, 
then session2 - overwrites/destroys session1.
Then it gets really weird

Both are using the same display number (0.0)

Besides, this is problematic in another way.
I need to be able login/logout 
of the two accounts independently.
 
-Duane.


-Original Message-
From: Reid Thompson [mailto:[EMAIL PROTECTED] 
Sent: Thursday, June 07, 2007 11:10 AM
To: Duane Ellis
Subject: [Fwd: Re: Multiple Session Question]

failed to copy you on the reply to the list


try

#!/bin/bash

TARGET=linxbox
TARGETONE=linxbox1

WHO=duane
WHO1=testaccount

export DISPLAY=127.0.0.1:0.0
#export DISPLAY=127.0.0.1:1.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 -clipboard -silent-dup-error 

echo STARTING KDE REMOTEL
ssh -l $WHO $TARGET startkde 
ssh -l $WHO1 $TARGETONE startkde 
echo DONE RUNNING KDE REMOTELY

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/



Re: Multiple Session Question

2007-06-07 Thread Reid Thompson
On Thu, 2007-06-07 at 10:50 -0400, Duane Ellis wrote:
 Hello,
 
 I've got cygwin working well via SSH to single host, single window. 
 I connect via SSH, and run startkde - I get the KDE desktop in one 
 single window. Works great!
 
 How do I connect to a second machine at the same time.
 
 See below for details.
 
 -Duane.
 
 
 For example:
 I login as my self - with ssh  a remote session
 And I login as another person to the same machine.
  In my case, I have two accounts:
   A development account
   And A Test account.
 
 Likewise, I have this situation:
   I login to Machine1 - and it works.
   I login to Machine2 - and it works.
 
 Problem:
   I can only have 1 connection to 1 machine at a time.
   Both should have separate window/display.
 
 I have done this with commercial X11 packages, but not CygwinX.
 
 This does not seem to work, and I can't seem to find in the user docs
 any thing that reasonably describes some things.
 
 (1) Yes, I have tried using a different display, ie:
 127.0.0.1:0.0
 And 127.0.0.1:1.0
 
   That does not work when I have 2 sessions.
   The two displays work - independent of each other
 
 (2) I'm not sure what is going on with the /tmp/.X11-unix/dir
 And can't find docs for it - I suspect it is part of the problem.
  
 (3) I'm not sure what the --screen options do for the Xwin program.
 
 The script I to start the session (via SSH and public keys) is below,
 
 The difference between the two is WHO and DISPLAY.
 
 The script below - deletes the old /tmp/.X11-dir, which I know is a bad
 thing with 2 sessions. I have tried not deleting it - that does not seem to
 help.
 
 
 #!/bin/bash
 
 TARGET=linxbox
 
 WHO=duane
 #WHO=testaccount
 
 export DISPLAY=127.0.0.1:0.0
 #export DISPLAY=127.0.0.1:1.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
 
 rm -rf /tmp/.X11-unix
 
 XWin -clipboard -silent-dup-error 
 
 echo STARTING KDE REMOTEL
 ssh -l $WHO $TARGET startkde 
 echo DONE RUNNING KDE REMOTELY
 
 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/


try

#!/bin/bash

TARGET=linxbox
TARGETONE=linxbox1

WHO=duane
WHO1=testaccount

export DISPLAY=127.0.0.1:0.0
#export DISPLAY=127.0.0.1:1.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 -clipboard -silent-dup-error 

echo STARTING KDE REMOTEL
ssh -l $WHO $TARGET startkde 
ssh -l $WHO1 $TARGETONE startkde 
echo DONE RUNNING KDE REMOTELY

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/



RE: [Fwd: Re: Multiple Session Question]

2007-06-07 Thread Duane Ellis
=

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/