If you use Vagrant with KVM Libvirt , there is a high chance that you are annoyed by the password prompts for every Vagrant commands e.g. vagrant up/ssh/destroy unless you are running the commands as root.
The issue is that the a typical Linux user does not have access permission to libvirt socket so to access it we need to provide extra permission. Interestingly libvirt uses Policy Kit ( man polkit) to decide access permissions and we can add an explicit rule to polkit to give an user privilege to access libvirt.
To fix the issue you need to create a file in /etc/polkit-1/localauthority/50-local.d as mentioned below.
There are other methods to fix this issue too. You can also create a user group, give the group privilege and add the user to the group.
# cd /etc/polkit-1/localauthority/50-local.d # cat vagrant.pkla [Allow lmohanty libvirt management permissions] Identity=unix-user:<USER_NAME> Action=org.libvirt.unix.manage ResultAny=yes ResultInactive=yes ResultActive=yes
Probably you want to update these lines
[Allow lmohanty libvirt management permissions]
[Allow libvirt management permissions]
[Allow USER_NAME libvirt management permissions]
budhramgurung, done. Thanks for pointing out.
Awesome instructions, Lala. Really helpful.
To the other idiots like me who can’t RTFM: The “yes” entries are case-sensitive. 🙂