<---- template headericclude ----->
PolicyKit failed over headless VNC
FedoraForum.org - Fedora Support Forums and Community
Results 1 to 3 of 3
  1. #1
    Join Date
    Jan 2018
    Location
    Canada
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    PolicyKit failed over headless VNC

    I have a fresh install of Fedora 27 XFCE inside of a Hyper-V VM. I plan to use this 100% remotely hence the headless VNC. I have installed tigervnc-server and configured it to run on :0, done a "systemctl set-default multi-user.target" and opened up the vnc-service on firewall.

    The problem arrises when connecting over with tightVNC. Upon starting the session I am presented with an error box saying "XFCE PolicyKit Agent" and "GDBus.Error:org.freedesktop.PolicyKit1.Error.Fail ed: Cannot determine user of subject" and I click close to make it go away. Note that I am not asked to log in the desktop for my user is already up.

    But anything that requires elevation privilege does not work now. I don't get errors, just nothing happens when I try to open say gparted or install something with the GUI software manager. Is there additional steps I need to take with VNC config to get the user working correctly with PolicyKit and VNC?

    EDIT:

    I have tried disabling PolicyKit on startup and adding a policy

    Identity=unix-group:wheel (also tried *)
    Action=*
    ResultActive=yes

    and still can't launch anything requiring elevation.

    My xstartup in ~/.vnc/ contains

    Code:
    #!/bin/sh
    
    unset SESSION_MANAGER
    unset DBUS_SESSION_BUS_ADDRESS
    exec /etc/X11/xinit/xinitrc
    I feel like something is not starting up correctly. Or this is some permissions issue with remote vs local...
    Last edited by BunBun; 14th January 2018 at 12:06 AM.

  2. #2
    Join Date
    Jun 2018
    Location
    Germany
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Lightbulb Re: PolicyKit failed over headless VNC

    Same issue with fedora 28 XFCE spin. I observed that this does not happen if I start vncserver from command line or via ssh.

    Somehow the login via ssh does trigger something that prevents this issue. So my hack is to use a service file like this:

    Code:
    [Unit]
    Description=Remote desktop service (VNC)
    After=syslog.target network.target
    
    [Service]
    Type=simple
    WorkingDirectory=/home/someuser
    User=someuser
    Group=someuser
    
    
    ExecStartPre=/bin/sh -c '/usr/bin/ssh -i .ssh/id_rsa_vnchack localhost /usr/bin/vncserver -kill %i > /dev/null 2>&1 || :'
    ExecStart=/bin/sh -c '/usr/bin/ssh -i .ssh/id_rsa_vnchack localhost /usr/bin/vncserver -fg %i'
    ExecStop=/bin/sh -c '/usr/bin/ssh -i .ssh/id_rsa_vnchack localhost /usr/bin/vncserver -kill %i'
    
    [Install]
    WantedBy=multi-user.target
    This requires a passwordless ssh key with the corresponding pub key in your authorized_keys file, and that you did

    Code:
    ssh -i .ssh/id_rsa_vnchack localhost
    once before and accepted your host key.
    Last edited by not0a0user; 20th June 2018 at 05:00 PM.

  3. #3
    Join Date
    Jan 2015
    Location
    Lab, Slovakia
    Posts
    909
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: PolicyKit failed over headless VNC

    I'm just wondering why you want to use VNC. It is mostly a Windows thing. If your client machine runs Linux, then you will have more joy just with plain old SSH and X forwarding.

    Since Ubuntu finally dropped Wayland and reverted to Xorg, SSH now works properly again.
    --
    Have fun!
    http://www.aeronetworks.ca

Similar Threads

  1. get rid of policykit restrictions
    By kerl in forum Using Fedora
    Replies: 6
    Last Post: 9th September 2010, 07:55 AM
  2. F13 PolicyKit
    By dmyersturnbull in forum Using Fedora
    Replies: 6
    Last Post: 31st May 2010, 09:03 PM
  3. PolicyKit problem
    By bgoodwin91006 in forum Using Fedora
    Replies: 0
    Last Post: 11th March 2010, 11:45 PM
  4. PolicyKit and VNC
    By lollysticky in forum Servers & Networking
    Replies: 1
    Last Post: 3rd November 2009, 12:05 AM
  5. PolicyKit help
    By Ashok Harnal in forum Security and Privacy
    Replies: 1
    Last Post: 1st September 2008, 07:27 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
[[template footer(Guest)]]