AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / server / 问题 / 1073182
Accepted
Romain Deterre
Romain Deterre
Asked: 2021-08-01 12:05:04 +0800 CST2021-08-01 12:05:04 +0800 CST 2021-08-01 12:05:04 +0800 CST

使用 virt-manager 将 USB 设备重定向到虚拟机不起作用

  • 772

我有一个运行 Ubuntu 16.04 虚拟机(KVM 管理程序)的 Fedora 工作站。我想将 USB 设备重定向到 VM,但是从 virt-manager 中选择“虚拟机 | 重定向 USB 设备”时,出现以下错误:

spice-client-error-quark: Could not redirect <USB device name> at 1-4:
Error setting USB device node ACL: 'Not authorized' (0)

错误窗口有一个“详细信息”部分,仅显示“USB 重定向错误”。

到目前为止,这是我尝试过的,但没有成功:

  1. 按照这里的建议,我创建了一个包含以下内容的 /etc/udev/rules.d/50-spice.rules 文件,然后创建了一个`spice`组并将我的用户添加到该组

    SUBSYSTEM=="usb", GROUP="spice", MODE="0660"
    SUBSYSTEM=="usb_device", GROUP="spice", MODE="0660"
    
  2. 将 spice-gtk 从最新版本的 Fedora 33 (0.39-1) 降级到 0.38-3。

  3. 禁用 selinux

  4. sudo chmod 4755 /usr/libexec/spice-gtk-x86_64/spice-client-glib-usb-acl-helper

  5. 升级到带有 spice-gtk 0.39-2 的 Fedora 34

kvm-virtualization usb libvirt
  • 2 2 个回答
  • 3532 Views

2 个回答

  • Voted
  1. Best Answer
    Romain Deterre
    2021-08-02T08:00:30+08:002021-08-02T08:00:30+08:00

    我的解决方案是创建 /etc/udev/rules.d/50-spice.rules 文件,然后在 /usr/share/polkit-1/actions/org.spice-space.lowlevelusbaccess<allow_any>yes</allow_any>的部分下添加。<defaults>政策。修改后,文件在我的机器上是这样的:

    <?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>no</allow_inactive>
          <allow_active>yes</allow_active>
        </defaults>
      </action>
    
    </policyconfig>
    
    • 2
  2. simon
    2022-01-08T10:13:30+08:002022-01-08T10:13:30+08:00

    更正确的应该是:(取决于linux发行版):

    文件:/etc/polkit-default-privs/local 或 /etc/polkit-default-privs.local

    将行添加到文件中(或生成文件/目录):org.spice-space.lowlevelusbaccess yes:no:yes

    运行后:/sbin/set_polkit_default_privs

    如果 opensuse 则另外:

    在文件 /etc/permissions.local 中添加以下行: /usr/bin/spice-client-glib-usb-acl-helper root:root 4755 运行后: chkstat --system --set

    西蒙

    • 1

相关问题

  • Xen 与 KVM 的性能对比

  • 什么是bridge_fd?

  • 如何在 kvm-linux 中登录除 ssh、vnc 之外的控制台

  • Linux 内核虚拟机

  • Vista 上的 VNC

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    新安装后 postgres 的默认超级用户用户名/密码是什么?

    • 5 个回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve