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 天前
Chaos-nano:Arduino Pro Mini 轻量级操作系统解析与实战应用
单片机·mcu·系统架构
FanXing_zl3 天前
基于整数MCU的FOC电机控制深度解析:从浮点到定点的工程实践
单片机·嵌入式硬件·mcu·软件开发·定点计算
XINVRY-FPGA3 天前
XC95288XL-10TQG144I Xilinx AMD CPLD
arm开发·单片机·嵌入式硬件·mcu·fpga开发·硬件工程·fpga
axuan126514 天前
16.【NXP 号令者RT1052】开发——实战-FlexPWM 输出
单片机·嵌入式硬件·mcu
时光の尘4 天前
【STM32】DMA超详细解析·入门级教程
stm32·单片机·嵌入式硬件·mcu·串口·dma·usart
R6bandito_4 天前
STM32 HAL库原子操作编译问题解决指南
c语言·ide·经验分享·stm32·单片机·嵌入式硬件·mcu
乄夜5 天前
嵌入式面试高频!!!C语言(十四) STL(嵌入式八股文)
c语言·c++·stm32·单片机·mcu·面试·51单片机
axuan126516 天前
15.【NXP 号令者RT1052】开发——实战-XBAR
单片机·嵌入式硬件·mcu
电子科技圈9 天前
XMOS与飞腾云联袂以模块化方案大幅加速音频产品落地
经验分享·嵌入式硬件·mcu·自然语言处理·音视频·腾讯会议·游戏机
axuan1265110 天前
10.【NXP 号令者RT1052】开发——实战-RT 看门狗(RTWDOG)
单片机·嵌入式硬件·mcu