I am running Windows 10 on my Surface Pro 3. I installed Cygwin and also added some useful packages (gvim, nedit, emacs, vim, g++). However, when I run gvim, I get "Can't open display". The same thing happens with nedit. When I did echo $DISPLAY, I showed nothing so I set the DISPLAY to :0.0. I still get "can't open display." I tried removing cygwin and re-installing but I get the same problem.
Source : CygwinX FAQ :
Since X server 1.17, by default the server does not listen for TCP/IP connections, only accepting local connections on a unix domain socket.
For local clients, use
DISPLAY=:0.0, rather than
If it does not work (if you are connecting from remote): Use the
-listen tcp option to restore the previous behaviour, allowing the X server to open a TCP/IP socket as well e.g.
startxwin -- -listen tcp
Finally, don't forget to run
xhost + in the Cygwin terminal.
You can also use XLaunch/Xming.
- Open XLaunch, choose "Multiple Windows", and set a Display number (doesn't matter).
- In Cygwin,
export DISPLAY=[whatever your XLaunch Display number is].
- Launch your program with