6

My gedit application is working as normal when I launch it from launch menu and I can do all the kind of things.

However when I go to terminal and issue the following command:

gedit text1

Then I get the following output:

Failed to connect to Mir: Failed to connect to server socket: No such file or directory

Unable to init server: Could not connect: Connection refused

(gedit:3825): Gtk-WARNING **: cannot open display:

However the application vim is working as normal.

This is very frustrating as I normally work in terminal and rarely use GUI except for gedit

It may be noted that today I have installed openssh server. And henceafter I am facing this problem. Why is this happening

Jonas Czech
  • 3,997
  • 21
  • 40
rancho
  • 3,926
  • 6
  • 23
  • 53
  • Perhaps try the answer here: [Why gedit is not opening a file from terminal?](http://askubuntu.com/q/392168) does it work when you run it with `DISPLAY=:0 gedit text1` ? – Jonas Czech Jun 06 '16 at 16:48
  • I get the following output: http://paste.ubuntu.com/17066040/ – rancho Jun 06 '16 at 16:52
  • Moreover it was working perfectly fine just an hour ago, the problem has started after installing openssh-server – rancho Jun 06 '16 at 16:53
  • 1
    Try to re-login or at least open a new terminal. You might have messed up some environment variables. – Jakuje Jun 06 '16 at 16:56
  • Yeah you were right. I rebooted my computer and now everything is working fine. Thanks. Can you please elaborate what was the problem? – rancho Jun 06 '16 at 17:06
  • On my computer, it was because I changed the hostname using `hostname`. That probably messed up the system somehow. – dat tutbrus Mar 13 '17 at 01:36

1 Answers1

1

@rancho since i am new user to askubuntu, i can't comment on your question... All i know whenever you log-in into ssh server, you cannot open gedit due to DISPLAY error as stated in the link of @JonasCz. And the reason it worked after you rebooted your system because you automatically logged out from openssh server. Whenever you want to log out the openssh server after login, simply logout the ssh using "exit" command and then use gedit.. Thank you