wslg: Unable to init server: Could not connect: Connection refused (gedit:1859): Gtk-WARNING : cannot open display:)

Can anyone help-me with this issue: **Unable to init server: Could not connect: Connection refused (gedit:1859): Gtk-WARNING : 18:14:00.048: cannot open display:

wsl --update Checking for updates… There are no updates available. Versão do kernel: 5.10.60.1

wsl -l -v

NAME                            STATE           VERSION
* Ubuntu                        Running          2
 docker-desktop            Running          2
 docker-desktop-data    Running          2

in PowerShell 7 I have this result When I try found CBL Mariner PS C:\Users\neuberfran> wsl --system There is no distribution with the given name.

wslG-ubuntu2004-ISSUE

I tried this:

https://stackoverflow.com/questions/60284542/wsl-gedit-unable-to-init-server-could-not-connect-connection-refused

But not solved

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 26 (5 by maintainers)

Most upvoted comments

@neuberfran Then that’s the problem. Put a # in front of the last line like this

[wsl2]
#guiApplications=false

and save the file. After running wsl.exe --shutdown and running wsl again then gedit should work.

@onomatopellan works tks 😄

The output of ls -la /tmp would’ve been helpful. In all my wslg instances it is always x0, not x10. The non existing /tmp/wslg folder is odd.

Just to be sure: you performed wsl --update and wsl --shutdown to actualy replace the updated system distro?

Note: I am running Win11 final (build 22000).