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.

相关推荐
范纹杉想快点毕业4 天前
ZYNQ PS 端 UART 接收数据数据帧(初学者友好版)嵌入式编程 C语言 c++ 软件开发
c语言·笔记·stm32·单片机·嵌入式硬件·mcu·51单片机
电子科技圈4 天前
芯科科技FG23L无线SoC现已全面供货,为Sub-GHz物联网应用提供最佳性价比
科技·嵌入式硬件·mcu·物联网·制造·智能硬件·交通物流
意法半导体STM324 天前
运行 Ux_Host_HUB_HID_MSC 通过 Hub 连接 U 盘读写不稳定问题分析 LAT1511
mcu·usb·st·hub·usb_otg_hs·filex·u 盘
路弥行至6 天前
从0°到180°,STM32玩转MG996R舵机
c语言·数据库·stm32·单片机·嵌入式硬件·mcu·mongodb
索迪迈科技7 天前
基于野火F407开发板实现电源管理-停止模式
c语言·stm32·单片机·嵌入式硬件·mcu
方案开发PCBA抄板芯片解密7 天前
MCU、CPLD、DSP、FPGA 有什么区别,该如何选择?
mcu
蜀黍@猿7 天前
【GD32】存储器架构介绍
单片机·mcu
伴杯猫8 天前
【ESP32-IDF】基础外设开发2:系统中断矩阵
c语言·单片机·嵌入式硬件·mcu·物联网·github
【ql君】qlexcel8 天前
MCU上电到运行的全过程
单片机·嵌入式硬件·mcu·启动过程
今日待办10 天前
Arduino Nano33 BLESense Rev2【室内空气质量检测语音识别蓝牙调光台灯】
c语言·单片机·嵌入式硬件·mcu·语音识别·ardunio·arduinonano33