Ask Your Question

Run Gedit as root in wayland

asked 2017-02-13 00:47:44 -0500

hend gravatar image

I am trying to run applications like gedit and nautilus as root, but cannot find an option to do this. If I try terminal command I get an error. It seems like wayland does not allow me to run a graphical app from terminal

edit retag flag offensive close merge delete

5 Answers

Sort by ยป oldest newest most voted

answered 2017-02-13 11:54:44 -0500

ibanha gravatar image
edit flag offensive delete link more


This solution works for me. Do I have to enter this every time I logon?

hend gravatar imagehend ( 2017-02-14 12:35:50 -0500 )edit

Yes, enter this every time

ibanha gravatar imageibanha ( 2017-02-15 01:23:28 -0500 )edit

Alternative solution to entering it every time. Add xhost +local: to your .bash_profile file in your home folder. Although Fedora 25 uses Wayland, it is still running Xorg Server for backwards compatibility. Any command in .bash_profile is ran upon login.

ppringle gravatar imageppringle ( 2017-06-27 10:37:24 -0500 )edit

This still works in F26. Thanks

geralan gravatar imagegeralan ( 2018-07-18 12:32:01 -0500 )edit

answered 2017-02-13 05:31:24 -0500

hhlp gravatar image

updated 2017-02-13 05:31:51 -0500

Graphical applications can't be run as root from terminal

It is not possible to start graphical apps under the root account from terminal when using su or sudo. Apps which use polkit to request administrator permissions for just certain operations and only when needed are not affected (they are not started as root right away). The discussion is ongoing about the best approach to take, see bug 1274451 and "On running gui applications as root" thread in fedora-devel mailing list.

taken from this :


edit flag offensive delete link more


How did this get voted up twice when the answer above shows a method that does work?

rookieoz gravatar imagerookieoz ( 2017-08-22 00:05:59 -0500 )edit

answered 2017-02-13 19:37:21 -0500

asta666 gravatar image

I use command beesu graphicalApp. Works well, requires package beesu to be installed of course.

edit flag offensive delete link more

answered 2017-02-13 01:05:37 -0500

Bhs gravatar image

You are probably adding the & after the command which somehow doesn't work in Fedora while using su or sudo.

Ways to run GUI apps as root from terminal are as follows: (ordered as most preferable first)

  1. su -c gedit and su -c nautilus (requires root password)
  2. sudo gedit and sudo nautilus (requires user password with root privilages)
  3. su and then from root, just simply evoke whatever app gedit & or nautilus & (this is considered risky if you be careless here; and ampersand works here)
edit flag offensive delete link more


IF you try su or sudo you get a error related to display, which is related to wayland, so this does not work, and is why I asked the question

hend gravatar imagehend ( 2017-02-13 07:40:01 -0500 )edit

answered 2017-02-13 01:55:14 -0500

shark gravatar image

try :

su -c gedit

edit flag offensive delete link more

Question Tools



Asked: 2017-02-13 00:47:44 -0500

Seen: 8,520 times

Last updated: Feb 13 '17