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.

相关推荐
国产芯片设计20 小时前
小家电驱动开发实战:远乐YL1628在电饭煲显示面板的应用与调试
单片机·嵌入式硬件·mcu·51单片机·硬件工程
国产芯片设计21 小时前
DIY实战|0.8寸WiFi自动授时电子钟,国产数码管驱动芯片方案分享
stm32·单片机·mcu·51单片机·硬件工程
嵌入式的飞鱼3 天前
SD NAND vs eMMC:嵌入式存储方案怎么选?
嵌入式硬件·mcu·sd nand
[J] 一坚3 天前
嵌入式高手C
c语言·开发语言·stm32·单片机·mcu·51单片机·iot
EVERSPIN7 天前
基于MCU CH32X035 Type-C PD显示器方案
单片机·mcu·计算机外设
至为芯7 天前
PY32F071至为芯支持32位ARM内核的高主频MCU微控制器
单片机·嵌入式硬件·mcu
EVERSPIN8 天前
MCU单片机FOC汽车水泵方案
单片机·嵌入式硬件·mcu·汽车·mcu单片机
LongRunning9 天前
【BLE】STM32WB55低功耗实测(十)
mcu
LongRunning9 天前
【工具】STM32CubeMX和STM32CubeProgrammer安装问题
mcu
独小乐11 天前
019.ADC转换和子中断|千篇笔记实现嵌入式全栈/裸机篇
linux·c语言·驱动开发·笔记·嵌入式硬件·mcu·arm