0

My story is:

I download Ubuntu App for Windows to use the Fenics Library, as fenicsproject.org tells.
I installed Fenics Library.
Now i would to create a file to write my code, but when run:

gedit test.py

the answer is:

Unable to init server: Could not connect: Connection refused (gedit:16): Gtk-WARNING **: 11:04:53.373: cannot open display:

I already installed the gedit with command sudo -apt gedit ( or some like this, i don't remember ).

Thank to yall

LeonidMew
  • 2,734
  • 1
  • 21
  • 38

1 Answers1

1

I faced this similar problem a while ago, this is what I did: First install VcXsrv from here https://sourceforge.net/projects/vcxsrv/ After installing, launch "Xlaunch" and complete the configuration. When done, open the Ubuntu terminal and type the following:

export DISPLAY=127.0.0.1:0
. ~/.bashrc

or

export DISPLAY=localhost0.0
.~/.bashrc

Now try any gedit...

gedit

BOOOM!DONE!

  • This worked for me with the exception it was DISPLAY=127.0.0.1:1.0. If anyone else encounters this problem of the port being incorrect, right-click Show Log from the tray. The correct DISPLAY address will be somewhere in there. – Austin Ezell Jun 15 '20 at 05:57