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.

相关推荐
BBNbQKHXygfU2 天前
基于遗传算法优化BP神经网络的时间序列预测探索
mcu
想放学的刺客2 天前
单片机嵌入式试题(第30期)全局变量“满天飞“!!!局限性和影响有哪些,什么情况下才不得不使用?
单片机·嵌入式硬件·mcu·物联网·51单片机
网易独家音乐人Mike Zhou2 天前
【RealMCU】瑞昱官方LOG信息保存及解析,DebugAnalyzer自动化接收脚本(不需要用到ROM.trace文件)
单片机·mcu·物联网·自动化·嵌入式·iot·瑞昱
郝亚军5 天前
获取libiec61850和如何编译iec61850库
mcu·tcp/ip
liu_endong5 天前
杰发科技AC7840——打印所有GPIO的PORT配置寄存器
mcu·算法·杰发科技·autochips·车规芯片
想放学的刺客5 天前
单片机嵌入式系统试题(第28期)flash芯片各引脚作用?低功耗设计估算电池续航时间是多少?如何优化低功耗等项目经验
stm32·单片机·嵌入式硬件·mcu·物联网·51单片机
MickyCode7 天前
嵌入式开发调试之Traceback
arm开发·stm32·单片机·mcu
wotaifuzao8 天前
【Keil 5安装】keil 5最新版本安装+环境配置+下载百度资源分享(安装包,注册机等)
stm32·单片机·嵌入式硬件·mcu·学习·keil5·最新keil
帅次8 天前
系统分析师-信息物理系统分析与设计
stm32·单片机·嵌入式硬件·mcu·物联网·iot·rtdbs
MounRiver_Studio8 天前
RISC-V IDE MRS2进阶分享(三):MRS语言服务器
ide·mcu·risc-v·嵌入式开发