1

I have installed WSL with ubuntu 18.04 . I want to use gedit which I have already installed . The problem is that whenever I run a command with gedit I get

Unable to init server: Could not connect: Connection refused
(gedit:14177): Gtk-WARNING **: 20:09:43.143: cannot open display: 0:0

My issue is the same as https://stackoverflow.com/questions/60284542/wsl-gedit-unable-to-init-server-could-not-connect-connection-refused where I have followed the instructions but got the same result . In order I tried :

sudo apt-get upgrade sudo apt-get update export DISPLAY=0:0 gedit test.tcl //error hits

I have already downloaded and opened Xming and then tried the above commands and got same error

I also tried reverting back to WSL 1 from WSL 2 and it doesn't seem to me that the version has changed

enter image description here

I would apreciate your help

1
  • 1
    The accepted answer on that question only works for WSL1. To convert your image, you must use wsl --set-version Ubuntu-18.04 1. The --set-default-version command that you tried only changes the default version for instances you create in the future. Apr 8, 2021 at 22:29

0

You must log in to answer this question.

Browse other questions tagged .