Cygwin/X and Windows Subsystem for Linux

Solution 1:

You need to tell Cygwin/X to listen to TCP, which it does not do by default. You do this by passing the option -listen tcp to XLaunch. When you do this, it works really fine. I do actually prefer Cygwin/X to Xming. More details in the manual.


Find the shortcut that you're using to start Cygwin/X. (Per-user startup shortcuts are in C:\Users\<you>\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup, while system-wide startup shortcuts are in C:\ProgramData\Microsoft\Windows\Start Menu\Programs\StartUp. Open the "Properties" of this link, and change the target from

C:\cygwin64\bin\run.exe --quote /usr/bin/bash.exe -l -c "cd; exec /usr/bin/startxwin"

to

C:\cygwin64\bin\run.exe --quote /usr/bin/bash.exe -l -c "cd; exec /usr/bin/startxwin -- -listen tcp"

For xauth support, you should copy ~/.Xauthority from your Cygwin's home dir to your WSL's home dir.

Or if you wish to disable xauth, you can edit Cygwin's /usr/bin/startxwin, changing the appropriate line near the top to enable_xauth=0.