
Windows Subsystem for Linux is good, but not enough yet - castlegloom
http://www.akitaonrails.com/2017/09/20/windows-subsystem-for-linux-is-good-but-not-enough-yet
======
orf
> In an ideal world, Windows should replace its entire NT underpinnings and
> either build their own BSD-inspired infrastructure (like Darwin) or create
> their own Linux distro using off-the-shelf Linux kernel as the main driver
> (probably can't because of GPL).

Why? Is a 'BSD-inspired infrastructure' or Linux the absolute best, or even
significantly better? Is an OS monoculture a good thing?

> Apple had its miracle in the turn of the century, and OS X and iOS are
> terrific OSes. Best of the breed.

The user-facing portion is, but there are significant problems with some core
features (semaphores, forking being very slow, file system notifications,
HFS).

Also, for a fair comparison you should run the test suite inside a vboxfs
mount.

~~~
holydude
You were comemnting on a blogpost from a person that thinks that linux on
desktop is a thing. Well no it is not.

~~~
KGIII
It is a thing. It's a very small thing, but a thing regardless. Some of us
have used Linux on the desktop since the 90s.

~~~
holydude
No it is not. Not even chromebooks are a thing. Android is a thing and if they
try enough the might turn it into a desktop alternative.

~~~
orf
Linux on the desktop is a thing. At my previous job all the consultants (100+)
used a custom distro based off Mint/Kali, with a Windows VM.

It's a thing. Might not be your thing, but its a thing nonetheless.

------
dTal
> In Linux distros, every binary is compiled against very specific library
> headers such as the kernel itself, Glibc and many others. Whenever one of
> those change, all binaries must be recompiled to run.

This is wrong. Only kernel modules are compiled against kernel headers, and
for userland programs the kernel is binary-compatible since ever.

Which is not to say that random binaries run bare on random systems, but this
is a cultural rather than a technical problem (package managers insisting on
having only one version of libraries, ignorance of the soname system). But
with enough effort you can always get binaries to run on a system, provided
you can get ahold of the libraries it expects, up to and including glibc.

>Which is why having source code available is so important

Back to front. The reason for the current situation is it's _expected_ that
the source code is available, so there's no incentive to provide stability for
binaries. Why bother? It's gonna be recompiled soon _anyway_.

~~~
readittwice
Exactly. Linux keeps its ABI stable and is committed to not break userspace.
Just bundling your app with all needed libraries should allow you to run your
app on any distro. There are only two requirements: same machine architecture
(e.g. x86_64) and the kernel should support all features used in the app.
That's why Go's statically linked binaries don't break on Linux but e.g. on
Mac.

I am quite excited about flatpak, should be quite useful for shipping
applications to a wide variety of distro with a single binary.

~~~
readittwice
I need to add that even glibc is also quite stable and backwards compatible:
[https://abi-laboratory.pro/tracker/timeline/glibc/](https://abi-
laboratory.pro/tracker/timeline/glibc/).

That's why some projects deliberately build their software on very old
distros, since the software then works from this version on.

~~~
pritambaral
> glibc is also quite stable and backwards compatible

But not forwards compatible. A binary linked dynamically against with a newer
glibc wouldn't run with an older glibc.

------
Analemma_
> In an ideal world, Windows should replace its entire NT underpinnings and
> either build their own BSD-inspired infrastructure (like Darwin) or create
> their own Linux distro using off-the-shelf Linux kernel as the main driver
> (probably can't because of GPL).

No, no! This is the exact opposite of the ideal world. What we need is for the
NT kernel to stay, and for Win32 to get replaced.

Look, people from the Linux world can have trouble admitting this, but NT is a
really good kernel. Better than Linux in some ways- not all ways, but some.
The shittiness of Windows mostly comes from Win32. _That 's_ what should go
away, and WSL is taking the first steps in that direction, even if Microsoft
isn't planning on "going all the way" with it.

~~~
bjpbakker
Out of curiosity, in what ways do you think the NT kernel is better than
Linux?

~~~
oaiey
Read about the history of NT and Dave Cutler the designer behind NT. He was a
VMS veteran and brought heavy influence from there
([https://en.m.wikipedia.org/wiki/Dave_Cutler](https://en.m.wikipedia.org/wiki/Dave_Cutler)).
He is an amazing engineer. Still working.

I would love to return the question and ask, why the Linux kernel is better.

~~~
bjpbakker
I haven’t claimed that Linux has a better kernel.

Basing your claim that NT kernel is better than Linux on the employment of a
single developer seems pretty pointless. Smart people work on both kernels.
Not so much of a feature that is better in one or the other.

~~~
oaiey
Was not my claim that the NT kernel is better ;) They are different. There are
only 3 dominant kernels left. Two commercial ones and one free. My opinion is
just that the NT and also the macOS kernel are in popular opinion a little bit
underestimated because they are very misunderstood.

------
chungy
He incorrectly assumes there's some kind of file system emulation going on.
There's not, WSL just runs on top of NTFS directly (NTFS doesn't have those
pesky restrictions Win32 imposes).

Fact of the matter is, the file system has _always_ been a sore spot on
Windows. It has known to be slow for decades and Microsoft engineers have flat
out stated that it's not affecting their bottom line, so they have no
incentive on changing that.

~~~
jstarks
Well, there is a little bit of emulation. We have to encode and handle Linux-
style file permissions, which has some overhead.

We are working on making both the WSL layer and NTFS itself better. For
example, in the upcoming Windows release, we have created a fast path for stat
that should yield a modest speed improvement.

We have a lot more work to do, though.

------
nycticorax
For WSL to be perfect (for me), it would also have to have better integration
with the native filesystem. This whole business where the WSL filesystem is a
separate thing, hidden away in the user's AppData folder, that you can't write
to using Windows tools, is a significant drawback. I dunno, I guess I don't
quite get who WSL is supposed to be for. The author of this article presents
it as an alternative to running Linux in a VM. Which, OK, maybe that's exactly
what it's intended to be. But I still wish that MS would include something
like Hamilton C Shell as a built-in part of Windows. I.e. a unixy shell that
provides unixy tools, and the ability to compose them, but where the tools are
designed to mesh well with the rest of Windows.

------
Ezhik
>In an ideal world, Windows should replace its entire NT underpinnings and
either build their own BSD-inspired infrastructure (like Darwin) or create
their own Linux distro using off-the-shelf Linux kernel as the main driver
(probably can't because of GPL).

In an ideal world, Windows NT stays, but Win32 is demoted to be just one of
the subsystems the NT kernel supports.

~~~
gaius
_Win32 is demoted to be just one of the subsystems the NT kernel supports_

'Twas it not always thus?

~~~
Analemma_
In theory, yes: NT has always had the capability to have multiple subsystems.
But apart from some attempts in the 90's that were aborted, it has gone
totally unused up until WSL arrived.

~~~
WalterGR
_some attempts_

There have been Microsoft POSIX, Interix, and OS/2 subsystems.

[https://en.wikipedia.org/wiki/Architecture_of_Windows_NT#Use...](https://en.wikipedia.org/wiki/Architecture_of_Windows_NT#User_mode)

EDIT: Re. "totally unused," Interix was available through Windows Server 2012,
and supported through 2014.

~~~
hyperpape
A creator of Interix said that _after_ he left Microsoft in 2004, he had to
explain to the Windows HPC team that Interix existed. So totally unused may be
an exaggeration, but it sounds like it was overlooked.

[https://medium.com/@stephenrwalli/running-linux-apps-on-
wind...](https://medium.com/@stephenrwalli/running-linux-apps-on-windows-and-
other-stupid-human-tricks-part-ii-c244b2ee535)

~~~
WalterGR
Not well known? Sure. GP didn't know about it, for example.

But "totally unused" is not an exaggeration, it is simply incorrect.

Thanks for the link. Interesting to read Interix founder and open source
advocate's personal tales of interacting with early-2000s Microsoft after an
acquisition that he didn't feel sufficiently compensated for. ;)

------
monkmartinez
> My ideal setup is actually a MacBook Pro. But I am forcing myself to live
> out of the Apple ecosystems, and it hurts.

Why? In all of the digressions I would like to read about this is a big one. I
have been considering the same. The only Apple product I have left is a MBP.
There are soooo many choices on the PC side of things. The paradox of choice
hits hard when looking at; Samsung, Acer, ASUS, Lenovo, Dell, and HP. Some
$700 models have the same specs as $1500 Mac's with touch screens and pen
support.

~~~
petepete
Without guaranteed full Linux compatibility, it's not worth the risk on many
of those vendors. OEM (adulterated) Windows just isn't an option and unless
there's an ad-free version of Windows 10 (I haven't researched extensively but
I don't think I can just buy one that won't spam my Start Menu) I'm going to
have to revert to another OS - having ads built in simply isn't an option.

I'm no Apple fan but the competition is embarrassing at times.

For the record my two notebooks are a MBP 2014 and a Dell XPS13 Developer
addition running Arch. Both are equally competent as development machines.

~~~
oaiey
My start menu does not have any advertisment. It had after blank installation
but removing the tiles and initial apps solved that. Never came back.

Well, I do not have the store on the tile part of the start menu. But I think
it is fair game that the store would show some advertisement when it is a
tile.

------
lostmsu
Benchmarks were not made properly: there's no warmup, no multiple runs, etc
There are number of things, that would go wrong with it: cold caches, unloaded
shared libraries, that might be already in memory in full Linux system in VM,
etc

Also I should mention, that native Linux build might be optimized for ext2 or
whatever as opposed to NTFS.

------
ufmace
I agree with the author on quite a few things, but not the main point.

First thing that bothered me: He was bothered by the need to `sudo
/etc/init.d/PostgreSQL start` to start up Postgres every boot. Yeah, that's
annoying, but easily mitigated by running Postgres (and MySQL and any other
service you need) in the Windows layer. Postgres installs just fine in
Windows, and uses the Windows service system, which has gone basically
unchanged for decades, versus Linux with like 3 service management systems.

But the main thing is that his main objection is that his test suite is about
half as fast as it should be. This is honestly not a big deal to me, and I do
Rails full-time as well. IMO, even the fastest run of his test suite at 2
minutes is still way too slow to run regularly. If I was working on that app,
and I've worked on many with test suites many times slower than that, I would
have already switched to running a limited part of it that tested what I was
actually working on. I stick to about a 10-second max for tests that I run
routinely while working. If it's longer than that, I'll run a smaller set
that's under that, and run the full suite maybe once before pushing, or just
let the CI server run it. I have to figure the number of people for who that
kind of slow-down is a deal-breaker is pretty low.

~~~
pritambaral
> easily mitigated by running Postgres (and MySQL and any other service you
> need) in the Windows layer.

Which comes with its own set of problems.

The entire point of MSFT in releasing WSL was so devs on Windows could use
Unix-y goodness on Windows. I think that reasonably applies to the usage of
Postgres too, and not just ruby/node/etc.

\----

The proper way would be for Windows to autostart WSL when the user logs in /
system starts, like providing a "Linux boot up" behaviour to the WSL userland
and trigerring it on actual system boot up.

~~~
ufmace
> Which comes with its own set of problems.

Such as? Seriously, I'm running it like that and it works fine. I'll grant
that Ruby on Windows only kind of works, but no problems with PG or MySQL.

I do agree though that WSL ought to run as a Windows service and do the normal
Linux boot process when that starts.

------
squarefoot
My only fear is if there is, or will be, a way to write Linux software
explicitly requiring to be run under it.

~~~
pritambaral
That'd be the Extend step of EEE.

Although, I strongly doubt it'd come to that. Not because I think the new MSFT
is above EEE, but because I think it'd be hard to pull that off with the
community of Linux software writers and users.

------
cowmix
Hmm.. no performance comparisons with Docker for Windows.

~~~
icebraining
Docker for Windows seems to be just a Linux VM running on Windows 10's Hyper-V
support, so if VirtualBox is faster, Docker for Windows is probably faster
too.

