11

I am trying to setup Cypress on WSL ubuntu for windows 10 machine. WSL ubuntu does not come up with its own display. Hence, we need to follow few steps before setting up Cypress. I followed all the steps mentioned in the blog here: https://nickymeuleman.netlify.app/blog/gui-on-wsl2-cypress But I keep getting the following error:

Cypress failed to start.

This is usually caused by a missing library or dependency.

The error below should indicate which dependency is missing.

https://on.cypress.io/required-dependencies

If you are using Docker, we provide containers with all required dependencies installed.

----------


(Cypress:1690): Gtk-WARNING **: 10:15:51.766: cannot open display: 183.87.117.18:0.0

----------

Platform: linux (Ubuntu Linux - 18.04)
Cypress Version: 4.6.0

I have also installed XLaunch for windows 10. Was anyone able to resolve this issue earlier ? Could anyone please help me resolve this ?

Thanks

2

2 Answers 2

1

Got the idea from here: https://github.com/microsoft/WSL/issues/4106#:~:text=you%20may%20also%20need%20to%20launch%20vcxsrv%20with%20the%20-ac%20argument.

If you have XLaunch running - exit it by double-clicking on the icon in the taskbar and click Exit;

Then open your start menu > right-click XLaunch shortcut > More > Open file location;

Right-click XLaunch shortcut in the Explorer window > Properties;

Add " -ac" without double quotes right after the closing double quote in the Target field - i.e. for me it was "C:\Program Files\VcXsrv\xlaunch.exe" -ac;

Click ok

Now run Cypress again. Yay! Ran for me :)

0

For me, this was caused by having a WSL1 image (despite having WSL2 installed). You can check via wsl --list --verbose. Follow steps here to convert to WSL2.

Not the answer you're looking for? Browse other questions tagged or ask your own question.