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.

相关推荐
wuyk5552 天前
38.什么是C语言?从语法到工程落地的工程师视角解读
c语言·开发语言·stm32·单片机·mcu·51单片机
MounRiver_Studio5 天前
RISC-V IDE MRS2调试秘籍(三):通过栈帧可视化模块定位栈溢出、栈内存非法篡改等运行时错误
mcu·risc-v·代码调试
MounRiver_Studio5 天前
RISC-V IDE MRS2调试秘籍(一):通过Memory内存导出对比,锁定隐性内存异常代码
mcu·调试技巧·risc-v·代码调试
sramdram5 天前
灵动高性能32位MCU空调解决方案
单片机·嵌入式硬件·mcu·32位mcu
sramdram7 天前
低功耗MCU芯片电机控制专用
单片机·嵌入式硬件·mcu·低功耗mcu·mcu芯片
wuyk5559 天前
25. 函数指针表:用查表替代 switch-case,打造高效可维护的嵌入式状态机
c语言·stm32·单片机·mcu·51单片机
狂奔蜗牛(bradley)10 天前
嵌入式软件编程思想之事件驱动+表驱动状态机+事件参数+优先级FIFO
单片机·mcu
ifndef24 天前
GPIO同时复用(ADC与TIM)
mcu
LeoZY_1 个月前
CH347应用 USB转JTAG功能之:probe-rs搭配CH347下载MCU命令全指南
单片机·嵌入式硬件·mcu·开源·github
sramdram1 个月前
基于MCU微控制器的电子血压计应用解决方案
单片机·嵌入式硬件·mcu·mcu微控制器