WSL2 使用usbipd工具 连接USB设备

Connect USB devices | Microsoft Learn

使用开源工具usbipd,可以让usb设备连接WSL

https://github.com/dorssel/usbipd-win

usbipd list 可以查看连接到win上的设备。

把USB设备从win转移到WSL需要执行下面两个指令。

usbipd bind --busid <BUSID>

usbipd attach --wsl --busid <busid>

Before attaching the USB device, the command usbipd bind must be used to share the device, allowing it to be attached to WSL. This requires administrator privileges. Select the bus ID of the device you would like to use in WSL and run the following command. After running the command, verify that the device is shared using the command usbipd list again.
To attach the USB device, run the following command. (You no longer need to use an elevated administrator prompt.) Ensure that a WSL command prompt is open in order to keep the WSL 2 lightweight VM active. Note that as long as the USB device is attached to WSL, it cannot be used by Windows. Once attached to WSL, the USB device can be used by any distribution running as WSL 2. Verify that the device is attached using usbipd list. From the WSL prompt, run lsusb to verify that the USB device is listed and can be interacted with using Linux tools.

相关推荐
酷飞飞1 天前
RTC和看门狗基于GD32F407VE的天空星的配置
stm32·单片机·嵌入式硬件·mcu
ll5776443323 天前
[DevOps实战指南从持续集成到持续部署的自动化流水线设计]
mcu
蜀黍@猿5 天前
【GD32】软、硬件I2C对比
单片机·嵌入式硬件·mcu
蜀黍@猿6 天前
【GD32】MCU选型参考标准
arm开发·单片机·mcu
蜀黍@猿6 天前
【GD32】软件I2C
单片机·嵌入式硬件·mcu
R6bandito_7 天前
STM32中printf的重定向详解
开发语言·经验分享·stm32·单片机·嵌入式硬件·mcu
千千道7 天前
利用keil +RASC给瑞萨RA8D1编译烧写程序
单片机·嵌入式硬件·mcu·物联网
La Pulga8 天前
【STM32】I2C通信—软件模拟
c语言·stm32·单片机·嵌入式硬件·mcu
电子科技圈9 天前
芯科科技第三代无线SoC现已全面供货
嵌入式硬件·mcu·物联网·网络安全·智能家居·智能硬件·iot
光子物联单片机10 天前
STM32G474单片机开发入门(八)内部FLASH详解及读写实战
stm32·单片机·嵌入式硬件·mcu