WSL – GEDIT Unable to init server: Could not connect: Connection refused

You need an X server to run graphical applications like gedit. I use VcXsrv or Xming on my Windows desktops, both are very small and easy to install, but there exist other servers like Cygwin/X.

Short instructions for VcXsrv/Xming:

  • download and install the Windows package
  • start XLaunch or Xming
  • export the DISPLAY variable in your WSL terminal and start geditexport DISPLAY=0:0 gedit

I have the problem that some checkboxes in gedit’s preferences are not working (dconf error, I don’t care), but other than that the editor is usable.

Related:

  • What’s the easiest way to run GUI apps on Windows Subsystem for Linux as of 2018? (askubuntu.com)

Leave a Comment