6 ms·
Until they allow USB passthrough (which is more or less blocked by the fact that Hyper-V itself doesn't seem to have the feature), a whole bunch of my use cases
by folkrav 6y ago
Until they allow USB passthrough (which is more or less blocked by the fact that Hyper-V itself doesn't seem to have the feature), a whole bunch of my use cases are basically barred from WSL2. Shame, cause otherwise I really, really enjoyed using it - coming from a guy who's been on Linux for 99% of his time for ~15 years at this point.
- ljm 6y agoI really hope that happens at some point, since there's so much messing around just to get a yubikey working in WSL. I eventually gave up on that.
- uponcoffee 6y agoWsl 2 is really cool, right up until you want/need to do anything with the underlying hardware. No usb passthrough, no hardware acceleration, gpu passthrough is there but it's still early stages as performance is about half of native and vendor tooling is absent, etc It's getting better all the time though - they tease usb passthrough might be doable as it's already supported with remote desktop
- folkrav 6y agoYeah it's actually pretty damn good. Performance was better than it was with WSL1 for me, at least (especially IO). IIRC they are exploring USB passthrough using Hyper-V sockets, but it's still very early to actually talk about having that included[1] Once they figure that out I might just as well be able to switch over and stop dual booting. I hate dual booting more than I hate Windows, so it would be an improvement. [1] https://github.com/microsoft/WSL/issues/2195#issuecomment-743421442 https://github.com/microsoft/WSL/issues/2195#issuecomment-74...
- 1996 6y ago> Performance was better than it was with WSL1 for me, at least (especially IO). WSL1 performance is better for CPU-bound problems WSL2 only shines due to the VHDX approach. If WSL1 could use a VHDX or (gasp!) a native partition in a native linux format, it would smoke WSL2.
- folkrav 6y agoWSL1 was more or less the reverse-equivalent of WINE as I understood it, more or less a translation layer for a subset of syscalls, the approach is awfully limited from the get go. Not sure how using a VHDX or partition would solve that. We'd be back to square one, with things like containers being unusable again.
- 1996 6y ago> Not sure how using a VHDX or partition would solve that The problem with WSL1 is limited to disk IO performance, because the compatibility layer that's easy to do with system calls isn't so easy to do with the filesystem. > We'd be back to square one, with things like containers being unusable again. It's complementary. WSL2 when you play with containers, WSL1 when you don't. Personally, I don't bother with containers for about 90% of the development cycle - and it's just for testing before being deployed to a genuine linux, not some VM. Also, if you want to run servers with WSL (say, postgres), having containers is the last of your problems.
- folkrav 6y agoAh, different usecases then. I pretty much tend to go containers from A-Z for anything non-trivial, thus WSL1 was more or less useless for me. IO is also a big problem, just running a simple git status on a bigger project is a PITA.
- Dylan16807 6y agoIt's not all that limited. VHDX/partition would help significantly by not being NTFS and/or enabling a linux-style dentry cache.
- folkrav 6y agoI wouldn't call having only a subset of system calls, no containerization, no background services, no proper init system, no kernel modules, "not all that limited". But maybe that's just my use case.
- dhimes 6y agouh oh. I intend to use only external HDs on my new box (the SSD HD is small) and if I can't mount a USB it ain't gonna work. I can do it fine in WSL1.
- uponcoffee 6y agoYou can mount partitions/drives but something like a yubikey, mic, etc you can't right now
- dhimes 6y agoAh, ok. I was trying to follow a support thread and it wasn't clear about that. It made it sound like WSL2 didn't support USB at all.
- folkrav 6y agoWSL2 is backed by an actual virtual machine, so it comes with the limitations of its hypervisor (Hyper-V). Hyper-V doesn't support full USB passthrough. AFAIK it does support passing down USB volumes though.
- voxic11 6y agoIt seems many people find USB/IP works as a replacement for real USB passthrough http://usbip.sourceforge.net/ http://usbip.sourceforge.net/
- folkrav 6y agoFound this guide a couple of days ago[1]. Looks awfully convoluted and impractical. Good if it works, but I personally draw my line of acceptable minimum functionality somewhere between "working" and "practical". This is a bit much, and has a couple of pretty bad gotchas, unfortunately. [1] https://github.com/rpasek/usbip-wsl2-instructions https://github.com/rpasek/usbip-wsl2-instructions
- FuckButtons 6y agoI managed to get usb pass through working the other day for the serial monitor on a development board, they may have updated since last you tried.