I've seen this question before, but none of the solutions are working for me. I know the steps that are mentioned everywhere to get GUI applications working for WSL 2 on the Windows 10 Pro Insider Preview.

  1. Install XServer on your windows 10 machine (here I used VcXsrv)
  2. Run the XServer
  3. Install something in WSL 2 that you want to display (for me it was terminator)
  4. Run DISPLAY=:0 terminator -u to get it running.

However, when I do number 4, I get:

Unable to init server: Could not connect: Connection refused
Unable to init server: Could not connect: Connection refused
You need to run terminator in an X environment. Make sure $DISPLAY is properly set

When I echo $DISPLAY it returns :0 as expected.

When I try to open something simple like xclock I get Error: Can't open display: :0

The X server is definitely running as I set it up and it exists in the Windows 10 system tray. I've tried many configurations for the X server, and I get the same thing every time. I've also tried just setting the $DISPLAY in the .bashrc file, with the same results.

I've also tried the solutions proposed here, by exporting DISPLAY to localhost:0.0, which the same results (also tried 0.0, :0, and a few others).

I've tried rebooting, uninstalling and reinstalling things, and I get the same results every time. I'm not sure what to try next.


1 Answer 1


You need to export your display so use:

export DISPLAY=:0.0

  • I've already tried exporting DISPLAY to :0.0, localhost:0.0, and :0. In the instructions I linked it said to export it, and in my solution I said I "set" it, but I should have said export. Aug 29, 2019 at 2:28

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