You are not logged in.

#1 2016-10-13 05:36:09

halogen
Member
Registered: 2014-06-12
Posts: 67

"Cannot open display" when running graphical apps as root

After applying today's updates I cannot launch graphical applications as root anymore (tried bleachbit and leafpad from bash, got: No protocol specified, Cannot open display / Could not open X display...)

Not sure if this is something on my end or what... Can anyone help me?

Offline

#2 2016-10-13 06:27:54

lolilolicon
Member
Registered: 2009-03-05
Posts: 1,722

Re: "Cannot open display" when running graphical apps as root


This silver ladybug at line 28...

Offline

#3 2016-10-13 08:59:17

halogen
Member
Registered: 2014-06-12
Posts: 67

Re: "Cannot open display" when running graphical apps as root

The xhost method works. I still don't understand what is causing this. Is anyone else experiencing this issue after the latest updates?

Last edited by halogen (2016-10-13 15:19:50)

Offline

#4 2016-11-25 10:50:21

lasombra
Member
From: Luzern
Registered: 2011-09-01
Posts: 68

Re: "Cannot open display" when running graphical apps as root

Xhost method does not work for me. I have the following

>sudo gparted
Created symlink /run/systemd/system/-.mount → /dev/null.
Created symlink /run/systemd/system/boot.mount → /dev/null.
Created symlink /run/systemd/system/home.mount → /dev/null.
Created symlink /run/systemd/system/run-media-username-889B\x2d06DF.mount → /dev/null.
Created symlink /run/systemd/system/run-user-1000.mount → /dev/null.
Created symlink /run/systemd/system/run-user-120.mount → /dev/null.
Created symlink /run/systemd/system/tmp.mount → /dev/null.
Created symlink /run/systemd/system/var-lib-machines.mount → /dev/null.

(gpartedbin:25965): Gtk-WARNING **: cannot open display: 
Removed /run/systemd/system/-.mount.
Removed /run/systemd/system/boot.mount.
Removed /run/systemd/system/home.mount.
Removed /run/systemd/system/run-media-username-889B\x2d06DF.mount.
Removed /run/systemd/system/run-user-1000.mount.
Removed /run/systemd/system/run-user-120.mount.
Removed /run/systemd/system/tmp.mount.
Removed /run/systemd/system/var-lib-machines.mount
>gksudo gparted

(gksudo:26117): Gtk-WARNING **: cannot open display

Offline

#5 2016-11-25 22:42:54

seth
Member
Registered: 2012-09-03
Posts: 51,056

Re: "Cannot open display" when running graphical apps as root

Your log doesn't mention the invocation of xhost at all.
Are you maybe on Gnome (on wayland)?
In any case, there should be *no* reason to run gparted as root, it uses policykit to evelate permissions for actions that require it.

Offline

#6 2016-12-29 21:22:47

tazee
Member
Registered: 2013-10-13
Posts: 29

Re: "Cannot open display" when running graphical apps as root

Seth, like 'lasombra', I am having this problem too. I am using gnome on wayland. What do I need to do to make this work? When I run gparted in gnome on wayland, the polkit window comes up to asks for the password, but then nothing happens. The gparted window does not show up. But when I run gparted from gnome on xOrg, everything works as expected. So I wonder why running gparted from wayland does not work? Seems something in my system is wrongly configured. It may be missing some packages?

Last edited by tazee (2016-12-29 21:44:27)

Offline

#7 2016-12-29 23:07:49

seth
Member
Registered: 2012-09-03
Posts: 51,056

Re: "Cannot open display" when running graphical apps as root

When I run gparted in gnome on wayland, the polkit window comes up to asks for the password, but then nothing happens. The gparted window does not show up

The polkit invocation should happen at runtime, ie. eg. when the partition table needs to be written.

What you're likey doing instead is trying to either run gparted as root via pkexec or gksu?

Offline

#8 2016-12-30 02:01:39

tazee
Member
Registered: 2013-10-13
Posts: 29

Re: "Cannot open display" when running graphical apps as root

No, I invoke gparted using it's application icon. When I am using gnome from wayland it does not work, while when I use gnome from xOrg it does work.

Offline

#9 2016-12-30 08:20:09

seth
Member
Registered: 2012-09-03
Posts: 51,056

Re: "Cannot open display" when running graphical apps as root

Looked up the package - the icon runs gparted_polkit which itself invokes pkexec if present (which is incredibly dumb, sorry)
Try to run gparted directly - running X11 clients as a different user yet doesn't work on gnome on wayland (which is premature anyway)

Offline

Board footer

Powered by FluxBB