Command-Line – How to Launch Graphical Apps from Terminal After Updating to 15.10

command lineupgrade

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.

Best Answer

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

This turns off host-based access control on the X server. Here is the relevant information from the man page:

The xhost program is used to add and delete host names or user names to the list allowed to make connections to the X server.

+ Access is granted to everyone, even if they aren't on the list (i.e., access control is turned off).

Related Question