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.

相关推荐
古译汉书2 小时前
嵌入式-SPI番外之按钮驱动程序的编写-Day15
c语言·stm32·单片机·嵌入式硬件·mcu·算法
白帽小野3 小时前
微控制器的工作原理和应用
mcu·嵌入式系统·微控制器
猫猫的小茶馆1 天前
【STM32】HAL库中的实现(五):ADC (模数转换)
stm32·单片机·嵌入式硬件·mcu·51单片机·智能硬件·pcb工艺
不断提高6 天前
多种适用于 MCU 固件的 OTA 升级方案
单片机·mcu·ota升级·双分区升级
小林学习中9 天前
三子棋装置(电赛24E题)K230/STM32全开源
stm32·mcu
Jason_zhao_MR11 天前
如何板端编译OpenCV并搭建应用--基于瑞芯微米尔RK3576开发板
人工智能·嵌入式硬件·mcu·opencv·物联网·计算机视觉·嵌入式
猫猫的小茶馆14 天前
【STM32】HAL库中的实现(二):串口(USART)/看门狗(IWDG/WWDG)/定时器(TIM)
arm开发·驱动开发·stm32·单片机·嵌入式硬件·mcu·智能硬件
猫猫的小茶馆15 天前
【STM32】HAL库中的实现(三):PWM(脉冲宽度调制)
stm32·单片机·嵌入式硬件·mcu·51单片机·智能硬件
猫猫的小茶馆15 天前
【STM32】HAL库中的实现(四):RTC (实时时钟)
stm32·单片机·嵌入式硬件·mcu·51单片机·实时音视频·pcb工艺
weixin_4243810020 天前
AUTOSAR Mcal Gpt - 模块介绍
mcu·汽车