export DISPLAY={localWorkstationIP} in mintty

Jeremy Bopp jeremy@bopp.net
Fri Sep 3 15:00:00 GMT 2010

On 9/2/2010 8:37 PM, Andrew DeFaria wrote:
>  On 09/02/2010 03:37 PM, Jeremy Bopp wrote:
>> On 9/2/2010 5:12 PM, PaulHR wrote:
>>> I got the standard error.....
>>> Error: Can't open display:
>>> I made sure xWin Server was running
>>> Did a -vvv on the ssh and saw nothing for X11
>>> What else can I look at?
>> It would be really helpful if you included a little context from earlier
>> bits of the conversation to which you are responding.  I'm going to
>> assume that you responded to my message suggesting you use the -X option
>> to ssh. ;-)
>> It's possible that the corresponding server-side option to allow that
>> feature is disabled.  If so, you could try to reconfigure the ssh
>> server.  The option to enable is named X11Forwarding and it should be
>> set to "yes".  If you are not allowed to do that, then your only option
>> is to go back to your original idea of figuring out your local IP.  This
>> will require a bit more effort on your part.
>> When you connect to the remote machine, there should be an environment
>> variable named SSH_CLIENT set.  It appears to be a space delimited list
>> where the first item is your client's IP address.  Given that and
>> assuming your shell is bash on the server, you can use the following to
>> set the DISPLAY environment variable after you open your connection:
>> export DISPLAY=$(echo $SSH_CLIENT | cut -d' ' -f1):0
>> If that works for you, you may want to put it in your .bashrc or
>> .bash_profile script on the server side so that it happens automatically
>> every time you connect.
>> -Jeremy
> It's been my experience that if you do not have DISPLAY set before you
> ssh then you will not have it set after you ssh (usually to
> localhost:<n> where n is usually not 0).
> BTW don't put the IP address in DISPLAY - just set it to DISPLAY=:0.
> BTW2 X is an awful heavy process to run if your aim is merely to run
> ASCII terminals. Instead use mintty (or rxvt) and -e ssh <remote host>
> instead.

I think you may have things a bit confused here.  Unless I'm the
confused one, the OP wants to open an SSH connection to a remote host
and then start an X client there which connects back to his X server
under Cygwin.  We attempted the simple case of using ssh to tunnel the X
connection, but that appeared to have been blocked by the SSH server.
The only alternative is to use the local host's IP address in the remote
DISPLAY setting to point back to his default X display.

I'm not sure what X clients the OP is trying to run, but I don't think
they're terminals.  The advice provided by Heath in a slightly earlier
thread opened by the same OP would have opened a local terminal of some
kind to host the ssh connection.  Of course, the OP could jump in here
and clarify things... ;-)


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

More information about the Cygwin mailing list