I am trying to use gedit to view .conf files in Ubuntu server 16.04.2. I can't seem to do it as you can see:

$ sudo gedit /etc/network/interfaces
[sudo] password for blue: 
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:1430): Gtk-WARNING **: cannot open display: $ sudo gedit

I looked for duplicates or similar issues on this forum but it seems to point in using GUI, however I did try to use their workarounds but unfortunately I can't still use it. Anyway you can help me troubleshoot? I tried re-install but still no joy...


gedit is the official text editor of the GNOME desktop environment. Generally, in a server, there is no desktop environment installed or needed. Therefore, gedit can't start and display.

I suggest that you instead use nano.

sudo nano /etc/network/interfaces 
  • thanks for the tip! great help since I am using only the server and no GUI. – bluephoenix71 Jun 29 '17 at 21:29

Simply install GNOME:

sudo apt -y install gnome



  • 3
    Doesn't it matter to you from a security standpoint that you recommend installing the GNOME desktop environment, plus a complete range of plugins and other applications integrating with GNOME on a server? – karel Nov 14 '19 at 3:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.