DEV Community

Discussion on: Using Graphical User Interfaces like Cypress' in WSL2

Collapse
 
cleitonper profile image
Cleiton Pereira • Edited

Hi Nick, thanks for the article.

I'm trying to run cypress inside wsl 2, but the command yarn run cy:open always display an error message saying this: (Cypress:23887): Gtk-WARNING *: 17:08:53.243: cannot open display: 172.22.208.1:0.0 Done in 40.56s.*

The $DISPLAY environment variable is already set, and VcXsrv is up and running.

Any idea what is causing that?

Collapse
 
scalopus profile image
Warun Kietduriyakul • Edited

Hi Nick, Thank you for the article, I'm so grad that it easy to follow and successfully bring it up.

I got the same issue about 'cannot open display'. Finally, I got solution, I just need to change firewall policy for the VcXsrv to able to working in Public even I am in the home (Private network). Then after that, everything work well.
Open the Control Panel as following
Control Panel\System and Security\Windows Defender Firewall\Allowed apps
and Enable VcXsrv in Public.

I also follow this script but it seem not related to this issue.
github.com/microsoft/WSL/issues/47...

Just leave the detail in case someone may experience the same.

Collapse
 
nickymeuleman profile image
Nicky Meuleman • Edited

Hey!

Apparently, in some distros you have to enable the option called X11Forwarding manually first.
superuser.com/questions/310197/how...

Hope it helps, I had no idea what could cause it so I googled the error.
edit: this link also seems helpful: thegeekstuff.com/2010/06/xhost-can...