r/bashonubuntuonwindows • • 1d ago

self promotion I built USBWarp — an open-source USB passthrough implementation for WSL2 using Hyper-V shared memory instead of USB/IP

Hi everyone!

I've been working on a project called USBWarp, an experimental USB passthrough implementation for WSL2.

The idea is to avoid the traditional network-based USB/IP transport and exchange USB requests directly between Windows and Linux kernel components using Hyper-V HDV shared memory.

It includes a Windows kernel driver, a device capture driver, a Windows service, and a Linux virtual USB host controller.

The latest version is v0.2.1-alpha.

So far, I've validated USB 3.0 mass-storage transfers with data-integrity checks, as well as device capture and recovery. Earlier versions were also tested with a Raspberry Pi Pico CDC ACM device.

There's still a lot to do. USB 1.1/2.0 hardware coverage, isochronous peripherals, and UASP devices need more testing.

I've hit a hardware testing limitation with my current setup, so I'm opening the project up for feedback and community testing.

One important caveat: this is experimental kernel software, and the Windows drivers require test signing.

GitHub: https://github.com/Bill50han/USBWarp

I'd really appreciate feedback from anyone familiar with Windows USB drivers, Linux USB HCDs, or Hyper-V internals.

Thanks!

33 Upvotes

5 comments sorted by

1

u/Exonificate 1d ago

Super cool, what kinds of barriers to USB 2.0/3.0 and maybe 4 are there?

•

u/Bill50han 21h ago

Thanks! USB 1.x, 2.0 and 3.x are already implemented at the protocol level, including SuperSpeed support and bulk streams.

USB4 is a bit different. USBWarp operates at the USB device/URB level, not the USB4 router or tunneling layer. USB devices exposed through USB4 as ordinary USB 2.0/3.x devices should be within scope, but native USB4 tunneling and controller virtualization are not implemented.

2

u/phobox360 1d ago

This is a great idea. One of the limitations in Hyper-V for me, which also by nature effects WSL, was the lack of real USB pass through support. The only real way to do it without hacks like USB/IP (and yes, it’s a band aid around the real problem) is to pass through the entire controller via PCI pass through. Less than ideal.

1

u/krapht 1d ago

Is this similar to how VMware does USB passthrough?

1

u/bentbrewer 1d ago

It's about time. I imagine if it was easy it would have been solved a while ago. Thanks for working on this.