Cygwin Xwin Server Randomly Loses Connection

Cygwin XWin server randomly loses connection

I fixed the problem by using:

ssh -Y user@server 

instead of

ssh -X user@server

Apparently, the -Y and the -X flags both do the same thing (enable X11 forwarding). The difference is that -X uses a secure mode and -Y uses a trusted mode. Only use -Y if you trust the machine you are connecting to. If you use -X, then the remote machine will be limited in what it can do with your display. For me, this meant that my display would time out after a while. Using -Y instead, my connection never times out.

cygwin Xserver losing connection

Feel like a total moron to ask a question and answer it myself, but for the same of a future reference, here is a work around that helped. Instead of using ssh -X, if ssh -Y is used instead, it works better and does not drop the ability to spawn new windows over time.

X does not start after cygwin upgrade

I met the same problem after CygWin upgrade.

xwin works fine for me, and it's clean, without the ugly xterm window.

alias runx="run xwin -multiwindow -noclipboard"

According to Daniel, "-noclipboard" is not a must, Thanks.

cygwin startxwin, then ssh into a different machine

It should work with the following modifications:

c:\cygwin64\bin\run.exe --quote /usr/bin/bash.exe -l -c "cd; /usr/bin/startxwin & sleep 5; DISPLAY=:0 ssh -Y my-remote-server xterm"

First, startxwin doesn't daemonize itself, so you need to start it with & to ensure it runs in the background.

Then you need to export the correct DISPLAY enviornment, so that ssh will know which X11 server to connect to (my solution doesn't export the variable, but provides it to ssh only).

Then you need to wait for some seconds to be sure the X server started (sleep 5 is a guess, works on my machine).

Then you actually start the ssh process that connects and executes to the remote server.

I don't know about the run.exe part, I don't have it in my cygwin installation, maybe in your environment it would also work with the following:

c:\cygwin64\bin\bash.exe -l -c "cd; /usr/bin/startxwin & sleep 5; DISPLAY=:0 ssh -Y my-remote-server xterm"

Cygwin content disappear issue

What terminal are you using? By default cygwin just runs bash under the usual windows cmd.exe, which is definitely not all that great; installing and using mintty (simplest way to do so is through cygwin's setup.exe) and setting the scrollback buffer size to accommodate your needs should fix the problem.

You could use other terminals too- PuTTY, xterm, rxvt, etc (even the KDE and Gnome terminals are available through Cygwin Ports)- but mintty is probably the best option for most cygwin users' needs (it's rather simple, small, and fast, and it integrates well with Windows).

Another option would be to redirect compilation messages: use > to redirect stdout to a file, overwriting it if it already exists, >> to append, and add a & if you want both stdout and stderr redirected, e.g. gcc mysource.c &>compilelog.

X11 Forwarding: Bad File Number Error?

You're using XWin outside of Cygwin, which might be causing issues. Try setting your DISPLAY=127.0.0.1:0, as suggested here:

http://cygwin.com/ml/cygwin-xfree/2002-10/msg00065.html

under "Using Cygwin's OpenSSH with XWin-32"

DB2 Server connection lost when running a select inside a shell script

The reason is that both the VAL=$(....) and the echo $(db2 -txf sql) each runs a subshell, and in that subshell there is no database connection. Your workaround does not involve a subshell, so it works.

For bash, If you are prevented from having a connect inside your scripts then you must avoid sub shelling for the Db2 CLP , as you do with your workaround.

You can use temporary files to avoid subshells, at the cost of more parsing etc. For example instead of using VAL=$(db2 ...) use db2 ... > $tmpfile followed by VAL=$(cat $tmpfile) or similar technique.

You cannot 'forward the connection' as such.

If you are able to use ksh93 with coprocesses then you can communicate between processes and ensure all db2 CLP actions happen in one task that then pipes results to another task. But such complexity is rarely worthwhile and it may be preferable to use a different non-shell scripting language.

Forwarding X11 without SSH? How do I run local apps on another Pc running X Server?

Your direction was OK. export DISPLAY is what you want. But it is not enough.

On the target, you need to type

xhost +from.where.the.windows.are.coming.com

It gives the X server the permission to allow remote windows from this computer.

Beware, it is not really secure! A possible attacker could not only windows shown by you, but even control your mouse/keyboard. But for simple solutions, or if you can trust the remote machine and the network between you, it may be ok.

If not, there is an advanced authorization, based on preshared keys. It is named xauth. Google for xauth.

The Xorg server has an option to disable the remote windows, and there are distributions, (f.e. ubuntu!) who turn this option by default on. You can test it - if you can telnet to the tcp port 6000, it is allowed.



Related Topics



Leave a reply



Submit