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.

相关推荐
Mr.谢尔比8 小时前
电赛入门之软件stm32keil+cubemx
stm32·单片机·嵌入式硬件·mcu·信息与通信·信号处理
Wx120不知道取啥名3 天前
微控制器(MCU)如何运行存储在Flash的程序???
单片机·嵌入式硬件·mcu
CyberSecurity_zhang3 天前
多核架构的基本概念
mcu·汽车·amp·smp·同构多核·异构多核
马浩同学4 天前
【ESP32】ESP-IDF开发 | I2C从机接收i2c_slave_receive函数的BUG导致程序崩溃解决(idf-v5.3.1版本)
c语言·单片机·嵌入式硬件·mcu·bug
youcans_5 天前
【动手学电机驱动】 STM32-FOC(2)STM32 导入和创建项目
stm32·单片机·嵌入式硬件·mcu·电机
@haihi5 天前
IIC和SPI的区别和相同之处
arm开发·stm32·mcu
7yewh6 天前
嵌入式硬件重点(四)常用信号处理、放大电路、运算放大器(运放)基础篇
stm32·单片机·嵌入式硬件·mcu·51单片机·proteus·硬件工程
鼎盛合设计开发7 天前
宠物自动喂食器方案芯片
单片机·mcu
7yewh7 天前
嵌入式硬件电子电路设计(三)电源电路之负电源
stm32·单片机·嵌入式硬件·mcu·51单片机·proteus
ShiinaKaze7 天前
用图说明 CPU、MCU、MPU、SoC 的区别
mcu·cpu·mpu·soc·计算机架构