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.

相关推荐
电子科技圈6 天前
XMOS推动智能音频等媒体处理技术从嵌入式系统转向全新边缘计算
人工智能·mcu·物联网·设计模式·音视频·边缘计算·iot
The️6 天前
Linux驱动开发之Open_Close函数
linux·运维·驱动开发·mcu·ubuntu
意法半导体STM326 天前
【官方原创】使用GPDMA进行SPI LCD整屏传输 LAT1435
网络·stm32·单片机·嵌入式硬件·mcu·网络协议·stm32开发
小刘同学-很乖6 天前
ESP32从入门到精通(全)
mcu·物联网·esp32·c·iot
EVERSPIN6 天前
基于N32G401系列MCU的DALI电源应用方案
单片机·嵌入式硬件·mcu
The️7 天前
STM32-FreeRTOS操作系统-软件定时器
arm开发·stm32·单片机·嵌入式硬件·mcu·c#
想放学的刺客10 天前
整理了120道单片机嵌入式面试题与答案,覆盖了硬件电路和C语言等核心领域。
c语言·c++·stm32·单片机·嵌入式硬件·mcu·51单片机
小野嵌入式11 天前
3小时精通嵌入式串口通信!从零玩转ESP32+Modbus+OTA(1)
c语言·单片机·嵌入式硬件·mcu·物联网
送外卖的工程师11 天前
STM32 驱动五线四相步进电机(28BYJ-48+ULN2003)教程
stm32·单片机·嵌入式硬件·mcu·物联网·51单片机·proteus
jyhappy12312 天前
深入理解 STM32 的 GPIO — 从零开始点亮第一颗 LED
c语言·stm32·单片机·嵌入式硬件·mcu