The Windows Subsystem for Linux (WSL) compatibility layer on Windows 11 now supports several developer-oriented USB scenarios, enabling developers to use WSL to interact with devices connected via USB.
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 and Visual Studio Code 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 usbipd-win project to enable common developer USB scenarios like flashing an Arduino or accessing a smartcard reader,” shared 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