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.

相关推荐
电子科技圈3 小时前
Durin:Aliro标准赋能,打造无缝移动入户体验
人工智能·mcu·物联网·网络协议·智能家居·智能硬件·iot
liu_endong1 天前
杰发科技AC7840——编译链接过程
mcu·国产·杰发科技·autochips
学嵌入式的小杨同学4 天前
STM32 进阶封神之路(三十):IIC 通信深度实战 —— 软件模拟 IIC + 光照传感器(BH1750)全解析(底层时序 + 代码落地)
stm32·单片机·嵌入式硬件·mcu·硬件架构·硬件工程·智能硬件
光子物联单片机4 天前
STM32传感器模块编程实践(十九) 光子物联北斗GPS定位模块简介及驱动源码
stm32·单片机·嵌入式硬件·mcu
李永奉4 天前
杰理芯片SDK-更改芯片产品蓝牙名功能
单片机·嵌入式硬件·mcu·物联网·语音识别
乐鑫科技 Espressif4 天前
乐鑫发布 ESP32-S31:高性能多协议双核 RISC-V,面向 AI 智能交互
人工智能·mcu·esp32·乐鑫科技
电子科技圈4 天前
芯科科技闪耀2026嵌入式世界展以Connected Intelligence赋能,构建边缘智能网联新生态
人工智能·嵌入式硬件·mcu·物联网·智慧城市·健康医疗·智能硬件
学嵌入式的小杨同学6 天前
STM32 进阶封神之路(二十七):MQTT 深度解析 —— 从协议原理到 OneNET 云平台接入(底层逻辑 + AT 指令开发)
stm32·单片机·嵌入式硬件·mcu·硬件架构·pcb·嵌入式实时数据库
学嵌入式的小杨同学7 天前
STM32 进阶封神之路(二十五):ESP8266 深度解析 —— 从 WiFi 通信原理到 AT 指令开发(底层逻辑 + 实战基础)
c++·vscode·stm32·单片机·嵌入式硬件·mcu·智能硬件
学嵌入式的小杨同学7 天前
STM32 进阶封神之路(二十六):ESP8266 实战全攻略 ——TCP 通信 + 数据上传 + 远程控制 + 透传模式(库函数 + 代码落地)
stm32·单片机·嵌入式硬件·mcu·硬件架构·硬件工程·智能硬件