4 ms·
WSL2 irritates me for a reason that is not common. It uses this thing called the "Host Compute System" which should theoretically allow one to launch any OS in
by muststopmyths 5y ago
WSL2 irritates me for a reason that is not common. It uses this thing called the "Host Compute System" which should theoretically allow one to launch any OS in the same sort of lightweight VM as WSL2. Of course, there are modifications to guest OS (kernel, init for talking over Hyper-V) required, but it should be doable.
However, Microsoft does not properly document how to use the HCS to achieve this. I've dived as deeply as I could into the docker shim code for HCS, but wasn't able to figure it out. It's an old story with Windows. Some cool feature buried under poor documentation.
Every time I hear someone say "Microsoft has changed", I mutter to myself "nope, same old MSFT with better PR".
- my123 5y agoA sample for it: https://github.com/microsoft/dotnet-computevirtualization https://github.com/microsoft/dotnet-computevirtualization The docs (which are a bit useful): https://docs.microsoft.com/en-us/virtualization/api/hcs/overview https://docs.microsoft.com/en-us/virtualization/api/hcs/over...
- anaisbetts 5y agoI'm sure that now that OP has found out he is wrong, he'll update his tired anti-MS rhetoric, right? Right? (cue Star Wars Padme meme)
- niea_11 5y agoHe may be partly right. The sample code is 4 years old. But the documentation is recent (at least the url linked by gp) : After 2021 june 27 : https://web.archive.org/web/20210627204757/https://docs.microsoft.com/en-us/virtualization/api/ https://web.archive.org/web/20210627204757/https://docs.micr... Before 2021 june 27 : https://web.archive.org/web/20210414223813/https://docs.microsoft.com/en-us/virtualization/api/ https://web.archive.org/web/20210414223813/https://docs.micr...
- muststopmyths 5y agoHave you actually looked at the samples ? You have no information about what is actually required on the guest OS side to make it launchable by HCS. It launches an OS (Windows) that already knows how to interface with HCS. As I said, the docker hcs shim might help one figure everything out, but that's not documentation. Edit: removed unnecessary flaming
- muststopmyths 5y agoAs far as I could divine a few years ago from the code in this repo, a deep dive into the OCI (Open Container Initiative) spec and the docker hcs shim should make it possible to figure this stuff out. I ran out of patience though and wish it was better documented.
- jdsully 5y agoOnce you document it you can’t change it. That’s why internals rarely get documentation and serious thought is given to what should be a public API.
- muststopmyths 5y agoAbsolutely. I understand why they do it (I used to work there years ago). But that's also a knee-jerk excuse used by teams so that they don't have to deal with documenting something. Their POV is understandable (if not wholly justified IMO), but then so is my irritation at the practice :)
- tw04 5y agoYou act as if they're alone in this. I just watched a livestream from the OpenZFS summit yesterday and they're having trouble with stable pages in Linux because there's almost 0 documentation. So is that "typical linux"? Are they trying to intentionally make life difficult for people that aren't in the internal kernel clique? Linus himself gave a completely uneducated rant against ZFS a while back, so should we assume ill intentions? If not, why are you throwing MS under the bus?
- muststopmyths 5y ago>You act as if they're alone in this. > So is that "typical linux"? Where did I mention anything about any other OS practice, or "typical Linux" ? >If not, why are you throwing MS under the bus? Jesus man. Mild criticism about an obscure API, of interest to perhaps a literal handful of people, is "throwing MS under the bus" ?
- tw04 5y ago>Where did I mention anything about any other OS practice, or "typical Linux" ? whoosh. You said it was typical Microsoft to not document APIs and implied this is an MS problem. I gave you a direct example IN LINUX and asked you if that's "typical linux"? Because you seem to be saying that the problem is isolated to MS. >Every time I hear someone say "Microsoft has changed", I mutter to myself "nope, same old MSFT with better PR". That isn't "mild criticism about an obscure API" and painting it as such is just farcical.
- pdpi 5y agoMicrosoft has changed, though. WSL2, VS Code are things I wouldn’t have expected from them 20 years ago. Azure, .NET core, and MSSQL all with first class Linux support was unimaginable. Now, they do still have a long way to go, but change like this takes time, it’ll always be a story of two steps forward one step back, and, perhaps most importantly, doesn’t happen all at once in an org the size of Microsoft. Some teams/departments are going to jump onboard this way sooner than others.
- urthor 5y agoA cynic would say they changed because Azure is now their revenue driver. Strong developer relations are now life and death when Microsoft is pitching Azure to cynical developers choosing between Digital Ocean and their competitors. Before it was Windows ecosystem lock in that brought home the bacon. Now it's convincing corporate IT to choose Azure over AWS.
- qalmakka 5y agoyeah, they are basically selling plain simple Virtual Machines as if they were a revolutionary technology. If you exclude the recent GUI features (which are orthogonal to WSL2), WSL2 is IMHO just marginally more convenient than running Linux on a classic Hyper-V VM and using SSH to access it.
- easton 5y agoI've been trying to figure out how to do this for months, as they use it for the Windows Sandbox but for whatever reason (licensing?) only allow you to launch one at a time. The HCS Go library doesn't have any documentation about the Krypton (micro-vm) style VMs.
- hda111 5y agoIs Docker counting as a separate operating system? Doesn’t it use the same Linux kernel as WSL? Or do you mean Windows Containers in Docker?
- muststopmyths 5y agoSorry just saw this now. Docker on Windows can launch guest OSes using the HCS interface. There is a bunch of code in docker that does so. It is the only public application I know of that uses the API.