I have a Gtkmm desktop app that requires root access. It worked fine on 18.04 using Lxqt-sudo but after upgrading to 20.0.4, it takes ~30 seconds to open only the first time after booting. In addition, it will skip the splash screen that's supposed to show for 3 seconds. However, every subsequent launch will show the splash screen and everything works fine, until the system is rebooted again. Logs for the minute this occurs:
Mar 15 11:38:07 ubuntu-VirtualBox systemd[1053]: Started Application launched by gnome-shell.
Mar 15 11:38:09 ubuntu-VirtualBox dbus-daemon[3152]: [session uid=0 pid=3150] AppArmor D-Bus mediation is enabled
Mar 15 11:38:09 ubuntu-VirtualBox dbus-daemon[3152]: [session uid=0 pid=3150] Activating service name='org.freedesktop.portal.Desktop' requested by ':1.0' (uid=0 pid=3140 comm="/usr/bin/configuration-tool " label="unconfined")
Mar 15 11:38:09 ubuntu-VirtualBox dbus-daemon[3152]: [session uid=0 pid=3150] Activating service name='org.freedesktop.portal.Documents' requested by ':1.1' (uid=0 pid=3155 comm="/usr/libexec/xdg-desktop-portal " label="unconfined")
Mar 15 11:38:09 ubuntu-VirtualBox dbus-daemon[3152]: [session uid=0 pid=3150] Activating service name='org.freedesktop.impl.portal.PermissionStore' requested by ':1.2' (uid=0 pid=3160 comm="/usr/libexec/xdg-document-portal " label="unconfined")
Mar 15 11:38:09 ubuntu-VirtualBox dbus-daemon[3152]: [session uid=0 pid=3150] Successfully activated service 'org.freedesktop.impl.portal.PermissionStore'
Mar 15 11:38:09 ubuntu-VirtualBox dbus-daemon[3152]: [session uid=0 pid=3150] Successfully activated service 'org.freedesktop.portal.Documents'
Mar 15 11:38:10 ubuntu-VirtualBox dbus-daemon[3152]: [session uid=0 pid=3150] Activating service name='org.freedesktop.impl.portal.desktop.gtk' requested by ':1.1' (uid=0 pid=3155 comm="/usr/libexec/xdg-desktop-portal " label="unconfined")
Mar 15 11:38:10 ubuntu-VirtualBox dbus-daemon[3152]: [session uid=0 pid=3150] Activating service name='org.gtk.vfs.Daemon' requested by ':1.4' (uid=0 pid=3174 comm="/usr/libexec/xdg-desktop-portal-gtk " label="unconfined")
Mar 15 11:38:10 ubuntu-VirtualBox dbus-daemon[3152]: [session uid=0 pid=3150] Successfully activated service 'org.gtk.vfs.Daemon'
Mar 15 11:38:10 ubuntu-VirtualBox dbus-daemon[3152]: [session uid=0 pid=3150] Activating service name='ca.desrt.dconf' requested by ':1.4' (uid=0 pid=3174 comm="/usr/libexec/xdg-desktop-portal-gtk " label="unconfined")
Mar 15 11:38:10 ubuntu-VirtualBox dbus-daemon[3152]: [session uid=0 pid=3150] Successfully activated service 'org.freedesktop.impl.portal.desktop.gtk'
Mar 15 11:38:10 ubuntu-VirtualBox dbus-daemon[3152]: [session uid=0 pid=3150] Activating service name='org.freedesktop.FileManager1' requested by ':1.1' (uid=0 pid=3155 comm="/usr/libexec/xdg-desktop-portal " label="unconfined")
Mar 15 11:38:10 ubuntu-VirtualBox dbus-daemon[3152]: [session uid=0 pid=3150] Successfully activated service 'ca.desrt.dconf'
Mar 15 11:38:35 ubuntu-VirtualBox dbus-daemon[3152]: [session uid=0 pid=3150] Activating service name='org.freedesktop.secrets' requested by ':1.1' (uid=0 pid=3155 comm="/usr/libexec/xdg-desktop-portal " label="unconfined")
Mar 15 11:38:35 ubuntu-VirtualBox org.freedesktop.secrets[3218]: GNOME_KEYRING_CONTROL=/root/.cache/keyring-88PV11
Mar 15 11:38:35 ubuntu-VirtualBox dbus-daemon[3152]: [session uid=0 pid=3150] Successfully activated service 'org.freedesktop.secrets'
Mar 15 11:38:35 ubuntu-VirtualBox dbus-daemon[3152]: [session uid=0 pid=3150] Successfully activated service 'org.freedesktop.portal.Desktop'
Mar 15 11:38:35 ubuntu-VirtualBox dbus-daemon[3152]: [session uid=0 pid=3150] Successfully activated service 'org.freedesktop.FileManager1'
Mar 15 11:38:35 ubuntu-VirtualBox nautilus[3201]: Unable to get contents of the bookmarks file: Error opening file /root/.gtk-bookmarks: No such file or directory
Mar 15 11:39:05 ubuntu-VirtualBox xdg-desktop-por[3155]: Failed to get application states: GDBus.Error:org.freedesktop.portal.Error.Failed: Could not get window list
What I've tried:
Simply modifying the Desktop file as shown below (see 'Exec' value) seemed to solve this for most users here, but no luck. I am now using pkexec instead of lqxt-sudo, since this seems to be the recommended approach.
[Desktop Entry]
Encoding=UTF-8
Version=1.8.3
Name=Configuration Tool
Exec=sh -c "pkexec --disable-internal-agent env DISPLAY=$DISPLAY XAUTHORITY=$XAUTHORITY /usr/bin/configuration-tool"
Icon=/usr/share/icons/configuration-tool/icon_v2.png
Terminal=false
Type=Application
Categories=GNOME;GTK;
I've also tried building a policykit action as some posts suggested, but even when I give the program full access, there is still a delay on first launch:
<?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>
<action id="org.freedesktop.policykit.pkexec.run-configuration-tool">
<description>Run configuration-tool</description>
<message>Authentication is required to run configuration-tool</message>
<defaults>
<allow_any>yes</allow_any>
<allow_inactive>yes</allow_inactive>
<allow_active>yes</allow_active>
</defaults>
<annotate key="org.freedesktop.policykit.exec.path">/usr/bin/configuration-tool</annotate>
<annotate key="org.freedesktop.policykit.exec.allow_gui">TRUE</annotate>
</action>
</policyconfig>