You are not logged in.
Hello:
Today I tried to start gparted from the menu but it will not start.
I searched the logs but found nothing.
If I try to start it as root from the cmd line, I get this:
# gparted
(gpartedbin:7345): Gtk-WARNING **: 09:37:51.663: cannot open display:
# That said, I can start parted as root from the cmd line so my guess is that it is probably (?) a display server issue but /var/log/Xorg.0.log has nothing to say.
I cannot recall when I last used gparted, but I do recall it was working properly.
Being in a rush, I reinstalled it (no my usual procedure) but the problem subsists.
I don't want my weekly drive image to have this.
Where to look for the source of the problem?
Best,
A.
Offline
When starting gparted from the menu you should be asked for root credentials. Does that happen? This "cannot open display" indicates at some permission issues. Have you changed the policy kit?
Offline
"cannot open display" indicates at some permission issues.
No, it indicates that GTK cannot open the X display <null> (note the trailing ":[nothing]" in "cannot open display:"), likely because the DISPLAY variable is not set in root's environment.
If I try to start it as root from the cmd line, I get this:
Which "cmd line"? A real TTY? an xterm? whatever terminal emulator from whatever DE you're using?
GUI terminal emulators usually set DISPLAY, but su may or may not strip environment for security - I don't recall how it's configured in Debian these days. Check output of 'env'.
SSH logins and TTYs do not, so one usually needs to correctly set DISPLAY and authorise the launching user to connect to the server (with e.g. xhost), see the X manual.
Regarding gparted not starting from the menu, I don't use gparted myself but the usual solution for GUI applications that need to run as root but don't handle privilege escalation themselves is to use some kind of launcher - pkexec (with org.freedesktop.policykit.exec.allow_gui set, see 'man pkexec'), gksu, kdesu etc.
Since OP didn't specify what command this "menu" is launching (or even what "menu" they're talking about, in which DE/WM), that's where my guessing ends on this one.
Last edited by steve_v (Today 14:05:41)
Once is happenstance. Twice is coincidence. Three times is enemy action. Four times is Official GNOME Policy.
Online
Hello:
Thanks for the prompt reply.
Much appreciated.
... starting gparted from the menu you should be asked for root credentials.
... indicates at some permission issues.
Yes, I know.
It does not do anything.
ie: start or ask for credentials.
... changed the policy kit?
Hmm ...
Can't say, don't think so.
This is my polkit applications list:
$ apt list | grep installed | grep polkit
--- snip ---
gir1.2-polkit-1.0/oldstable,now 122-3devuan2 amd64 [installed,automatic]
libpolkit-agent-1-0/oldstable,now 122-3devuan2 amd64 [installed]
libpolkit-gobject-1-0/oldstable,oldstable,now 122-3devuan2 all [installed,automatic]
libpolkit-gobject-elogind-1-0/oldstable,now 122-3devuan2 amd64 [installed,automatic]
polkitd/oldstable,now 122-3devuan2 amd64 [installed,automatic]
$$
$ aptitude why polkitd
i gparted Depends policykit-1
i A policykit-1 Depends polkitd (= 122-3devuan2)
$ Apparently gparted has its needed policykit-1.
I just tried doing something with disks which opens up as usual but when I attempt to check a partition in a non-system drive, I get an error pop-up:
Error unmounting filesystem
Not authorised to perform operation (udisks-error-quark, 4)
There are entries in /var/log/auth.log reflecting this ...
--- snip ---
10:45:01 devuan CRON[5190]: pam_unix(cron:session): session opened for user root(uid=0) by (uid=0)
10:45:01 devuan CRON[5191]: pam_unix(cron:session): session opened for user groucho(uid=1000) by (uid=0)
10:45:01 devuan CRON[5190]: pam_unix(cron:session): session closed for user root
10:45:01 devuan CRON[5191]: pam_unix(cron:session): session closed for user groucho... but not for attempting to start gparted from the menu.
From the cmd line I get this:
--- snip ---
10:51:35 devuan su: pam_unix(su-l:auth): authentication failure; logname= uid=1000 euid=0 tty=/dev/pts/2 ruser=groucho rhost= user=ro$
10:51:37 devuan su[5758]: FAILED SU (to root) groucho on pts/2
10:52:04 devuan su[5774]: (to root) groucho on pts/2
10:52:04 devuan su[5774]: pam_unix(su-l:session): session opened for user root(uid=0) by (uid=1000)Maybe (?) all this is happening due to my purging / uninstalling PCManFM and installing Xfe?
Best,
A.
Offline
"su" vs. "su -" problem? https://dev1galaxy.org/viewtopic.php?id=6294
Some pinentry package should be there to ask for your password when you try to start gparted from the menu.
Offline
'gparted' appears (at least on Gentoo, I have no GUI Devuan installs) to be a shell script which ends up calling pkexec --disable-internal-agent '/usr/bin/gparted' if pkexec is available.
See if that command works in a terminal emulator as your normal (non root) user, and what output it produces.
Once is happenstance. Twice is coincidence. Three times is enemy action. Four times is Official GNOME Policy.
Online
Hello:
Here you go. 8^)
Which "cmd line"?
... LXTerminal or Tilix
Check output of 'env'.
$ env | grep -i display
DISPLAY=:0.0
$Regarding gparted not starting from the menu ...
That would be standard XFCE menu.
ie: Applications -> System -> Gparted
OP didn't specify what command this "menu" is launching ...
The command should be whatever XFCE was set to run by default on installation.
Thanks for your input.
Best,
A.
Offline
Hello:
... if that command works in a terminal emulator as your normal (non root) user ...
$ pkexec --disable-internal-agent '/usr/sbin/gparted'
Error executing command as another user: No authentication agent found.
$ Best,
A.
Offline
Hello:
"su" vs. "su -" problem?
Hmm ...
When su - was mandated, I started to use it.
Never used su again.
$ su -
Password:
# ... pinentry package should be there to ask for your password ...
Yes.
That was the usual routine.
Best,
A.
Offline
# gparted (gpartedbin:7345): Gtk-WARNING **: 09:37:51.663: cannot open display: #...
$ env | grep -i display DISPLAY=:0.0 $
You ran the first as root and the second as a user, so environment is obviously going to be different. If you want to know why you got "cannot open display:", test under the same conditions you got "cannot open display:".
The command should be whatever XFCE was set to run by default on installation.
Almost certainly an xdg .desktop file dropped by the gparted package (dpkg -L gparted) and looking in it will tell you which command is being called. This is GNU/Linux, there is no "standard" anything and not everyone runs XFCE.
Ed. Anyhow, this is all irrelevant. Your polkit install doesn't work:
$ pkexec --disable-internal-agent '/usr/sbin/gparted' Error executing command as another user: No authentication agent found. $
Do you have an appropriate (GUI) agent installed (e.g. xfce-polkit)?
Package: polkit-1-auth-agent
State: not a real package
Provided by: cinnamon (6.4.10-2), gnome-flashback (3.56.0-1), gnome-shell (48.7-0+deb13u2), lxpolkit (0.5.6-2), lxqt-policykit (2.1.0-1), mate-polkit (1.26.1-4+b1), phosh
(0.46.0-3), polkit-kde-agent-1 (4:6.3.6-1), ukui-polkit (1.2.2.2-1.1+b1), xfce-polkit (0.3+v20220621-3~excalibur1)Also see fsmithred's comment WRT pinentry above.
Maybe (?) all this is happening due to my purging / uninstalling PCManFM and installing Xfe?
The pcmanfm package recommends lxpolkit or polkit-1-auth-agent, xfe does not. If nothing else you have installed depends on polkit-1-auth-agent, it's possible you (auto)removed it.
Last edited by steve_v (Today 14:57:32)
Once is happenstance. Twice is coincidence. Three times is enemy action. Four times is Official GNOME Policy.
Online
Hello:
... pcmanfm package recommends lxpolkit or polkit-1-auth-agent ...
... it's possible you (auto)removed it.
Indeed ... 8^°
That was it.
lxpolkit was not present so I installed it and set it up as required in Applications -> Settings -> Session and startup.
Now everything works as it should, disks and gparted wise.
Thanks for your input (both you and all those who pitched in).
Much obliged.
Best,
A.
Offline