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.

相关推荐
马浩同学9 小时前
【ESP32】ESP-IDF开发 | UART通用异步收发传输器+串口收发例程
c语言·单片机·嵌入式硬件·mcu
Tlog嵌入式10 小时前
蓝桥杯【物联网】零基础到国奖之路:八. RTC
arm开发·stm32·单片机·mcu·物联网·蓝桥杯·iot
阿基米东2 天前
英飞凌 PSoC6 评估板 CAPSENSE 触摸滑条应用示例
mcu·iot
redcocal4 天前
地平线内推码 kbrfck
c++·嵌入式硬件·mcu·算法·fpga开发·求职招聘
CV金科4 天前
蓝桥杯-STM32G431RBT6(UART解析字符串sscanf和解决串口BUG)
c语言·stm32·单片机·嵌入式硬件·mcu·算法·bug
马浩同学5 天前
【ESP32】Arduino开发 | 中断矩阵+按键输入中断例程
c语言·单片机·嵌入式硬件·mcu
光子物联单片机8 天前
零基础国产GD32单片机编程入门(二十五)USB口介绍及CDC类虚拟串口通讯详解及源码
单片机·嵌入式硬件·mcu·gd32
WPG大大通10 天前
基于 onsemi NCV78343 & NCV78964的汽车矩阵式大灯方案
单片机·嵌入式硬件·mcu·汽车·开发板·大大通
昵称p10 天前
系统编程-初识MCU
单片机·嵌入式硬件·mcu
MikelSun12 天前
wolfSSL参数设置或配置项解释
stm32·单片机·嵌入式硬件·mcu·物联网·51单片机·iot