How to Configure Cygwin X for Remote Connection

I have been working on implementing Docker images in my work place. One hurdle with running Linux docker container with GUI is X11. I have tried a lot of different X11 for Windows. It took me a while to figure out how to configure Cygwin X to be connected with docker containers. (setup-x86_64.exe) I have been working on implementing Docker images in my work place. One hurdle with running Linux docker container with GUI is X11. I have tried a lot of different X11 for Windows. It took me a while to figure out how to configure Cygwin X to be connected with docker containers.

Here are the steps to configure the 64bit Cygwin:

  • Download Cygwin 64bit (setup-x86_64.exe) from this page
    https://cygwin.com/install.html
  • Run the installer (setup-x86_64.exe) and select xinit and xhost during installation
  • After the installation is done. Run Cygwin64 Terminal
  • In the Cygwin64 Terminal, enter this command to start the X server. Note that it’s doube dash after startxwin.
    startxwin -- -listen tcp &
  • Enter the following commands in Cygwin64 Terminal to allow connections from any host.
    export DISPLAY=localhost:0.0
    xhost +

Note that the last step only has to be done once. You don’t have to type them again next time you run the X server unless you have a new version of X server.


This post may contain affiliated links. When you click on the link and purchase a product, we receive a small commision to keep us running. Thanks.