The Windows Subsystem for Linux (WSL (opens in new tab)) compatibility layer on Windows 11 (opens in new tab) now supports several developer-oriented USB scenarios, enabling developers to use WSL to interact with devices connected via USB.
The WSL compatibility layer is designed for developers to enable them to use Linux (opens in new tab) binaries without leaving the comfort of their Windows workstations (opens in new tab).
Microsoft explains that the new USB functionality takes advantage of the USB/IP protocol to forward USB traffic over the virtual network interface between Windows and WSL. While the Linux kernel has supported USB/IP since 2009, several recent changes have made it easier to use it in WSL.
Smoke and mirrors
Explaining the development, Ben McMorran, Senior Software Engineer, in the C++ Team at Microsoft wrote that building tooling for Visual Studio (opens in new tab) and Visual Studio Code (opens in new tab) to support C++ embedded device development required them to connect devices over USB.
However, they couldn’t test their tools on WSL, since USB devices weren’t supported by WSL.
“While this functionality is still not natively available in WSL, I’m excited to announce that our summer intern, Nelson Daniel Troncoso Aldas, contributed changes to the open-source (opens in new tab) usbipd-win project to enable common developer USB scenarios like flashing an Arduino (opens in new tab) or accessing a smartcard reader,” shared (opens in new tab) McMorran.
McMorran hasn’t said whether the existing solution can be extended to enable USB passthrough for general users. However, as McMorran notes, the ability to use USB devices via WSL is a highly requested feature, so it shouldn’t be long before the functionality lands in WSL.
Want to code? Check out our roundup of the best laptops for programming (opens in new tab)