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 小时前
Chaos-nano协作式异步操作系统(六):`Chaos-nano` 在手持式 `VOC` 检测设备上的应用
c语言·单片机·嵌入式硬件·mcu·系统架构
babywew110 小时前
二维A*路径规划算法实现与导出dll库
mcu
minglie112 小时前
ESP32 波特律动oled
mcu
rechol1 天前
mcu启动流程
stm32·单片机·mcu·嵌入式
李永奉1 天前
杰理芯片SDK开发-内置触摸按键配置教程
嵌入式硬件·mcu·物联网
minglie11 天前
嵌入式彩屏单色字体点阵的存储结构设计
mcu
tang_shou2 天前
STM32CubeMx使用STM32F4系列芯片实现串口DMA接收
c语言·arm开发·stm32·单片机·嵌入式硬件·mcu·stm32cubemx
minglie12 天前
Wokwi@通过RFC2217 TCP 服务器连接到模拟微控制器串口
mcu
云雾J视界3 天前
当AI下沉到MCU:嵌入式开发者的“能力护城河”正在被重写
人工智能·单片机·嵌入式硬件·mcu·freertos·岗位技能
minglie13 天前
‌树莓派Pico‌的pio的iic的SSD3306
mcu