Use "startxwin" to start the cygwin X server. Use putty or cygwin ssh client for ssh for your guest virtual machine.
If you are using cygwin ssh, do "export DISPLAY =: 0" before running ssh (ie, "vagrant ssh - -vvv -X").
For putty: run "startxwin - -listen tcp", enable ssh-X11 forwarding in the connection configuration of the sleepers, set "X display location" to "localhost: 0" and set the correct path to the .Xauthority file (see, this is probably in your home directory, the output of startxwin will tell you where).
Maybe do not use msys2 ssh (the default firewall environment is msys2, but the tramp also works fine under cygwin) with the cygwin X server (see details for details).
More details:
If you get "connect / tmp / .X11-unix / X0: there is no such file or directory" (in ssh detailed help mode) or a sleeper error "PuTTY X11 proxy server: cannot connect to the forwarded server X: network error: connection failed ", try using tcp sockets instead of standard unix domain sockets.
When you start your Cygwin X server, go to "X -listen tcp -multiwindow" (multiwindow is optional - it opens new windows for each application).
If you use openssh "ssh" from the command line: before going "vagrant ssh - -vvv -X", go to "export DISPLAY = localhost: 0" (not ": 0", but "localhost: 0", therefore he uses tcp). I am running git bash that uses msys2, which does not seem to communicate correctly with my cygwin X server via emulated unix domain sockets. But if I use "vagrant ssh - X" in my cygwin hint (with DISPLAY =: 0 for unix domain sockets), it works.
Great source of information: http://dustwell.com/how-x-over-ssh-really-works.html
Alternatively, you can add "config.ssh.forward_x11 = true" to your Vagrantfile. I think this installs X11Forwarding in / etc / ssh / sshd _config when a guest virtual machine is configured or a "roaming reboot" is started. - https://coderwall.com/p/ozhfva/run-graphical-programs-within-vagrantboxes
Update. It is not recommended to run X without xauth security (as shown above). It's not safe. For example, other computers on the same LAN can connect to your x-server via tcp and sniff your keystrokes with xkeys. Use "startxwin" instead of starting X directly, so it uses the "-auth" option of XWin. This makes it difficult for me to force my msys2 ssh to redirect X to my cygwin X server. The ssh log when connected says that it cannot find the xauth command - this is because it is not in my msys2 environment. Cygwin ssh X-redirection is still working fine. Putty works fine if you set the path of the .Xauthority file (this is probably correct in your home directory) in the putty session configuration.
I found that the tcp / unix-domain socket problem / solution is indeed located in cygwin faq (this faq is quite useful and has a lot of information):
6.7. X PuTTY redirected sessions cannot be connected. Non-bank local X clients cannot connect.
Server X now uses -nolisten tcp by default, which increases the security of the X server by not opening the TCP / IP socket, but only the local (UNIX domain). Non-cygwin-related applications cannot connect to this socket.
https://x.cygwin.com/docs/faq/cygwin-x-faq.html