Results 1 to 8 of 8

Thread: 17.10 - Living with GNOME/Wayland: No gksu / pkexec

  1. #1
    Join Date
    Jan 2007
    Beans
    Hidden!
    Distro
    Ubuntu Development Release

    17.10 - Living with GNOME/Wayland: No gksu / pkexec

    I've been using Ubuntu for well over a decade. In recent years, I've mostly had to make just minor tweaks to my system to keep it running exactly as I wanted. I've paid little attention to the development of Aardvark. I've installed 17.10 and faced the prospect of having to spend time adjusting to GNOME. I am pretty happy with the new version, it's just a bit of a learning curve.

    As the beta testers know, running apps as root in Wayland poses some problems. Wayland prefers not to allow unrestricted access by root - preferring access through policies. Graphical apps are slowly adapting to this, but many still aren't allowing pkexec or gksu.

    For me, gedit, geany, bleachbit and gparted initially have not worked with "gksu" or "pkexec"t. From searching online, apparently Version .30 of gparted has fixed the issue (.28 is our 17.10 version).

    The current workaround in Wayland is to run the following command to allow some of the aforementioned apps to be run with gksu:
    if [ $XDG_SESSION_TYPE = "wayland" ]; then xhost +si:localuser:root; fi
    Note: You can simplify the command but the above acknowledges that not everyone will start 17.10 using GNOME.

    So far, as of this morning, gksu will then work with: geany, gparted, gedit, synaptic; pkexec will then work with: gparted but not the others.

    Is there a better way to handle running these apps as root?

    Happy Ubuntu-ing!
    Last edited by drs305; October 19th, 2017 at 01:39 PM.
    New to Wayland.

    Retired.

  2. #2
    Join Date
    Nov 2015
    Beans
    62
    Distro
    Ubuntu 16.04 Xenial Xerus

    Re: 17.10 - Living with GNOME/Wayland: No gksu / pkexec

    What is the simplified command for those starting up with GNOME?

  3. #3
    Join Date
    Jan 2007
    Beans
    Hidden!
    Distro
    Ubuntu Development Release

    Re: 17.10 - Living with GNOME/Wayland: No gksu / pkexec

    xhost +si:localuser:root

    The command in the initial post just checks to see if you are running Wayland. If you aren't, gksu and pkexec will probably still work as previously.
    New to Wayland.

    Retired.

  4. #4
    Join Date
    Oct 2009
    Beans
    Hidden!

    Re: 17.10 - Living with GNOME/Wayland: No gksu / pkexec

    Right-click on the background and select "Open Terminal"
    In Terminal type:
    xhost +si:localuser:root
    and hit enter.
    Now you can use gksu and gksudo for the session.

  5. #5
    Join Date
    Oct 2004
    Location
    33.4N -112.1W
    Beans
    2,250
    Distro
    Ubuntu Budgie

    Re: 17.10 - Living with GNOME/Wayland: No gksu / pkexec

    You could edit the ~.desktop file for any impacted application.

    For example with gparted:

    Code:
    [Desktop Entry]Name=GParted
    GenericName=Partition Editor
    X-GNOME-FullName=GParted Partition Editor
    Comment=Create, reorganize, and delete partitions
    Exec=bash -c 'xhost +SI:localuser:root && sudo gparted'
    Icon=gparted
    Terminal=true
    Type=Application
    Categories=GNOME;System;Filesystem;Settings
    Keywords=Partition;
    StartupNotify=true
    X-Ubuntu-Gettext-Domain=gparted
    /path/to/Truth

  6. #6
    Join Date
    Jan 2007
    Beans
    Hidden!
    Distro
    Ubuntu Development Release

    Re: 17.10 - Living with GNOME/Wayland: No gksu / pkexec

    Code:
    Exec=bash -c 'xhost +SI:localuser:root && sudo gparted'
    Combining the commands within the a .desktop file would eliminate an extra step.
    "gksu" or "gksudo" is preferred over "sudo":
    Code:
    Exec=bash -c 'xhost +SI:localuser:root && gksu gparted'
    Last edited by drs305; October 22nd, 2017 at 01:46 PM.
    New to Wayland.

    Retired.

  7. #7
    Join Date
    Oct 2004
    Location
    33.4N -112.1W
    Beans
    2,250
    Distro
    Ubuntu Budgie

    Re: 17.10 - Living with GNOME/Wayland: No gksu / pkexec

    Quote Originally Posted by drs305 View Post
    Code:
    Exec=bash -c 'xhost +SI:localuser:root && sudo gparted'
    Combining the commands within the a .desktop file would eliminate an extra step.
    "gksu" or "gksudo" is preferred over "sudo":
    Code:
    Exec=bash -c 'xhost +SI:localuser:root && gksu gparted'

    Yes .... but (there's always a but ) with gksu or gksudo you get presented with an dialog box that will not accept a password. It's yet another wayland thing. Argh. Same desktop file works just fine in Budgie DE. The user can type right in the password box and open the gparted application.

    'Course if you're using Budgie you don't need such a trapeze act.
    Last edited by Xian; October 23rd, 2017 at 03:19 AM. Reason: Corrected spelling of command 'gksudo'
    /path/to/Truth

  8. #8
    Join Date
    Jan 2007
    Beans
    Hidden!
    Distro
    Ubuntu Development Release

    Re: 17.10 - Living with GNOME/Wayland: No gksu / pkexec

    In order to solve the "frozen password" box for many of the graphical apps we currently cannot run as root, one workaround - in conjunction with running the xhost command - is to include the apps in the /etc/sudoers file. This bypasses the root password box and the app will open by running the command "gksu xxx" (such as "gksu gedit", "gksu gparted", etc).

    Editing the sudoers file involves adding your username and the commands you want enabled. An online search should give you the specifics of how this is accomplished.
    Editing the sudoers file should be done using the "sudo visudo" command to ensure the edits are properly written and should be accomplished only by those users very comfortable with editing system files.
    New to Wayland.

    Retired.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •