After updating to 15.10 it's impossible to run graphical apps from terminal:

xxx@xxx:~$ gksudo wireshark
Invalid MIT-MAGIC-COOKIE-1 key
(gksudo:5532): Gtk-WARNING **: cannot open display: :0
xxx@xxx:~$ sudo -H wireshark
[sudo] password for xxx: 
Invalid MIT-MAGIC-COOKIE-1 key
** (wireshark:5535): WARNING **: Could not open X display
Invalid MIT-MAGIC-COOKIE-1 keyFailed to connect to Mir: Failed to connect to server socket: No such file or directory
Unable to init server: Could not connect: Connection refused

(wireshark:5535): Gtk-WARNING **: cannot open display: :0
xxx@xxx:~$ wireshark
Invalid MIT-MAGIC-COOKIE-1 key
** (wireshark:5569): WARNING **: Could not open X display
Invalid MIT-MAGIC-COOKIE-1 keyFailed to connect to Mir: Failed to connect to server socket: No such file or directory
Unable to init server: Could not connect: Connection refused

(wireshark:5569): Gtk-WARNING **: cannot open display: :0
xxx@xxx:~$ gedit
Invalid MIT-MAGIC-COOKIE-1 key
** (gedit:5570): WARNING **: Could not open X display
Invalid MIT-MAGIC-COOKIE-1 keyFailed 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:5570): Gtk-WARNING **: cannot open display: :0
xxx@xxx:~$ sudo gedit
Invalid MIT-MAGIC-COOKIE-1 key
** (gedit:5574): WARNING **: Could not open X display
Invalid MIT-MAGIC-COOKIE-1 keyFailed 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:5574): Gtk-WARNING **: cannot open display: :0

My little research pointed to gksudo using but it ain't working either. I've also tried some stuff with xauth. What is the problem? Thanks.

share|improve this question
1  
Try removing .Xauthority - sudo rm -f ~/.Xauthority and then restarting. – Bharadwaj Raju May 6 '16 at 14:00
    
Nah, same thing. – sssemil May 6 '16 at 14:13

As a regular user, run the command xhost +. After that, try running your graphical application again.

share|improve this answer
up vote 3 down vote accepted

Odd but export DISPLAY=:1 helped. Cheers.

share|improve this answer
1  
Are you running multiple X displays or something? Default should be :0 – Bharadwaj Raju May 6 '16 at 14:17
2  
exactly the same issue (on 16.04 in my case); unfortunately this doesn't work. – adam.smith May 7 '16 at 11:45
    
Nope, only one. ":0" was always default but something changed after update. – sssemil May 7 '16 at 17:01
1  
In my case, setting DISPLAY to :0 solved it (while :1 did not) – mbello Jan 27 '17 at 12:54

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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