5

I have followed every single step in this tutorial. Double Checked. Double Installed.

https://nickymeuleman.netlify.app/blog/gui-on-wsl2-cypress

But I get the error :

[3974:0912/194522.792278:ERROR:browser_main_loop.cc(1402)] Unable to open X display.
The futex facility returned an unexpected error code.
The Test Runner unexpectedly exited via a exit event with signal SIGABRT
james
  • 515
  • 4
  • 14
  • 1
    Please, provide all the steps to reproduce the problem yourself, see https://stackoverflow.com/help/mcve . The question would become useless if a link were unavailable. – Estus Flask Sep 12 '21 at 13:43
  • @james Did you fix this error? If so, can you please share how? – Arpit Apr 22 '22 at 18:23
  • One thing to check is the value of your DISPLAY variable. The tutorial's method of setting this variable won't work if you've set up an external nameserver in `/etc/resolv.conf`. – Ben Whitmore Nov 15 '22 at 04:08

2 Answers2

4

I had a similar issue, but there was a line before that same error message about Authentication. For me, I had to Disable Access Control after first ensuring all other running instances of VcXsrv were terminated:

Disable access control

Scott McAllister
  • 468
  • 7
  • 12
1

If you've configured an external nameserver, then following the steps of Nicky Meuleman's tutorial, the DISPLAY variable will be set wrong. The tutorial says to add this to your .bashrc:

export DISPLAY=$(cat /etc/resolv.conf | grep nameserver | awk '{print $2; exit;}'):0.0

... but if you've configured an external nameserver, DISPLAY will end up pointing to that server, and it won't work. Instead, you should do this:

export DISPLAY=$( cmd.exe /C netsh interface ip show addresses "vEthernet (WSL)" | grep "IP Address" | sed -e "s/\sIP Address:\s//g; s/\r//" ):0.0

This will set DISPLAY to (e.g.) 172.24.0.1:0.0 instead of 8.8.4.4:0.0.

Ben Whitmore
  • 857
  • 1
  • 6
  • 15