Search code examples
sshgtkcygwinx11xorg

Cygwin/X WARNING **: Could not open X display


After opening cygwin with X, all works great and as expected, but after a few hours I can't open any other program that requires X display:

from cygwin

$ gnome-system-monitor 
** (gnome-system-monitor:21837): WARNING **: Could not open X display
(gnome-system-monitor:21837): Gtk-WARNING **: cannot open display: localhost:10.0

from spawned gnome-terminal

$ gnome-terminal
** (gnome-terminal:20923): WARNING **: Could not open X display
Failed to parse arguments: Cannot open display: 

other than that all works fine

How to reproduce the error:

  1. Install latest cygwin with all x11 components
  2. run ssh -X ${server}@${local-ip} -p${port}
  3. run gui-command (should work)
  4. wait 1-2h (maybe less) and try to start an app with gui

the remote PC is running ubuntu with openssh

Workaround:

Restart cygwin X server

I've looked into the official documentation and found this, but it is of no use as I don't seem to have any of that software installed, and the description of the problems are very broad.

My questions:

What other workarounds are there? Are there others in the same situation? Did I do something wrong? Are there better ways to use remote X11 programs on windows?


Solution

  • Use -Y instead of -X. I had the same problem, this solved it.