
Testing the Windows Subsystem for Linux - jackhammons
http://blogs.msdn.microsoft.com/wsl/2017/04/11/testing-the-windows-subsystem-for-linux/
======
ape4
I still have a hard time with bash-backwards name: "Windows Subsystem for
Linux". Its a Linux subsystem for Windows.

~~~
dragonwriter
It's a subsystem of Windows (hence Windows Subsystem). And, among all Windows
Subsystems, it's the one for Linux, hence Windows Subsystem for Linux.

~~~
EpicEng
Yeah it's the 'for' in there that makes it wrong. It's not 'for' Linux, it's
for Windows. I know what it is and I _still_ think of it backwards every time
I read it.

~~~
WorldMaker
'for' is heavily overloaded as an English preposition. You are expecting a
connotation of "for [the benefit of] Linux" versus the connotation of "for
[the purpose of] Linux". Another example in English might be the relative
meanings of 'for' in "this gift is for you" versus "this gift is for good
behavior".

Other languages use multiple words or different cases for some of these
situations. English leaves it ambiguous.

~~~
EpicEng
The fact that there are so many of us discussing it implies that it is a
failure of a name. After all, what are words for if not communicating? We can
debate semantics all day, but in the end, it's obvious that many people find
the phrasing to be confusing.

------
pixelbeat__
The GNU coreutils test suite would be interesting to run as it tests most
syscalls in various edge cases.

Some details at [http://www.pixelbeat.org/docs/coreutils-
testing.html](http://www.pixelbeat.org/docs/coreutils-testing.html)

------
Analemma_
Using the unit tests of _other_ Linux software to be your own compatibility
test is delightful. It almost feels a little subversive.

~~~
rl3
> _In these cases, the WSL team covers test gaps by writing our own unit
> tests. At time of writing the team has written over 150,000 lines of unit
> test code for systems calls and virtual files ( /proc, /sys)._

I wonder why they went that route instead of contributing to LTP directly?

While there's probably some edge cases specific to WSL, surely much of their
increased unit test coverage would be applicable beyond WSL.

~~~
jackhammons
We maintain a fork of LTP internally. Eventually we hope to contribute our
changes back but unfortunately open sourcing isn't free and we have bigger
fish to fry[1].

[1] [https://wpdev.uservoice.com/forums/266908-command-prompt-
con...](https://wpdev.uservoice.com/forums/266908-command-prompt-console-bash-
on-ubuntu-on-windo)

~~~
rl3
That's understandable. Thanks for the reply.

Out of curiosity, is progress on WSL bound by any blocking issues in
particular, or could your team benefit from more resources being assigned to
the project?

Maybe I'm naïve, but I tend to view WSL as a perfect way to win over a ton of
developers who are becoming disillusioned with macOS, but are hesitant to run
bare metal Linux due to the headaches involved (insofar that macOS and Windows
"just work").

------
codebook
I gave up WSL after experiencing significant performance drop on GHC,
Stackage. It was less than 1/10th of native for compiling Haskell code.

~~~
ulber
Here's the issue on GitHub if you'd like to track it:
[https://github.com/Microsoft/BashOnWindows/issues/1671](https://github.com/Microsoft/BashOnWindows/issues/1671)

benhills describes the cause:

 _For some context, I 've looked at what causes this slowdown. For some reason
stack has mapped an mind-bogglingly huge region of memory (I'm talking dozens
of terabytes). When we fork we walk the entire address range to set up the new
process's state. We have a design that should vastly speed this up, but we're
approaching "pencils down" date for Creators Update._

~~~
codebook
Thanks for the info!. I will try again.

------
nrki
Recently tried to use WSL to do some pair-coding tests in an interview, with
screen & tmux.

The damned terminal kept making characters disappear! I actually thought my
interviewer was inadvertently deleting characters, or maybe trolling me.

I had to switch to using an actual Linux system.

MS have a ways to go before getting this right. I daresay I'll be on OSX by
the time that happens though.

~~~
adolfojp
Did you try using WSL with the creator's update? The fixes were extensive.

~~~
deadbunny
You mean the update that hasn't even finished rolling out globally?

~~~
Omnius
[https://www.microsoft.com/en-us/software-
download/windows10](https://www.microsoft.com/en-us/software-
download/windows10) Click update now. This tool will let you install it
without waiting inline (assuming you don't have the option from the built in
windows 10 update tool)

[https://www.cnet.com/how-to/windows-10-creators-update-
downl...](https://www.cnet.com/how-to/windows-10-creators-update-download-
install/) (Warning annoying video plays with sound)

------
Clownshoesms
Is there telemetry built into this too? I'd worry about ssh logins being
logged for diagnostic and privacy journey purposes.

~~~
LinuxFreedom
You will see ads on your command prompt from time to time and the bash
completion will contain "sensible recommendations" based on your general
behavior, psychological state and political orientation.

Now that everything was published they also plan to pre-install the diverse
arsenal of hacking tools on every machine, as there is no reason now anymore
to hide that stuff - what will make the fight for freedom much easier for
everyone involved!

To support your patriotism there will now be a personal statement of all past
MS CEOs showing up on startup and the national anthem playing to support your
emotions.

Also from time to time a screensaver will show the sentence "Everybody adores
you, because you belong to a global hacker elite using the Windows operating
system in 2017! Ignore that laughter around you!"

~~~
UweSchmidt
Last part of your post is a bit wild, but you got me at the start.

------
youdontknowtho
I think that the "pico process" \+ kernel driver model that they are using
could be leveraged to build a new operating system on the windows kernel. That
would give you a base for a new OS that can reuse the Windows Device Driver
infrastructure.

------
synle
Although I love their work, unfortunately the terminal (window cmd bash) is
horrible. Copy and Paste is a pain, doing panel splits are impossible unless
you use tools like tmux.

I would love to see terminator or a more advanced terminal.

~~~
gillette
I've been using ConEmu set up to auto launch Bash. Working pretty well apart
from MS's ass-backwards resolv.conf population which overrides every Ubuntu
mechanism for creating the file... so I have to run a script to get my VPN's
DNS to work :)

------
Zyst
Is anyone here using this for *Nix traditional tools?

Mostly curious about Vim/Tmux, and having serve operations spit out the server
into the actual Windows browser?

I did read something about the creator update adding 24 color support.

~~~
repsilat
I use vim in it when I code on my home computer, haven't had any problems. I
haven't tried tmux, but I think that'd be fine too.

I'm less sure about things that require a GUI, and last time I tried postgres
it didn't work. That was a while ago, though, and they might have made
progress since. TFA says the postgres tests are passing.

~~~
quanticle
Things that require a GUI require you to have a separate X server running.
WSL, as far as I know, does not support running X11. However, if you do have a
Windows native X11 server running (like xming, for example) things like emacs
and gvim seem to work. I haven't tried anything more intensive than those,
though.

~~~
daenney
> Things that require a GUI require you to have a separate X server running.
> WSL, as far as I know, does not support running X11.

They mention X/GUI support in the "What's new in Bash/WSL" article[1].

> Note: Some of you may also have been following along with some intrepid
> explorations into running X/GUI apps and desktops on WSL. While we don’t
> explicitly support X/GUI apps/desktops on WSL, we don’t do anything to
> block/prevent them from running. So if you manage to get your favorite
> editor, desktop, browser, etc. running, GREAT but know that we are still
> focusing all our efforts on delivering a really solid command-line
> experience, running all the command-line developer tools you need.

[1]:
[https://blogs.msdn.microsoft.com/commandline/2017/04/11/wind...](https://blogs.msdn.microsoft.com/commandline/2017/04/11/windows-10-creators-
update-whats-new-in-bashwsl-windows-console/)

------
skynode
Can we get the new, improved subsystem without having to go through the Win10
Creator's Update?

~~~
miguelrochefort
Why not go through Windows 10 Creator's Update?

~~~
skynode
Apart from the new .NET Framework 4.7 and a few minor others, a bunch of
features (e.g. Paint 3D) are not necessarily targeted towards advanced users.
It would make sense to fragment some key modules we use as devs and make those
available piecemeal without bundling features we'll probably never use with
great features like WSL and the new Windows console. Essentially MS could give
options just like it gives options about what to install on VS 2017 (for
advanced users of course, regular users can have the default CU install mode).

------
2muchcoffeeman
Does anyone use this for work? Could I replace Ubuntu with Windows now?

~~~
ac29
That's a bit loaded, but I'll attempt to answer seriously:

Can you replace Ubuntu? Maybe, if you are OK with 14.04 LTS level support.
Certain simple things straight up don't work -- you can't send a ping without
an admin level windows shell (sudo wont do it either). You also won't
magically get driver support for hardware that works in Linux, but not Windows
(if you think this isn't a thing, try plugging in a random USB-to-something
adapter without finding obscure, broken, or nonexistant drivers on Windows).
If you just need access to some tools that only run on Linux, I've found WSL
invaluable, so long as those tools are available on Ubuntu 14.04.

Can you replace Linux in general? Nope - I'm a 90+% Linux user for work and
home, and neither Debian, Ubuntu, or its derivatives work for me, with the
notable exception of some server and embedded applications. If you want a wide
variety of up-to-date software, there is no replacement for something like
Arch.

~~~
danieldk
_Can you replace Ubuntu? Maybe, if you are OK with 14.04 LTS level support._

The latest Creators update uses 16.04 LTS.

 _you can 't send a ping without an admin level windows shell_

The latest Creators update supports ping as a non-admin.

\---

I would say that for most usages it is a good replacement for vanilla Ubuntu.
Microsoft is quickly closing the gaps in support. Most stuff simply works
(albeit disk filesystem I/O is still a bit slow). For instance, I used it to
compile packages for Ubuntu 16.04 and upload it to a PPA without much trouble.
At the time the only change I had to make was using fakeroot-tcp rather than
regular fakeroot. But maybe that is fixed now.

It is especially useful if you like to work in a Unix, but also need Microsoft
Office, Adobe Creative Suite, or other applications that are not available on
Linux.

~~~
ac29
> The latest Creators update uses 16.04 LTS.

I did know that, but the update only came out today AFAIK, and is being slow-
rolled out (I checked all my Windows machines today, none updated). People
with enterprise/business versions of Windows with "Defer feature upgrades" aka
"Current branch for Business" enabled also wont get it for a while. I know how
to force the update, but forcing Windows updates is something I've learned
better than to do.

As an aside, I would highly reccomend WSL users check out wsltty[0]. Gives a
better terminal than Windows' built-in 'cmd', with options to open other
shells like fish/zsh/etc in arbitrary directories.

[0][https://github.com/mintty/wsltty](https://github.com/mintty/wsltty)

------
radarsat1
I like the idea of the Linux Test Project. Neat.

I'm curious, does the WSL actually use any parts of Linux under the hood, or
is it just an emulation of the user space, like Cygwin?

~~~
abrowne
It uses a Linux-compatible kernel interface with no Linux kernel code plus
Ubuntu's userland. I guess that's why they sometimes call it Bash on Windows.
I'm surprised no one's proposed "Windows Subsystem for GNU".

~~~
azinman2
Because the main bit is translating Linux syscalls to windows. Which isn't
gnu.

~~~
cryptarch
Isn't the main use of WSL "first-class GNU tools for Windows"?

I can't really imagine people running anything other than development tools on
WSL, and most of those come from the GNU project.

------
cryptarch
I'd just like to interject for moment. What you're refering to as WSL, is in
fact, GNU/NT, or as I've recently taken to calling it, GNU plus NT. NT is not
an operating system unto itself, but rather a non-free component of a fully
functioning GNU system made useful by the GNU corelibs, shell utilities and
vital system components comprising a full OS as defined by POSIX.

Many computer users run a modified version of the GNU system every day,
without realizing it. Through a peculiar turn of events, a version of GNU
which is widely used today is often called WSL, and many of its users are not
aware that it is basically the GNU system, developed by the GNU Project.

There really is an NT, and these people are using it, but it is just a part of
the system they use. NT is the kernel: the program in the system that
allocates the machine's resources to the other programs that you run. The
kernel is an essential part of an operating system, but useless by itself; it
can only function in the context of a complete operating system. WSL is
normally used in combination with the GNU operating system: the whole system
is basically GNU with NT added, or GNU/NT. Windows 10, the so-called NT
distribution, is really a distribution of GNU/NT!

(Sorry for the copypasta, I couldn't resist.)

~~~
kelnos
The interesting bit of WSL (what the article talks about) is a Linux syscall
translation/emulation layer, as well as ELF64 binary support (not specific to
Linux, but not specific to GNU either). You can certainly install the Linux
versions/ports of GNU tools and run them under WSL, and that's what the stock
setup looks like, but an important component of WSL is about emulating a Linux
(the kernel) environment.

If MS had actually ported the GNU base system to NT, then you could reasonably
call it GNU/NT. They have not done that.

~~~
cryptarch
I think it is more significant from a user's perspective that they get the GNU
tools to run on their NT machine with MS support.

What's the use of Linux syscall -> NT syscall translation if not compatibility
with developer tools, most of which are GNU software?

~~~
skrause
So you were actually serious? I thought your first post was great satire.
Poe's law strikes again...

~~~
cryptarch
I think the syscall translation part is an irrelevant hack, seems silly to act
like that is what makes the project more useful because it does not guarantee
performance, compatibility or stability.

~~~
TazeTSchnitzel
The syscall translation makes it more useful than the previous UNIX subsystem,
because it means it can near-perfectly emulate a popular POSIX-like system
(Linux), and thus be compatible with most of its software, rather than being
its own eccentric platform that existing POSIX software must first be ported
to.

~~~
cryptarch
So is it near-perfect yet?

I don't see the value if it's not more stable than "excentric" platforms like
Cygwin and MSYS, but I guess I wouldn't use it either way because there's no
way I'm installing Windows 10 on my hardware.

------
partycoder
As a Linux user, MS Windows Subsystem for Linux is as interesting as Microsoft
Bob.

Microsoft cannot say it loves Linux until they launch their flagship products
such as MS Office and MS Visual Studio on Linux. Until then, it's all fugazzi.

MS SQL Server on Linux was good progress.

------
seiferteric
Wake me when MS offers Linux subsystem for Windows (basically commercial
WINE). From what I have read, MS is not actually that interested in improving
the Windows kernel anymore unless needed or profitable. Why don't they give up
and run windows user space on Linux (or BSD) :)

~~~
meddlepal
Why would they do that? NT is a very good kernel design.

~~~
JdeBP
And, moreover, the ability to run multiple operating system "personalities" on
top of it like this was part of that design pretty much from the start.

~~~
Vogtinator
Linux had that as well until it was castrated a while ago. It was called
"exec_domains".

