I use Cygwin/X to ssh into a linux computer cluster using a Windows (10) pc. Yesterday I was in the middle of an ssh session using X11 forwarding. Suddenly one of the X windows open started to hang and eventually my Windows OS noticed this and killed the X Server process.

Before this session I had always had to use the terminal commands:

export DISPLAY=:0.0
ssh -Y <user>@<remoteaddress>

to set up the connection and I would be able to open X Windows from the remote cluster on my local display. Whenever I hovered over the Cygwin/XServer icon in the windows system tray it always showed Cygwin/X Server:0.0.

However after the crash of the X Server (and some subsequent crashing, which was only stopped by a reinstall of the X11 packages from Cygwin) I find the default value is now :3.0 (found via system tray).

If it helps I have noticed some differences between the various log files in from the xwin log files found in ~/var/log/xwin/:

In XWin.3.log the log file ends in:

winDeinitMultiWindowWM - Noting shutdown in progress [ 40421.515] (II) Server terminated successfully (0). Closing log file.

But in the corresponding 0, 1 and 2 logs the files do not have this ending, but instead just finish on

//For 0:// IsOverrideRedirect: Failed to get window attributes [243761.625] OS has icon alpha channel support: yes
//For 1:// winInitMultiWindowWM - Could not open display, try: 1, sleeping: 5
//For 2:// winInitMultiWindowWM - DISPLAY=:2.0 [ 15564.281] winMultiWindowXMsgProc - DISPLAY=:2.0

Whilst my ssh still works perfectly, I was wondering if anyone knew why the DISPLAYs :0.0, :1.0 and :2.0 are no longer accessible/working and furthermore how I might be able to reset them (to be able to use :0.0 again)?

(P.s. Let me know if I haven't included the appropriate information, and apologies if my formatting isn't quite up to scratch - this is my first time posting a question on Stackexchange!)

In case anyone else is reading this with the same issue.
After some analysis of the startxwin file in C:\cygwin64\bin\ I identified that the choice of DISPLAY chosen by the X Server on startup depends on the presence of .X<number>-lock files in C:\cygwin64\tmp\ (the script starts at a value of 0, if it finds a .X0-lock file then this number increments until a "free" display number is found, this number is then used). Furthermore, in the ~\tmp folder there also exists a .X11-unix folder which should be empty (provided the X Server is off) in usual operation. In both cases I found that files existed in these locations for DISPLAYs 0, 1 and 2. By uninstalling Cygwin/X11, moving these files out of the C:\cygwin64\ folder (for reference if needed) and reinstalling Cygwin/X11, I have successfully managed to prompt the X Server to start with the default DISPLAY variable of :0.0 again.

That said, I doubt I have done anything to stop this happening again - if anyone has any ideas please share your thoughts!

  • Have you rebooted the Windoes 10 machine since the last crash and re-install? – EightBitTony Mar 6 '16 at 16:55
  • Hi! Yes I've just given another reboot and still the Cygwin/XServer seems to default to the display :3.0 when initially run. – AM300 Mar 6 '16 at 17:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.