나는 가지고있다이 콘솔QEMU에서 실행되는 Win11에 USB로 전달하려고합니다. USB 장치로 "리디렉션"되는 것이 마음에 들지 않았기 때문에 이에 대한 UDEV 규칙을 작성했습니다. b/c 나는 그것을 가지고 있지 않았고 물론 권한도 없었습니다.
규칙:
$udevadm info --attribute-walk --path=$(udevadm info --query=path --name=/dev/ttyACM0)
Udevadm info starts with the device specified by the devpath and then
walks up the chain of parent devices. It prints for every device
found, all possible attributes in the udev rules key format.
A rule to match, can be composed by the attributes of the device
and the attributes from one single parent device.
looking at device '/devices/pci0000:00/0000:00:08.1/0000:c3:00.3/usb1/1-1/1-1>
KERNEL=="ttyACM0"
SUBSYSTEM=="tty"
DRIVER==""
ATTR{power/control}=="auto"
ATTR{power/runtime_active_time}=="0"
ATTR{power/runtime_status}=="unsupported"
ATTR{power/runtime_suspended_time}=="0"
looking at parent device '/devices/pci0000:00/0000:00:08.1/0000:c3:00.3/usb1/>
KERNELS=="1-1:1.0"
SUBSYSTEMS=="usb"
DRIVERS=="cdc_acm"
ATTRS{authorized}=="1"
ATTRS{bAlternateSetting}==" 0"
ATTRS{bInterfaceClass}=="02"
ATTRS{bInterfaceNumber}=="00"
ATTRS{bInterfaceProtocol}=="00"
ATTRS{bInterfaceSubClass}=="02"
ATTRS{bNumEndpoints}=="01"
ATTRS{bmCapabilities}=="6"
ATTRS{iad_bFirstInterface}=="00"
ATTRS{iad_bFunctionClass}=="02"
ATTRS{iad_bFunctionProtocol}=="01"
ATTRS{iad_bFunctionSubClass}=="02"
ATTRS{iad_bInterfaceCount}=="02"
ATTRS{physical_location/dock}=="no"
ATTRS{physical_location/horizontal_position}=="left"
ATTRS{physical_location/lid}=="no"
ATTRS{physical_location/panel}=="top"
ATTRS{physical_location/vertical_position}=="upper"
ATTRS{supports_autosuspend}=="1"
looking at parent device '/devices/pci0000:00/0000:00:08.1/0000:c3:00.3/usb1/>
KERNELS=="1-1"
SUBSYSTEMS=="usb"
DRIVERS=="usb"
ATTRS{authorized}=="1"
ATTRS{avoid_reset_quirk}=="0"
ATTRS{bConfigurationValue}=="1"
ATTRS{bDeviceClass}=="ef"
ATTRS{bDeviceProtocol}=="01"
ATTRS{bDeviceSubClass}=="02"
ATTRS{bMaxPacketSize0}=="64"
ATTRS{bMaxPower}=="500mA"
ATTRS{bNumConfigurations}=="1"
ATTRS{bNumInterfaces}==" 4"
ATTRS{bcdDevice}=="0100"
ATTRS{bmAttributes}=="a0"
ATTRS{busnum}=="1"
ATTRS{configuration}==""
ATTRS{devnum}=="7"
ATTRS{devpath}=="1"
ATTRS{idProduct}=="0002"
ATTRS{idVendor}=="2ec2"
ATTRS{ltm_capable}=="no"
ATTRS{manufacturer}=="Loupedeck"
ATTRS{maxchild}=="0"
ATTRS{physical_location/dock}=="no"
ATTRS{physical_location/horizontal_position}=="left"
ATTRS{physical_location/lid}=="no"
ATTRS{physical_location/panel}=="top"
ATTRS{physical_location/vertical_position}=="upper"
ATTRS{power/active_duration}=="460164"
ATTRS{power/autosuspend}=="2"
ATTRS{power/autosuspend_delay_ms}=="2000"
ATTRS{power/connected_duration}=="460164"
ATTRS{power/control}=="on"
ATTRS{power/level}=="on"
ATTRS{power/persist}=="1"
ATTRS{power/runtime_active_time}=="459880"
ATTRS{power/runtime_status}=="active"
ATTRS{power/runtime_suspended_time}=="0"
ATTRS{power/wakeup}=="disabled"
ATTRS{power/wakeup_abort_count}==""
ATTRS{power/wakeup_active}==""
ATTRS{power/wakeup_active_count}==""
ATTRS{power/wakeup_count}==""
ATTRS{power/wakeup_expire_count}==""
ATTRS{power/wakeup_last_time_ms}==""
ATTRS{power/wakeup_max_time_ms}==""
ATTRS{power/wakeup_total_time_ms}==""
ATTRS{product}=="Loupedeck+"
ATTRS{quirks}=="0x0"
ATTRS{removable}=="removable"
ATTRS{remove}=="(not readable)"
ATTRS{rx_lanes}=="1"
ATTRS{speed}=="12"
ATTRS{tx_lanes}=="1"
ATTRS{urbnum}=="15"
ATTRS{version}==" 2.00"
looking at parent device '/devices/pci0000:00/0000:00:08.1/0000:c3:00.3/usb1':
KERNELS=="usb1"
SUBSYSTEMS=="usb"
DRIVERS=="usb"
ATTRS{authorized}=="1"
ATTRS{authorized_default}=="1"
ATTRS{avoid_reset_quirk}=="0"
ATTRS{bConfigurationValue}=="1"
ATTRS{bDeviceClass}=="09"
ATTRS{bDeviceProtocol}=="01"
ATTRS{bDeviceSubClass}=="00"
ATTRS{bMaxPacketSize0}=="64"
ATTRS{bMaxPower}=="0mA"
ATTRS{bNumConfigurations}=="1"
ATTRS{bNumInterfaces}==" 1"
ATTRS{bcdDevice}=="0605"
ATTRS{bmAttributes}=="e0"
ATTRS{busnum}=="1"
ATTRS{configuration}==""
ATTRS{devnum}=="1"
ATTRS{devpath}=="0"
ATTRS{idProduct}=="0002"
ATTRS{idVendor}=="1d6b"
ATTRS{interface_authorized_default}=="1"
ATTRS{ltm_capable}=="no"
ATTRS{manufacturer}=="Linux 6.5.13-4-MANJARO xhci-hcd"
ATTRS{maxchild}=="5"
ATTRS{power/active_duration}=="988097"
ATTRS{power/autosuspend}=="0"
ATTRS{power/autosuspend_delay_ms}=="0"
ATTRS{power/connected_duration}=="4021177"
ATTRS{power/control}=="auto"
ATTRS{power/level}=="auto"
ATTRS{power/runtime_active_time}=="988083"
ATTRS{power/runtime_status}=="active"
ATTRS{power/runtime_suspended_time}=="3033090"
ATTRS{power/wakeup}=="disabled"
ATTRS{power/wakeup_abort_count}==""
ATTRS{power/wakeup_active}==""
ATTRS{power/wakeup_active_count}==""
ATTRS{power/wakeup_count}==""
ATTRS{power/wakeup_expire_count}==""
ATTRS{power/wakeup_last_time_ms}==""
ATTRS{power/wakeup_max_time_ms}==""
ATTRS{power/wakeup_total_time_ms}==""
ATTRS{product}=="xHCI Host Controller"
ATTRS{quirks}=="0x0"
ATTRS{removable}=="unknown"
ATTRS{remove}=="(not readable)"
ATTRS{rx_lanes}=="1"
ATTRS{serial}=="0000:c3:00.3"
ATTRS{speed}=="480"
ATTRS{tx_lanes}=="1"
ATTRS{urbnum}=="209"
ATTRS{version}==" 2.00"
looking at parent device '/devices/pci0000:00/0000:00:08.1/0000:c3:00.3':
KERNELS=="0000:c3:00.3"
SUBSYSTEMS=="pci"
DRIVERS=="xhci_hcd"
ATTRS{ari_enabled}=="0"
ATTRS{broken_parity_status}=="0"
ATTRS{class}=="0x0c0330"
ATTRS{consistent_dma_mask_bits}=="64"
ATTRS{current_link_speed}=="16.0 GT/s PCIe"
ATTRS{current_link_width}=="16"
ATTRS{d3cold_allowed}=="1"
ATTRS{device}=="0x15b9"
ATTRS{dma_mask_bits}=="64"
ATTRS{driver_override}=="(null)"
ATTRS{enable}=="1"
ATTRS{irq}=="43"
ATTRS{local_cpulist}=="0-15"
ATTRS{local_cpus}=="ffff"
ATTRS{max_link_speed}=="16.0 GT/s PCIe"
ATTRS{max_link_width}=="16"
ATTRS{msi_bus}=="1"
ATTRS{msi_irqs/43}=="msi"
ATTRS{numa_node}=="-1"
ATTRS{power/control}=="on"
ATTRS{power/runtime_active_time}=="4005320"
ATTRS{power/runtime_status}=="active"
ATTRS{power/runtime_suspended_time}=="16486"
ATTRS{power/wakeup}=="enabled"
ATTRS{power/wakeup_abort_count}=="0"
ATTRS{power/wakeup_active}=="0"
ATTRS{power/wakeup_active_count}=="1"
ATTRS{power/wakeup_count}=="0"
ATTRS{power/wakeup_expire_count}=="1"
ATTRS{power/wakeup_last_time_ms}=="39380"
ATTRS{power/wakeup_max_time_ms}=="105"
ATTRS{power/wakeup_total_time_ms}=="105"
ATTRS{power_state}=="D0"
ATTRS{remove}=="(not readable)"
ATTRS{rescan}=="(not readable)"
ATTRS{reset}=="(not readable)"
ATTRS{reset_method}=="pm"
ATTRS{resource0}=="(not readable)"
ATTRS{revision}=="0x00"
ATTRS{subsystem_device}=="0x8b75"
ATTRS{subsystem_vendor}=="0x103c"
ATTRS{vendor}=="0x1022"
looking at parent device '/devices/pci0000:00/0000:00:08.1':
KERNELS=="0000:00:08.1"
SUBSYSTEMS=="pci"
DRIVERS=="pcieport"
ATTRS{ari_enabled}=="0"
ATTRS{broken_parity_status}=="0"
ATTRS{class}=="0x060400"
ATTRS{consistent_dma_mask_bits}=="32"
ATTRS{current_link_speed}=="16.0 GT/s PCIe"
ATTRS{current_link_width}=="16"
ATTRS{d3cold_allowed}=="1"
ATTRS{device}=="0x14eb"
ATTRS{dma_mask_bits}=="32"
ATTRS{driver_override}=="(null)"
ATTRS{enable}=="2"
ATTRS{irq}=="36"
ATTRS{local_cpulist}=="0-15"
ATTRS{local_cpus}=="ffff"
ATTRS{max_link_speed}=="16.0 GT/s PCIe"
ATTRS{max_link_width}=="16"
ATTRS{msi_bus}=="1"
ATTRS{msi_irqs/36}=="msi"
ATTRS{numa_node}=="-1"
ATTRS{power/autosuspend_delay_ms}=="100"
ATTRS{power/control}=="on"
ATTRS{power/runtime_active_time}=="4021811"
ATTRS{power/runtime_status}=="active"
ATTRS{power/runtime_suspended_time}=="0"
ATTRS{power/wakeup}=="disabled"
ATTRS{power/wakeup_abort_count}==""
ATTRS{power/wakeup_active}==""
ATTRS{power/wakeup_active_count}==""
ATTRS{power/wakeup_count}==""
ATTRS{power/wakeup_expire_count}==""
ATTRS{power/wakeup_last_time_ms}==""
ATTRS{power/wakeup_max_time_ms}==""
ATTRS{power/wakeup_total_time_ms}==""
ATTRS{power_state}=="D0"
ATTRS{remove}=="(not readable)"
ATTRS{rescan}=="(not readable)"
ATTRS{reset}=="(not readable)"
ATTRS{reset_method}=="pm"
ATTRS{revision}=="0x00"
ATTRS{secondary_bus_number}=="195"
ATTRS{subordinate_bus_number}=="195"
ATTRS{subsystem_device}=="0x14eb"
ATTRS{subsystem_vendor}=="0x1022"
ATTRS{vendor}=="0x1022"
looking at parent device '/devices/pci0000:00':
KERNELS=="pci0000:00"
SUBSYSTEMS==""
DRIVERS==""
ATTRS{power/control}=="auto"
ATTRS{power/runtime_active_time}=="0"
ATTRS{power/runtime_status}=="unsupported"
ATTRS{power/runtime_suspended_time}=="0"
ATTRS{waiting_for_supplier}=="0"
위의 규칙에 따라 추가된 이 USB를 호스트 장치로 사용하여 다음 구성으로 VM을 실행할 수 있습니다.
<hostdev mode="subsystem" type="usb" managed="yes">
<source>
<vendor id="0x2ec2"/>
<product id="0x0002"/>
</source>
<address type="usb" bus="0" port="1"/>
</hostdev>
주소가 의 주소와 일치합니다 lsblk
.
ls
올바른 장치를 가리키면 올바른 권한이 있습니다(상위 장치).
ll /dev/loupeLoupe
0 lrwxrwxrwx 1 root root 15 dec 17 23:40 /dev/loupeLoupe -> bus/usb/001/007
udev 테스트 내용:
DEVPATH=/devices/pci0000:00/0000:00:08.1/0000:c3:00.3/usb1/1-1/1-1:1.0/tty/ttyACM0
DEVNAME=/dev/ttyACM0
MAJOR=166
MINOR=0
ACTION=add
SUBSYSTEM=tty
TAGS=:systemd:
ID_BUS=usb
ID_MODEL=Loupedeck+
ID_MODEL_ENC=Loupedeck+
ID_MODEL_ID=0002
ID_SERIAL=Loupedeck_Loupedeck+
ID_VENDOR=Loupedeck
ID_VENDOR_ENC=Loupedeck
ID_VENDOR_ID=2ec2
ID_REVISION=0100
ID_TYPE=generic
ID_USB_MODEL=Loupedeck+
ID_USB_MODEL_ENC=Loupedeck+
ID_USB_MODEL_ID=0002
ID_USB_SERIAL=Loupedeck_Loupedeck+
ID_USB_VENDOR=Loupedeck
ID_USB_VENDOR_ENC=Loupedeck
ID_USB_VENDOR_ID=2ec2
ID_USB_REVISION=0100
ID_USB_TYPE=generic
ID_USB_INTERFACES=:020200:0a0000:010100:010300:
ID_USB_INTERFACE_NUM=00
ID_USB_DRIVER=cdc_acm
ID_USB_CLASS_FROM_DATABASE=Miscellaneous Device
ID_USB_PROTOCOL_FROM_DATABASE=Interface Association
ID_PATH_WITH_USB_REVISION=pci-0000:c3:00.3-usbv2-0:1:1.0
ID_PATH=pci-0000:c3:00.3-usb-0:1:1.0
ID_PATH_TAG=pci-0000_c3_00_3-usb-0_1_1_0
DEVLINKS=/dev/serial/by-path/pci-0000:c3:00.3-usb-0:1:1.0 /dev/serial/by-path/pci-0000:c3:00.3-usbv2-0:1:1.0 /dev/serial/by-id/usb-Loupedeck_Loupedeck+-if00
ID_MM_CANDIDATE=1
CURRENT_TAGS=:systemd:
USEC_INITIALIZED=3562461516
Unload kernel module index.
Unloaded link configuration context.
가상 머신이 시작되지만 Loupedeck 장치가 시스템에 언급되지 않습니다. 전혀 찾을 수 없었습니다.
내 단계를 확인하기 위해 USB 펜 드라이브에 대해 매우 유사한 UDEV 규칙을 만들고 이를 성공적인 호스트 장치로 설치했습니다.
그래서 내 질문은: win11 VM에서 이 장치를 사용하기 위해 뭔가 빠진 것이 있습니까? 내가 뭐 잘못 했어요? 창문에서 볼 수 있게 하려면 어떻게 해야 하나요?
libvirtd
버전: 2023-12-17 22:51:19.342+0000:15206: 정보: libvirt 버전: 9.10.0
os
:만자로
감사해요