Hacker News new | ask | show | jobs
by revelation 3353 days ago
I wonder if they have plans to add other emulation features, most importantly the ability to passthrough USB devices (or even graphic cards?).

I don't need or want the Linux graphical interface of my VM, it's pretty much redundant, but I do need to make devices available to the Linux software. Otherwise it's a bit like emulating a microcontroller - sure, Turing says the thing can compute everything, but in a very practical sense it can do absolutely nothing without it's outside inputs and periphery. I need the damn side-effects!

2 comments

Seems like you might be better served with a linux desktop and windows in a VM then.

The use case for WSL right now is someone like a web developer. They can develop and debug node apps locally in their native environment.

Works great for bioinformatics too. I've exited the Apple world (high prices etc.), and don't miss much now.

No longer have to modify Powershell to make it more Unix-like. Jupyter notebook works fine, so I'm happy. No more bother with dual booting either; Ubuntu is gone as well.

It's funny how Windows 10 is rapidly becoming a better Unix than MacOS since everything that matters runs Linux.
The irony is real. The only selling point for macOS right now is the unparalleled vertical integration, iCloud+ iPhone + Handoff etc. And also beautiful hardware that usually just works.
Yeah, as an iphone user it's the handoff stuff that keeps pulling me back to macOS. It's really handy, especially with cross-device cut and paste recently. However, I've also been using WSL and it has really impressed me. I need to check on the current state of similar windows<->android stuff before my next round of purchases.
MSFT are not the only ones in the Linux ABI emulation game. Illumos and FreeBSD are doing it too.

The Linux ABI is still a moving target, but it's moving much more slowly than a decade ago, so you can now expect every OS to start emulating it (warts and all).

That only works because they provide emulation for AF_INET, AF_UNIX and AF_NETLINK sockets. It's not an automatic freebie.
I understand. Nonetheless they did to the work to enable straightforward client networking (which works because Windows' own networking layer is basically Berkeley sockets under the hood).

Writing an emulation of the Linux USB sysfs and device node API on top of Windows' very different USB driver layer is a rather bigger task. I'm sure they'll get to it eventually, but it's not something you can demand as an "obvious" feature.

> That only works because they provide emulation for AF_INET, AF_UNIX and AF_NETLINK sockets. It's not an automatic freebie.

To be pedantic, Microsoft is actually emulating the whole lot. You're not running a Linux-kernel on your Windows-machine.

Might a developer need to talk to something like a Yubico smartcard? Yes, yes they might.
They did recently add support for standard serial devices[1]. I'm not sure if this support extends to USB or what any such timeline looks like.

[1] https://blogs.msdn.microsoft.com/wsl/2017/04/14/serial-suppo...

It does seem to work with USB serial devices, but only because those drivers on windows in turn emulate a serial port.

So we have the USB driver pretending to be a serial port to Windows pretending to be a TTY to the Linux subsystem.

It's a bit silly, but then I imagine TTY is a whole lot easier to emulate (even with all the cruft on that) than a USB chipset.

Tangential, but there was a recent HN article (I think) (that for the life of me I cannot find a link to) that referenced a Microsoft DSL for describing finite state machines that was principally developed to implement MS's USB driver. Closest link I could find (which is not the correct one) is: https://www.microsoft.com/en-us/research/project/model-based...
Perhaps it was this one from 13 days ago, about Prolog and Windows NT network configuration? https://news.ycombinator.com/item?id=14046420
No, that wasn't it.
P? https://news.ycombinator.com/item?id=12673739

(Only took me about twenty minutes of assorted searches to find it too...)