Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

Running Dolphin from pkexec in Buster XFCE

Graphical Environments, Managers, Multimedia & Desktop questions.
Post Reply
Message
Author
User avatar
NFT5
df -h | grep > 20TiB
df -h | grep > 20TiB
Posts: 598
Joined: 2014-10-10 11:38
Location: Canberra, Australia
Has thanked: 10 times
Been thanked: 43 times

Running Dolphin from pkexec in Buster XFCE

#1 Post by NFT5 »

I've been testing Buster and , so far, have found it exceptional - way better than Jessie or Stretch at the same point of development.

I've always used MATE but changed to XFCE because of continual panel crashes in Stretch, and not fixed in Buster. XFCE in Buster works just fine however I do have one problem.

I've always used Dolphin as my preferred file manager. With both MATE and XFCE in Jessie and Stretch I was able to run Dolphin as root using GKSU. This is no longer possible in Buster so I've been investigating using pkexec.

I know the oft quoted argument that GUIs should not be run as root but for simple operations I find it much faster and more convenient than the CLI, which I do use when necessary.

Some Google searching and a visit to the man pages resulted in the following, saved as /usr/share/polkit-1/actions/org.xfce.dolphin.policy

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE policyconfig PUBLIC
 "-//freedesktop//DTD PolicyKit Policy Configuration 1.0//EN"
 "http://www.freedesktop.org/standards/PolicyKit/1/policyconfig.dtd">
<policyconfig>

  

 <vendor>Dolphin</vendor>
 <vendor_url>http://xfce.org/</vendor_url>
 <icon_name>system-file-manager</icon_name>


 <action id="org.xfce.dolphin">
 
 <description>Run Dolphin as root</description>

 <message>Authentication is required to run Dolphin as root.</message>

 <defaults>
 <allow_any>no</allow_any>
 <allow_inactive>auth_admin</allow_inactive>
 <allow_active>auth_admin</allow_active>
 </defaults>
 <annotate key="org.freedesktop.policykit.exec.path">/usr/bin/dolphin</annotate>
 <annotate key="org.freedesktop.policykit.exec.allow_gui">true</annotate>
 </action>

</policyconfig>
This allows Dolphin to start, using the command "pkexec dolphin", but there are no icons and I'm getting multiple errors like:

Code: Select all

QPixmap::scaled: Pixmap is a null pixmap
QPainter::begin: Paint device returned engine == 0, type: 2
QPainter::setOpacity: Painter not active
QPainter::begin: Paint device returned engine == 0, type: 2
QPainter::setOpacity: Painter not active
QPainter::begin: Paint device returned engine == 0, type: 2
QPainter::setCompositionMode: Painter not active
.

The problem is not unknown. There is mention of it at:
https://forums.gentoo.org/viewtopic-t-1 ... lasma.html
and also at:
https://forums.gentoo.org/viewtopic-t-1048308.html
as well as
https://bugs.kde.org/show_bug.cgi?id=344149
and
https://bbs.archlinux.org/viewtopic.php ... 9#p1501729

The problem, of course, is that Gentoo is not Debian and I don't seem to have the configuration files that are mentioned in those links.

I'm kind of at a loss to know where to proceed from here. It's altogether possible I've missed something so any help on that or a fix would be appreciated.

User avatar
Head_on_a_Stick
Posts: 14114
Joined: 2014-06-01 17:46
Location: London, England
Has thanked: 81 times
Been thanked: 133 times

Re: Running Dolphin from pkexec in Buster XFCE

#2 Post by Head_on_a_Stick »

AFAIUI pkexec requires that the program offer a means of performing actions as root without running the GUI itself with elevated privileges, looks like Dolphin doesn't do this.
NFT5 wrote:where to proceed from here
Use the terminal for system file manipulation, running GUI file managers as root is a silly idea.

Have you tried mc or ranger? They can be run as root from a terminal (or console).
deadbang

peer
Posts: 451
Joined: 2017-03-26 10:14
Has thanked: 9 times
Been thanked: 22 times

Re: Running Dolphin from pkexec in Buster XFCE

#3 Post by peer »

I use tux commander (tuxcmd) when I want a gui file manager as root.

User avatar
NFT5
df -h | grep > 20TiB
df -h | grep > 20TiB
Posts: 598
Joined: 2014-10-10 11:38
Location: Canberra, Australia
Has thanked: 10 times
Been thanked: 43 times

Re: Running Dolphin from pkexec in Buster XFCE

#4 Post by NFT5 »

Head_on_a_Stick wrote:AFAIUI pkexec requires that the program offer a means of performing actions as root without running the GUI itself with elevated privileges, looks like Dolphin doesn't do this.
Apparently so in earlier versions, however I've seen mention that from 18.x that has been fixed. It would seem so given that it starts and runs just fine....but without icons (hence the zillions of errors).

What I'm looking for is a solution that will enable the icons.
Head_on_a_Stick wrote:Use the terminal for system file manipulation, running GUI file managers as root is a silly idea.
I knew I'd get that comment and, in a multi user environment, I'd agree completely. This machine is my desktop and no-one else uses it. I could log in as root but that would be silly....and risky, apart from the inconvenience and time involved. I'm happy to have to use my password to access the privileges since that reminds me to be careful. There are lots of minor maintenance tasks that need elevated privileges but don't involve high risk. What brought this to a head was just trying to copy a couple of image files to use on my desktop. Editing config files and similar tasks I always use nano from the CLI, but, at the end of the day, what's the difference between editing in nano or mousepad - same text, same process involved. Anyway, we can argue this at another time and place. For now I'm just looking for a solution to the missing icons issue.

@peer. Thanks, good suggestion. I can use PCManFM as well and even Thunar has the option to run as root - just no dual panes. Even Nemo can be brought in without the whole Cinnamon desktop and it, like Caja, is capable of most things. The difference with Dolphin is that from a single application I can access other computers on the LAN, other drives and even my phone. PCManFM is probably the next most capable but drives me nuts having to open the second pane and not showing expandable folders in the panes.

User avatar
GarryRicketson
Posts: 5644
Joined: 2015-01-20 22:16
Location: Durango, Mexico

Re: Running Dolphin from pkexec in Buster XFCE

#5 Post by GarryRicketson »

I could log in as root but that would be silly....and risky, apart from the inconvenience and time involved.
How much time does it take to just open a terminal, type 'su -' ,and your password ? Me, since I all ways have at least 1 terminal open, no time involved there, and let me see here:

Code: Select all

garry% su
Password:
garry# 
Used a stop watch, 1.7 seconds, yea, your right, that is silly, and to time consuming,...in the mean time I am still waiting for a GUI to load. :mrgreen:
Last edited by GarryRicketson on 2019-06-17 00:08, edited 1 time in total.

vbrummond
Posts: 4432
Joined: 2010-03-02 01:42

Re: Running Dolphin from pkexec in Buster XFCE

#6 Post by vbrummond »

Just to supply a bit of general advice..

I recently made a non-admin account on my operating system. A lot of programs I’m trying to run require root access to get them to work properly. It made me realize that it is probably the wrong thing to do and I should find alternative programs.
Always on Debian Testing

User avatar
stevepusser
Posts: 12930
Joined: 2009-10-06 05:53
Has thanked: 41 times
Been thanked: 72 times

Re: Running Dolphin from pkexec in Buster XFCE

#7 Post by stevepusser »

Kde-servicemenu-rootactions modified to run dolphin as root using pkexec: http://mxrepo.com/mx/repo/pool/main/k/k ... otactions/
MX Linux packager and developer

User avatar
NFT5
df -h | grep > 20TiB
df -h | grep > 20TiB
Posts: 598
Joined: 2014-10-10 11:38
Location: Canberra, Australia
Has thanked: 10 times
Been thanked: 43 times

Re: Running Dolphin from pkexec in Buster XFCE

#8 Post by NFT5 »

Oh you got me all excited there, Steve. I thought "MX to the rescue again".

Downloaded the .deb and fired up GDebi. 95 dependencies! 95!!!! Oh well, it is still Testing, so push the button and install.

Dolphin starts with pkexec and reports........ same errors and still no icons. :(

It does show previews though. :D

Back to Google, methinks.

User avatar
NFT5
df -h | grep > 20TiB
df -h | grep > 20TiB
Posts: 598
Joined: 2014-10-10 11:38
Location: Canberra, Australia
Has thanked: 10 times
Been thanked: 43 times

Re: Running Dolphin from pkexec in Buster XFCE

#9 Post by NFT5 »

vbrummond wrote:A lot of programs I’m trying to run require root access to get them to work properly. It made me realize that it is probably the wrong thing to do and I should find alternative programs.
The thing is that Dolphin is a file manager and from time to time one has to access files that are outside of /home and this requires sudo or root. There is no alternative that doesn't need some kind of elevated privileges. I can run PCManFM which is similar, kind of, to Dolphin - just that I'm more comfortable with Dolphin. For PCManFM I just have to work out how to start it with dual panes........but that is the subject for another thread.
GarryRicketson wrote:in the mean time I am still waiting for a GUI to load. :mrgreen:
We're not all running XTs, mate.

peer
Posts: 451
Joined: 2017-03-26 10:14
Has thanked: 9 times
Been thanked: 22 times

Re: Running Dolphin from pkexec in Buster XFCE

#10 Post by peer »

tuxcmd is dual pane

User avatar
stevepusser
Posts: 12930
Joined: 2009-10-06 05:53
Has thanked: 41 times
Been thanked: 72 times

Re: Running Dolphin from pkexec in Buster XFCE

#11 Post by stevepusser »

NFT5 wrote:Oh you got me all excited there, Steve. I thought "MX to the rescue again".

Downloaded the .deb and fired up GDebi. 95 dependencies! 95!!!! Oh well, it is still Testing, so push the button and install.

Dolphin starts with pkexec and reports........ same errors and still no icons. :(

It does show previews though. :D

Back to Google, methinks.
Well, MX 19 is going to be based on Buster, and I also like to use Dolphin, so I'm going to want to fix that issue,too.

Edit: whoops, I linked to the older version without pkexec. Try this one instead: http://mxrepo.com/mx/repo/pool/main/r/r ... rvicemenu/
MX Linux packager and developer

User avatar
sunrat
Administrator
Administrator
Posts: 6498
Joined: 2006-08-29 09:12
Location: Melbourne, Australia
Has thanked: 118 times
Been thanked: 476 times

Re: Running Dolphin from pkexec in Buster XFCE

#12 Post by sunrat »

stevepusser wrote:Edit: whoops, I linked to the older version without pkexec. Try this one instead: http://mxrepo.com/mx/repo/pool/main/r/r ... rvicemenu/
Wow, that even works in siduction! Icons and everything. You're a magician, Stevo. 8)

I tried yesterday after reading this thread and got Dolphin to open as root by exporting DISPLAY env and xhost+, but no icons. That's a really insecure way to do it anyway so was just an exercise.
“ computer users can be divided into 2 categories:
Those who have lost data
...and those who have not lost data YET ”
Remember to BACKUP!

User avatar
stevepusser
Posts: 12930
Joined: 2009-10-06 05:53
Has thanked: 41 times
Been thanked: 72 times

Re: Running Dolphin from pkexec in Buster XFCE

#13 Post by stevepusser »

Actually, it's a problem also with the Stretch version, so I ended up finding and porting over the pkexec version from this netrunner-OS PPA back then: https://launchpad.net/~netrunner-os/+ar ... 5&start=75
MX Linux packager and developer

Post Reply