Fun with the Windows Subsystem for Linux
blogs.windows.com
blogs.windows.com
Most "advanced" cloud services are built with the aim of locking you in (AWS, Oracle, Heroku, etc etc): easy to adopt and easy to extend, which means "hard to leave". Microsoft is no exception.
This microsoft are no longer the ridiculously dominant force they once were.
Linux is a core part of their cloud business now.
They have a new CEO, and a lot of time has passed.
They are actively trying to change a lot of their culture and approach to things.
I would love to see MS get their crap together, but it still seems like they can't break their addiction to abusive behavior.
Having good developers using Windows will be a great boost for ecosystem, a percentage may choose to experiment with UWP, a react-native developer may try a Windows version of app.
Only thing to loose is people may not build cli tools for Windows, but that is already a lost cause. Linux won't pose a threat to GUI, so no chance of non developers getting comfortable and migrating to Linux. So win-win and later some more win.
The paths and base configuration will match your production environment, no worries about version mismatches or missing extensions. Ubuntu packages generally come with a sane and ready-to-run configuration, with service scripts and the like. (I use pkgsrc which seems more polished than Homebrew, but the installing experience is still not as nice as Ubuntu. Maybe someone will make a "Linux subsystem for Mac"...)
If anything this helps Linux because it cements popular Linux distros as the default *nix environments.
This can be done today on Windows too of course, even without this new fancy thing.
There are still a gazillion people using WAMP (and so on) as a bad impersonation of their production environment, so this fills a role.
Here's a question though that I seem to not see answered (but maybe I'm not reading enough):
Can I run MariaDB or nginx or other "servers" in this environment? Or does that stuff not work?
For any new programmers who want to learn more, search for "ANSI escape codes", VT100, "terminal emulation", termcap, and terminfo. Maybe add curses and pseudoterminal for extra credit.
rm -rf /mnt/c/
command on it, at least I would have put a # in front just in case.Once the authors discovers GNUScreen/tmux, xargs and other tools, his life will change :)
On a side note, the irony of GNU/NT must be killing Stallman.
For example, I read a blog where someone pulled down the redis source, compiled it, and was running it in wsl. That would be great for me, because it means I can just run redis in my dev environment, instead of turning on a vm to run redis (I know windows ports exist, but I've found it was faster and more reliable to just run the vm).
I also typically add ports of common applications (ls, grep, touch, etc) in my windows environments just to fill the gaps windows has. With this, I probably won't need to do that anymore.
This subsystem runs the exact binaries that you would run in your native boot system.
It's as simple as "apt-get install redis-server redis-tools"
The only thing I can think of that it'll open up for you is if you want to develop for Windows, while still having Linux available to you. Whether that's for developing games (most of the good game development tools run only on Windows, even if they can deploy to Linux/Mac/Android), or developing for Windows Phone (or whatever it's called this week), using Microsoft technology like Visual Studio and C# (though it's now possible to do most things on Linux via .Net Core, I think), or playing games that aren't available for Linux.
The modern Linux desktop is every bit as good as Windows (and Mac OS), IMHO, though I'd be willing to bet accessibility is still better on Windows. Hardware compatibility for modern devices is probably still better for Windows, too, though old devices certainly are more likely to run on Linux than Windows (a lot of my pro audio and music equipment hasn't run under Windows since like Windows Vista or something, but still works fine under Linux).
From my perspective after a week of tinkering with it, and using is exclusively for my development work, I don't feel like it has given me anything over my Linux environment. But, it does make the Windows development experience much closer to what I expect from Linux. If I developed Windows desktop applications, I would tell a different story, but I develop applications that run on Linux servers; developing on Windows provides no benefits, only negatives...but the negatives have gotten so small that they probably don't matter, anymore. A new developer just learning to build web apps, for example, could do it pretty much as easily on Windows as they could on Linux. Which has never been as true as it is today.
WSL is still very buggy and quirky, and the Windows build it runs on crashes several times a day (at least on my laptop, it does), so it's a net loss in productivity for me, as I'm spending some time waiting on reboots. But, in a few months, it'll probably be stable, widespread, well-documented, etc. And, at that point, maybe it'll even be an ideal option for some developers who are building for cross-platform deployment. Who knows, maybe in a few months, I'll find myself wanting to build something for Windows. I might come back from Linux for a while to spend time in Windows; I certainly don't hate it as much as I used to.
As for advantages Windows gives me over Linux, there are two.
1) Visual Studio. Even with all of its warts, it's a better debugging tool than anything linux or mac has to offer.
2) Gaming. Games on linux and OS X are catching up, but they're not there yet. I develop as well as play and Unity3D and Unreal Engine, not to mention the graphics drivers, just work better on windows.
I still adamantly oppose linux unless used through SSH.
I use windows for games and as a result just day to day stuff. This makes my life better because I don't have to use putty for SSH. At work being able to use linux tooling is wonderful. Just such a massive improvement over trying to figure out the command shell stuff.
> WSL is still very buggy and quirky, and the Windows build it runs on crashes several times a day (at least on my laptop, it does), so it's a net loss in productivity for me, as I'm spending some time waiting on reboots.
I had some weird video issues. In fairness, it's an insider build. Once they actually release the update maybe it will be better.
Is it a political party? What's to oppose? Use it or don't. I'm surprised to learn there are still folks who feel so negatively about the Linux desktop; to me it just seems like it's gotten so good in the past couple of years. I have almost nothing to complain about (and the complaints I have are pretty specific to my odd use cases, and I have related complaints about Windows and Mac).
The politest thing that I can say about that is "there's no accounting for taste".
I think it's everything I want from a desktop environment: Reliable, gets out of the way, looks gorgeous and consistent across all of the apps I use (I mention consistency because my terminal in Windows, a variant of ConEmu, looks ridiculously out of place and has a clunky and crowded UI, to boot), and has the right amount of configurability (with options for getting at stuff that isn't visible). I can't think of anything that Windows 10 or Mac OS have that I miss in Linux. The fact that it has my preferred shell environment natively and the most sensible (to me) filesystem paths, and provides a near enough to identical environment as what my CentOS 7 servers run, is just icing on the cake.
In short: What don't you like about Gnome 3 that you do like about the Windows or Mac OS desktop experience?
Yes. I have such unreasonable demands as thinking that, say, minimising windows might work the way I'd expect on every other OS, or that the extension API might remain stable across ostensibly minor releases, or that features don't disappear on a whim. I would like my desktop to feel like a desktop, and not like a tablet.
So, you don't like Windows 10, either, I guess?
I find it to be even more insistently tablet-like than Gnome (which I agree has some elements I previously only associated with Android, and I was slow to adapt, but I've come to be very comfortable with it). My new laptop has a touchscreen, which is a thing I didn't want...but it was the only way to get a 4k screen, so I have it, and I've even come to like it. My habits are evolving slowly, and it'll probably be a year or two before I even remember to touch the screen more than a few times a day, but I think the evolution is a positive one. That said, in the "cons" of having a tablet-like interface, Windows 10 has a "feature" that makes your start menu different every time you open it, which I find very difficult to use (I have to start typing to find anything always). That's just awful. But, I think I would hate it on a tablet, too.
For the other stuff, I kinda like the minimize behavior (but never use minimize...I use virtual desktops to determine what's in and out of view), I think the extensions API has been stabilized for a year or two now. Gnome 3 shipped in some distros when it was not ready (even though they were calling it stable, it wasn't), but it's firmed up a lot. Now, they're mostly doing incremental improvements. Each time I upgrade now (and I've been using Gnome 3 since it first shipped with Fedora) the surprises are small and pleasant (of the form "Oh, that looks nice!").
In short, I agree with some of your criticisms...but, only when applied to Gnome 3 of a year or two or three ago.
Like resizing Windows in Xubuntu? They give you a 1 px border to grab. Bug reported years ago. No fix; happens in all built-in themes. This kind of lack of polish is everywhere.
It's good, it's functional, usable, I'd take it over Windows XP or something, but let's not say it's every bit as good.
You honestly have no idea how much. Desktop accessibility in Linux, at least for me as a screen reader user, is a joke.
What advantages would this give you over running Firefox natively on Windows?
you can run an X server from windows and connect to it from linux. Not bug free but it does work.
The first iterations were a bit dodgy in my experience, but it's shaken out nicely. The only real, very nearly show stopper for me is that the console still stinks. That's not to say that Microsoft hasn't been working on it and making progress... but it's not as quality an experience as you'd have using one the Linux terminal programs in a GUI. I find emacs with not a whole lot of custom key mapping to be especially annoying; I swear sometimes that half the key bindings I want to use in org-mode are mapped first as short-cuts to the Windows console program itself.
If you just want command line tools, there's Cygwin.
On the other hand, installing a different than the default version of python on a linux system is not something that a newbie can do (since it involves getting the sjc, compiling it and making an altinstall).
This really breaks the cygwin experience for me :/
I installed WSL a few days ago. Installation is a ridiculous process, and takes about 24 hours for the service to finally appear after you follow the steps to make it happen, which is not well-documented and just feels idiotic to a Linux user, who's used to being able to change kernels in about three minutes, and switch back and forth at will.
But, I mostly love it. I still plan to install Linux and I'm unlikely to ever boot back into Windows except maybe for testing (I used to boot into Windows for games, but these days Steam has more than enough Linux games to keep me happy, as I don't game much), but Windows is suddenly not the worst of all possible worlds for developing software for Linux, anymore.
It has some weird/scary quirks: Using an editor installed on the "Windows" side of the system to edit files on the "Linux" side of the system led to files disappearing completely. I also saw the usual Windows CR/LF issues in sharing files between Linux and Windows partitions, but also an additional weird thing that might be Unicode related: I piped output from a command into a file on the Windows side in a Powershell session, opened it on the Linux side, and found it had spaces after every character and some other bizarre stuff inserted into it; kinda like maybe it was created in a UTF encoding but then loaded in a non-Unicode encoding or something. These are probably things that have some reasonable explanation and some way to work around them, but they made me scared enough of inter-operation between the two sides that I now isolate the two completely. I don't try to work "back and forth". If it's a Linux thing, I work only with Linux tools, and vice versa. This doesn't seem to be as big of an issue when using the MSYS bash shell that comes with git, which is my other bash shell in this system. At least, using the git bash shell hasn't led to any files disappearing.
Another interesting issue: Permissions are super lax, by default, in the Linux side. Owned by root:root and mode 777 across the board in your home directory, which causes a lot of software to complain. ssh, Ruby bundler (downgrade to 1.12.3 if you're having problems running bundle on Windows, either under WSL or in Powershell; same solution works for different bugs), and a bunch of other stuff has weird quirks when given a directory that is 777. It's also just plain nuts. I guess Windows has a different security model and this may not be a crazy as it seems at first glance, but it does cause software to freak out. But, as I understand it, WSL didn't even have a user account until recently, so they seem to be making it better on that front. In the meantime, I wouldn't want to rely on it for anything important.
That said, it gets a lot right. It feels like magic to run nearly any Linux application and have it Just Work. I, admittedly, am only running text mode apps at the moment: vim, bash, git, Perl, Ruby, Node. I haven't tried any graphical apps, so far. But, that's enough to replicate most of my workflow for developing server apps, and I don't need a VM to do it.
I don't plan to stick with Windows, even now, but it's been fun playing with it, and seeing what Windows is like these days. It's pretty nice, honestly. If I were just starting out with computers, I'd probably have no strong need to move to Linux in order to be productive. I'd learn how to use Powershell effectively (though it's gotten a lot easier/nicer in recent years, and accepts many of the common commands a UNIX user would expect, like ls, cd, cp, mv, etc...last time I used it many years ago, every command was some "Stupid-Long-Ass-Thing WithBIzarreLY cApitalized-OptioNS"), and probably be happy with Windows as a development platform.
As an aside, the Windows side of other kinds of development has also gotten remarkably better since I last tried it. Perl runs wonderfully right out of the box including some XS (compiled) modules, with Strawberry Perl, RubyInstaller does the same for Ruby, Python has always been great on Windows and still is, PostgreSQL works fine, git works mostly fine (though I guess some kinds of filename that are OK on Linux are problems on Windows), SQLite is great (as expected, since it is used by tons of Windows software, including stuff from Microsoft themselves, I think), ack works fine, etc. We've kind of entered a golden age where your desktop environment does not prevent you from working together with people using other desktop environments; they interoperate very easily for the most part, particularly with common points of ingress/egress (github or gitlab, for example).
It's interesting that the answers I've gotten about it being a poor user experience are all basically of the form, "No, that's how it is supposed to work. It isn't a poor user experience." Have y'all not used Linux before? I mean, apt-get and yum are really something special, if you're coming from systems (like Windows or Mac OS) that don't have good package management. Having one universal method to install and update everything on your system, including OS updates, is just wonderful.
Nonetheless, Windows 10 is the best Windows I've used (ignoring the privacy concerns among other things), and I like WSL. It's cool technology and fun to play with. I'm probably installing Linux tonight or tomorrow, but it was a fun week of tinkering with something new to me.
That "thing" isn't officially released yet, hence the hoops.
That is not my experience.
edit: I already had insider builds.
I don't know if it is fair to include the OS update time, but I can see why it is frustrating.
Weird. It worked instantly for me. It did need a reboot though.
Edit: I am regularly suprised that nano filename does not open quick edit in my machine. And then I remeber I am working in my local machine.
But as I said, the utility is limited. If you really need the Linux kernel, this is useless. If you don't, then everything is already available on Windows natively.
But I already have vim, ruby, golang and rust natively on Windows. I agree it's cool. But still pointless.
>You can set Bash as your debug shell in VS Code, you can have all your familiar SSH keys/forwarding/scp tools.
I can install vscode on Linux directly. And again, ssh, scp, etc is already there on Windows.
I use Msys2, Cmder, a bunch of custom tool builds, and some Powershell scripts. This setup works great; I'm productive with it and my command line feels fantastic. However, I have been tweaking my setup for years. WSL makes all of that learning, setup, and tweaking unnecessary.
All of your tools are available out of the box, and you don't have to configure anything, hunt down binaries, or make your own builds.
This isn't about making you and I more comfortable - we already are. This is about making it easier for other devs to find a happy setup on Windows.
Steam has so many games for Linux now, and a lot of that is due to Wine having advanced to the point where porting to Linux has become relatively trivial. Wine basically has allowed me to go years between reboots into Windows on my previous laptop; and I expect once I get Linux installed on my new laptop, I won't need to reboot into Windows again for another year or two or three. My favorite games are all working on Linux, mostly because of Wine (I don't run them explicitly under Wine, but a lot of the ports on Steam are using Wine behind the scenes).
"It’s not about replacing other Windows-native tools such as Python, PowerShell, C# and more. It’s about removing friction when you just need to get stuff done quickly and efficiently in a modern development workflow."
> I think that blog post is mostly made for tech journalists who aren't actually very techy.
---
This statement:
> This is definitely a “by developers, for developers” Windows 10 feature, specifically designed to remove a bit of friction from developers’ daily workflow.
reads like a press release. I agree that implementing WSL will reduce "friction from developers' daily workflow", but the article did a fairly poor job at demonstrating that.
There's probably a fair number of Windows only people that the whole Linux ecosystem is something new and foreign; especially sysadmin and corporate IT types that have heard about this, but may not know anything about it... I expect there may be some gentle introduction for those types here, too.
WSL is still not the highest quality right now, but they explicitly say that it will be still a beta in Win10 RS1, and it's impressive the progress they managed to do during the few months of the Insider period it has been published. To be clear, it's already largely usable for its advertised purpose (dev) and maybe even more, if you feel adventurous. I guess in RS2 it will be quite solid.