非root用户使用virt-manager关闭root认证

参考:https://ask.fedoraproject.org/en/question/45805/how-to-use-virt-manager-as-a-non-root-user/

从Fedora20开始,virt-manager实现了PlocyKit,所以普通用户使用virt-manager需要root权限验证。
如果想让某个组的用户使用virt-manager免去root权限验证,可以新增一个polkit规则。

polkit.addRule(function(action, subject) {
  if (action.id == "org.libvirt.unix.manage" && subject.local && subject.active && subject.isInGroup("wheel")) {
      return polkit.Result.YES;
  }
});

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.