前言
最近在使用Ubuntu下的Kvm虚拟机时,无法通过spice将USB设备传入虚拟机。
其中出现以下提示:
spice-client-error-quark: Could not redirect USB Device [046d:081b] at 3-2: Error setting USB device node ACL: 'Not authorized' (0)
正文
解决方案:
修改规则文件:/usr/share/polkit-1/actions/org.spice-space.lowlevelusbaccess.policy
添加allow_any项并修改allow_inactive项即可。
<?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.0/policyconfig.dtd">
<policyconfig>
<vendor>The Spice Project</vendor>
<vendor_url>http://spice-space.org/</vendor_url>
<icon_name>spice</icon_name>
<action id="org.spice-space.lowlevelusbaccess">
<description>Low level USB device access</description>
<message>Privileges are required for low level USB device access (for usb device pass through).</message>
<defaults>
<allow_any>yes</allow_any>
<allow_inactive>yes</allow_inactive>
<allow_active>yes</allow_active>
</defaults>
</action>
</policyconfig>