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.

相关推荐
马上到我碗里来10 小时前
车规级MCU与普通嵌入式芯片的区别
单片机·嵌入式硬件·mcu·车规级
Absorbed_w1 天前
FreeRTOS(3)列表List
mcu·rtos
7yewh3 天前
嵌入式产品级-超小尺寸游戏机(从0到1 硬件-软件-外壳)
stm32·单片机·嵌入式硬件·mcu·物联网·游戏机
楼台的春风4 天前
【STM32 基于PID的闭环电机控制系统】
c语言·stm32·单片机·嵌入式硬件·mcu·物联网·算法
楼台的春风4 天前
【MCU驱动开发概述】
c语言·驱动开发·单片机·嵌入式硬件·mcu·自动驾驶·嵌入式
楼台的春风6 天前
【详细讲解在STM32的UART通信中使用DMA机制】
stm32·单片机·嵌入式硬件·mcu·物联网·嵌入式·信息与通信
电子科技圈6 天前
在低功耗MCU上实现人工智能和机器学习
人工智能·经验分享·科技·嵌入式硬件·mcu·物联网·机器学习
楼台的春风7 天前
PWM(脉宽调制)技术详解:从基础到应用实践示例
c语言·stm32·单片机·嵌入式硬件·mcu·物联网·嵌入式
RA生态工作室9 天前
瑞萨RA-T系列芯片ADC&GPT功能模块的配合使用
嵌入式硬件·mcu
楼台的春风9 天前
【GPIO详解及实践示例】
c语言·stm32·单片机·嵌入式硬件·mcu·物联网·嵌入式