WSL - GEDIT Unable to init server: Could not connect: Connection refused
Feb 18
I'm using Ubuntu 18.04 as Windows Subsystem for Linux on my Windows 10 machine.
I've installed gedit without any errors or warnings.
But whenever I try to use the command gedit something (here something is a filename)
I get this error:
Unable to init server: Could not connect: Connection refused
(gedit:48): Gtk-WARNING **: 21:03:26.729: cannot open display:
1 answer
Accepted answer · original discussion
Feb 18
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 gedit
export 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:
0 question comments
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.