LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 09-21-2006, 11:43 AM   #1
rizhun
Member
 
Registered: Jun 2005
Location: England
Distribution: Ubuntu, SLES, AIX
Posts: 268

Rep: Reputation: 47
SSH and X11 using Cygwin/X


Hello all,

I would like to be able to run X applications remotely from my Windows laptop.
I have been able to do this in the past using eXceed - however, my free trial is running out
So I thought I'd jump in and download and install Cygwin and Cygwin/X.

Now when it comes down to X11 I'm a complete n00b, so I'll just go through exactly what I've done to try and start YaST2 on a remote machine.

Start Cygwin.
Run the command 'startx'.
Used the window this opens to 'ssh -X user@host' (I know you can use other terminal programs but I'm just trying to keep it simple at this stage).
Changed to the root user.
Exported the display 'export DISPLAY=myip:0.0'
Run the 'yast2' command.

Here's where things start to go wrong.

On my session to the remote server, I recieve the following error:

Code:
[root@myserver][/root]$ yast2
Xlib: connection to "172.16.41.62:0.0" refused by server
Xlib: No protocol specified
And on the original Cygwin window I have:

Code:
rizhun@mylaptop ~
$ startx

Welcome to the XWin X Server
Vendor: The Cygwin/X Project
Release: 6.8.99.901-4

Contact: cygwin-xfree@cygwin.com

XWin was started with the following command line:

X :0 -multiwindow -clipboard

_XSERVTransmkdir: Owner of /tmp/.X11-unix should be set to root
winValidateArgs - g_iNumScreens: 1 iMaxConsecutiveScreen: 1
(II) XF86Config is not supported
(II) See http://x.cygwin.com/docs/faq/cygwin-x-faq.html for more information
winDetectSupportedEngines - Windows NT/2000/XP
winDetectSupportedEngines - DirectDraw installed
winDetectSupportedEngines - DirectDraw4 installed
winDetectSupportedEngines - Returning, supported engines 00000007
winSetEngine - Multi Window or Rootless => ShadowGDI
winAdjustVideoModeShadowGDI - Using Windows display depth of 32 bits per pixel
winAllocateFBShadowGDI - Creating DIB with width: 2560 height: 1024 depth: 32
winFinishScreenInitFB - Masks: 00ff0000 0000ff00 000000ff
winInitVisualsShadowGDI - Masks 00ff0000 0000ff00 000000ff BPRGB 8 d 24 bpp 32
null screen fn ReparentWindow
null screen fn RestackWindow
InitQueue - Calling pthread_mutex_init
InitQueue - pthread_mutex_init returned
InitQueue - Calling pthread_cond_init
InitQueue - pthread_cond_init returned
winInitMultiWindowWM - Hello
winMultiWindowXMsgProc - Hello
winInitMultiWindowWM - Calling pthread_mutex_lock ()
winMultiWindowXMsgProc - Calling pthread_mutex_lock ()
MIT-SHM extension disabled due to lack of kernel support
XFree86-Bigfont extension local-client optimization disabled due to lack of shar
ed memory support in the kernel
(--) Setting autorepeat to delay=500, rate=31
(--) winConfigKeyboard - Layout: "00000809" (00000809)
(--) Using preset keyboard for "English (United Kingdom)" (809), type "4"
Rules = "xorg" Model = "pc105" Layout = "gb" Variant = "(null)" Options = "(null)"
The XKEYBOARD keymap compiler (xkbcomp) reports:
> Warning:          Type "ONE_LEVEL" has 1 levels, but <RALT> has 2 symbols
>                   Ignoring extra symbols
Errors from xkbcomp are not fatal to the X server
(--) 3 mouse buttons found
Could not init font path element /usr/X11R6/lib/X11/fonts/CID/, removing from list!
winPointerWarpCursor - Discarding first warp: 1280 512
winInitMultiWindowWM - pthread_mutex_lock () returned.
winProcEstablishConnection - Hello
winInitMultiWindowWM - pthread_mutex_unlock () returned.
winMultiWindowXMsgProc - pthread_mutex_lock () returned.
winInitMultiWindowWM - DISPLAY=127.0.0.1:0.0
winMultiWindowXMsgProc - pthread_mutex_unlock () returned.
winMultiWindowXMsgProc - DISPLAY=127.0.0.1:0.0
cat: /cygdrive/h/.Xauthority: No such file or directory
winInitClipboard ()
winProcEstablishConnection - winInitClipboard returned.
winClipboardProc - Hello
DetectUnicodeSupport - Windows NT/2000/XP
winClipboardProc - DISPLAY=127.0.0.1:0.0
winInitMultiWindowWM - XOpenDisplay () returned and successfully opened the display.
winMultiWindowXMsgProc - XOpenDisplay () returned and successfully opened the display.
winClipboardProc - XOpenDisplay () returned and successfully opened the display.

winProcSetSelectionOwner - Clipboard not yet started, aborting.
winProcSetSelectionOwner - Clipboard not yet started, aborting.
AUDIT: Thu Sep 21 16:58:12 2006: 1656 X: client 6 rejected from IP 172.16.2.111
At first I thought a firewall (one of many at my workplace) might be getting in the way... However If I'm quick enough after running the 'yast2' command I can run at 'netstat -a' from MSDOS on my laptop and see the connection on port 6000 between the laptop and server.

Any help with this would be really appreciated.

Thanks in advance,
riz.
 
Old 09-21-2006, 11:55 AM   #2
Cyber_Paladin
LQ Newbie
 
Registered: Mar 2006
Location: Hong Kong
Distribution: Debian
Posts: 24

Rep: Reputation: 15
The thing with SSH tunneled X session is that you don't have to set DISPLAY. SSH will handle that. In fact if you change that then it breaks.

For me, I use Cygwin on a Windows to do stuff on my Debian box remotely.
Remember to fire up the ssh -X command from an xterm.
Then after you connect if you "echo $DISPLAY" you should see something like "localhost:10.0". That socket is the X socket being tunneled inside the encrypted SSH tunnel.

If you explicity set DISPLAY on the X-client like what you did, you'll run into the X-server authentication problem back in the good old days when all the world's using telnet

So, make sure your shell's startup / logon script does not set the DISPLAY variable.

Have fun
 
Old 09-22-2006, 08:36 AM   #3
rizhun
Member
 
Registered: Jun 2005
Location: England
Distribution: Ubuntu, SLES, AIX
Posts: 268

Original Poster
Rep: Reputation: 47
Thanks for the reply Cyber_Paladin, but that doesn't seem to work.

When I echo back $DISPLAY i just get a blank line (ie. its not set).
And when I try and run a command, like 'ikeyman', it doesn't open the window it should.
I just get the error message:

Code:
Error: Can't open display:
Any more ideas??
 
Old 09-22-2006, 01:39 PM   #4
Cyber_Paladin
LQ Newbie
 
Registered: Mar 2006
Location: Hong Kong
Distribution: Debian
Posts: 24

Rep: Reputation: 15
Em... it feels funny if the DISPLAY is not set...

In the SSH server's sshd_config, is the following present?
Code:
X11Forwarding yes
X11DisplayOffset 10
The "10" above can actually be any number.

Another one to try is using a "-Y" instead of "-X'
 
Old 09-27-2006, 07:38 AM   #5
rizhun
Member
 
Registered: Jun 2005
Location: England
Distribution: Ubuntu, SLES, AIX
Posts: 268

Original Poster
Rep: Reputation: 47
Thumbs up

This turned out to be an 'xhost' problem - although I didn't think it was turned on.
Adding a line to turn 'xhost' on and off again in my .bash_profile fixed the problem.

Hope others find this thread useful.

Thanks for your help Cyber_Paladin.

This thread can be closed!
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
SSH with Cygwin UltraSoul Linux - General 0 07-07-2005 12:44 PM
SSH Keys on Redhat/Cygwin tracer Linux - General 2 01-05-2005 05:45 PM
help running x11 applications from cygwin/x on a LAN combrains Linux - Networking 5 11-08-2004 07:07 PM
cygwin ssh problem belorion Linux - General 3 02-25-2004 06:11 PM
cygwin ssh and zonealarm Cass Linux - Newbie 1 01-24-2004 08:14 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 10:47 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration