Ask Your Question
2

fedora 26 Gtk-WARNING **: cannot open display: :0

asked 2017-08-01 15:52:02 -0600

Kissi gravatar image

updated 2017-08-01 16:33:53 -0600

hi guys i get this msg in terminal when i try to run some applications from terminal as ' root ' : #### i get this in terminal #########

[root@nhost ?]# fedy

No protocol specified Unable to init server: Could not connect: Connection refused

(gjs:5881): Gtk-WARNING **: cannot open display: :0


[root@nhost ?]# wireshark

No protocol specified Unable to init server: Could not connect: Connection refused

(wireshark:7674): Gtk-WARNING **: cannot open display: :0

edit retag flag offensive close merge delete

5 Answers

Sort by ยป oldest newest most voted
2

answered 2017-08-01 17:13:30 -0600

florian gravatar image

updated 2017-08-01 17:56:01 -0600

This question has been asked and answered many times in this forum, see here for example

Short answer: Fedora's default display server Wayland does not allow graphical applications to be executed as root.

You need to start Gnome under XOrg or search for the xhost workaround.

edit flag offensive delete link more

Comments

This already sums the situation up pretty well. I'd like to note, though that wireshark should normally work just fine without full root privileges. Just add yourself to the wireshark group and you should be able to run captures with the normal user account.

muep gravatar imagemuep ( 2017-08-02 14:02:38 -0600 )edit
0

answered 2017-08-02 16:04:12 -0600

genodeftest gravatar image

Additionally to florians answer, I recommend not using fedy at all. Its developers don't seem to take IT security serious, see https://github.com/folkswithhats/fedy... for examples.

edit flag offensive delete link more

Comments

??? if the program is useful for the people, welcome! Don't matter all recommendations... Be objective with your answers, which are not answers.

davidva gravatar imagedavidva ( 2017-08-02 20:17:12 -0600 )edit
0

answered 2018-05-09 00:06:02 -0600

Hi, for those who have tried solutions such as

DISPLAY=:0.0

or editing the hostname but still not working,

Try to switching from Wayland to Xorg during login :)

edit flag offensive delete link more
0

answered 2017-08-03 18:15:17 -0600

toddandmargo gravatar image

I had something similar when trying to run leafpad from root. The fix was $ xhost +

edit flag offensive delete link more
0

answered 2017-08-03 03:33:22 -0600

ed209 gravatar image

You can use graphical software as root either under X or Wayland. Here is how.

If you want to use, say, gedit as root, then:

gedit admin:///etc/filename

will edit filename.

Or use:

xhost si:localuser:root

gedit filename

xhost -si:localuser:root

Another related case use. If you need to export display in ssh, like normal user or root:

export GDKBACKEND=x11 gedit filename GDKBACKEND=wayland

Is Wayland running? Read the output of:

echo $XDGSESSIONTYPE

edit flag offensive delete link more

Comments

I think that first one is actually running gedit as your normal users, but tells gedit to use some special mechanism to read and write the file. This is intended to be safer than just running gedit as root because the privileged access is limited to accessing just this one file instead of giving gedit full root powers to change anything anywhere and e.g. start more processes as root.

muep gravatar imagemuep ( 2017-08-03 13:44:15 -0600 )edit

Question Tools

Stats

Asked: 2017-08-01 15:52:02 -0600

Seen: 15,059 times

Last updated: Aug 03 '17