CentOS8 KVM USB设备直通虚拟机并实现热插拨

目录

实现直通

查看USB相关信息:

查看USB的树状信息:

新建一个xml文件:

修改对应虚拟机的xml配置文件:

执行设备追加:

支持热插拨

新增udev规则文件:

常用命令备忘

查看硬件详细信息:

查看USB设备描述:


实现直通

查看USB相关信息:

# lsusb
Bus 002 Device 003: ID 058f:6387 Alcor Micro Corp. Flash Drive
Bus 002 Device 002: ID 8087:8002 Intel Corp. 
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 005: ID 413c:a001 Dell Computer Corp. Hub
Bus 001 Device 004: ID 17ef:602d Lenovo 
Bus 001 Device 003: ID 17ef:602e Lenovo 
Bus 001 Device 002: ID 8087:800a Intel Corp. 
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

 

查看USB的树状信息:

# lsusb -t
/:  Bus 02.Port 1: Dev 1, Class=root_hub, Driver=ehci-pci/2p, 480M
    |__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/8p, 480M
        |__ Port 2: Dev 3, If 0, Class=Mass Storage, Driver=usbfs, 480M
/:  Bus 01.Port 1: Dev 1, Class=root_hub, Driver=ehci-pci/2p, 480M
    |__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/6p, 480M
        |__ Port 1: Dev 3, If 0, Class=Human Interface Device, Driver=usbhid, 1.5M
        |__ Port 5: Dev 4, If 0, Class=Human Interface Device, Driver=usbhid, 1.5M
        |__ Port 5: Dev 4, If 1, Class=Human Interface Device, Driver=usbhid, 1.5M
        |__ Port 6: Dev 5, If 0, Class=Hub, Driver=hub/6p, 480M

 

根据上面的信息,可以获取到将要直通的USB设备的如下相关信息:

Vendor id : 058f
Product id :6387

Driver :ehci

 

新建一个xml文件:

# vim /etc/libvirt/W10_usb.xml

 

写入如下内容:

<hostdev mode='subsystem' type='usb' managed='yes'>
    <source>
        <vendor id='0x058
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值