9 ms·
Fun with the Windows Subsystem for Linux
- newman314 10y agoThis is nice and all but I'm much more interested in the inverse use case: managing Windows servers through ssh and bash. For example, it would make loading Let's Encrypt certs much easier.
- deleted 10y ago[deleted]
- sdegutis 10y agoELI5: What does this mean to me, as a developer who's really familiar with (and prefers) Linux, but has to use Windows? What cool possibilities will this "Linux Subsystem For Windows" open up to me? What things will it specifically not open up to me?
- dvlsg 10y agoI think the gist of it / watered down version is that you would be able to compile / run a good amount / most Linux (ubuntu) applications natively-ish in Windows. 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.
- supernovae 10y agoYou don't even need to compile it, just install the apt repo (if not already bundled in Ubuntu 14.04 defaults) and run apt-get install yourapp. 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"
- mark-r 10y agoWhat it opens up is the ability to use the commands and environment that are familiar to you, with as little change as possible. It runs the same bash as a Linux system, at a binary compatibility level. There will still be wrinkles to deal with, such as the case insensitivity of the Windows file systems.
- deleted 10y ago[deleted]
- SwellJoe 10y agoI've been primarily a Linux user since 1995, and have been using Windows 10+WSL for the past week or so, since getting a new laptop. 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.
- lj3 10y agoI agree with everything you've said. I also have been using WSL for the past few months. I can run everything in it that I run on Linux and OS X, which is great. I can now officially run any major operating system and have my zsh and vim setup and ready to go in 10 minutes flat. 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.
- MichaelGG 10y agoIf I can figure out if W10 can turn off its spyware, it'll allow me to ditch VMware for most use cases. Since you can run a Windows X server, I can use graphical emacs. If perf is good enough, I'll run a whole WM like XMonad and use Firefox and stuff inside it.
- MrFlynn 10y agoI found that this tool works pretty well for disabling telemetry: https://github.com/10se1ucgo/DisableWinTracking https://github.com/10se1ucgo/DisableWinTracking
- jscholes 10y ago> If perf is good enough, I'll run a whole WM like XMonad and use Firefox and stuff inside it. What advantages would this give you over running Firefox natively on Windows?
- mark-r 10y agoSo the Windows 10 console finally gets back the escape sequence capability that DOS had with ANSI.SYS? About frickin' time!
- gremlinsinc 10y agoI'd rather a linux sub sys for windows -- gamers on linux would flock to it, wine sux. There's some nice windows apps, and niche things built only on windows -- but I've staying on Ubuntu most likely.
- loeg 10y agoThat's what WINE is, to the nearest approximation. Windows' ABI to userspace is at the dll layer and much larger than Linux. WINE tries to handle that, but falls short in some areas.
- yeowMeng 10y agoI used to run Star Craft II on a a GNU/Linux laptop using WINE. The box would get hot AF, but it ran. I always thought WINE was impressive.
- SwellJoe 10y agoI don't think that's fair to Wine. It is tackling a huge problem space, without a specification or source to work with. They're reverse engineering vast swaths of Windows. I think Wine works remarkably well given the size and scope of the project, and the nature of Windows being a huge moving target. 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).
- gremlinsinc 10y agoI'm just saying WOW is buggy on linux wine, etc.. -- I think if windows officially had their own wine-alternative with proprietary drivers, dlls, etc--it would open a whole new world of cross-platform use.
- lucb1e 10y agoSounds like Windows users discovering (and apparently having "fun with") GNU/Linux. None of this is really specific to this subsystem.
- ryanlm 10y agoI agree. This looks like an elementary Linux tutorial.
- vmarsy 10y agoAgreed. for an elementary tutorial, I would have not put that 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 :)
- rodgerd 10y agotmux works, screen shits the bed.
- WaxProlix 10y agoIs there a reason for this / is it likely to be fixed anytime soon? I grew up with screen but this might be a good reason to try out tmux, I guess.
- stuxnet79 10y agoI tried out tmux starting from a week ago after a long time using screen, and after I changed the key-bindings to be more screen-like I have to say that I'm very impressed. I wasn't even close to a screen power user but with tmux I feel like I have screen plus a whole lot of extra.
- TheOsiris 10y agolets cut to the chase, does tmux work on wsl?
- SahAssar 10y agoProbably, I mean I can run xfce on it, so I'd assume it's capable enough (not at my my work computer which has wsl (or GNU/kWindows) right now.)
- SwellJoe 10y agoYep, works perfectly. Some terminal emulators on Windows suck up some command key combinations which might impede use of tmux or others that need those key combos, but that's usually configurable.
- supernintendo 10y agoThis is not a unique problem to Windows, btw. I use tmux with alt + tilde (`) as my modifier key, and most terminal emulators need config changes to allow this.
- israrkhan 10y agoI didn't try tmux, but termionator works fine (with an X server running on windows side).
- xorblurb 10y agotmux Works quite well. 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.
- stevehiehn 10y agoI'm have high hopes for bash on windows. It has the 'potential' to keep me on Windows a little longer. We shall see.
- kevin_thibedeau 10y agoIf all you need is Bash just install Msys. I use it every day to escape from crusty cmd.exe.
- SwellJoe 10y agoI just got a new laptop, and as it doesn't have an optical drive and I couldn't find a USB flash drive in order to install Linux, I've kinda been stuck on Windows for a few days. 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).
- cannonpr 10y agoI grew up through some of the more interesting business practices Microsoft employed, and it's several attempts to harm the Linux ecosystem. I would love to see this move by Microsoft in a positive light, but can't help but be suspicious ? For now the possibilities it opens are great, however I wish I understood Microsoft's strategic view of this and how it might evolve over time for Linux.
- toyg 10y agoMS is now a services business, they want to sell you their cloud. They can't do that if the linux ecosystem is shut out of Windows as it was before. Simply supporting Linux VMs is not enough, because long-term they still want to maintain some control on the OS market. So they open enough doors that you (or your corporate boss) will be enticed to consider their offerings and move to their cloud. You have some sweet cloud-management tool that runs on Linux? "You can now run it in the same way on Windows! Oh and with Windows in our cloud you also get all these other goodies..." - et voilà, locked back in. 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.
- serge2k 10y agoThis attitude seems pretty dated. 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.
- nitrogen 10y agoMicrosoft still seems very divided. On one hand we have cool developer initiatives, but on the other we still have anti-user behavior like forced W10 upgrades, encrypted black-box telemetry that cannot be disabled, Android patent extortion, and lawsuits over FAT support in other operating systems. I would love to see MS get their crap together, but it still seems like they can't break their addiction to abusive behavior.
- 10y ago
- ChuckMcM 10y agoI am really looking forward to this for my Surface Book. Historically I've loaded up a virtual machine running Linux, this was more complete and had fewer hiccups than a Cygwin type of setup for me. Of course it would be REALLY useful if they also support NFS for mounting stuff from my NAS appliance and a compositor (Wayland/X11/Etc.) that would allow things that create windows to work as well.
- KirinDave 10y agoI use the current fast ring insider builds with no substantial problems right now. Why wait?
- rodgerd 10y agoIt's on the slow ring now, too, which is where I'm using it. I'm quite impressed so far. There's some performance overhead in some cases (e.g. Hugo for Linux is about half the speed in the lxrun environment than Hugo for Windows on the same machine), but it's very pleasant.
- KirinDave 10y agoI use the current fast ring insider builds with no substantial problems right now. Why wait?
- serge2k 10y ago> compositor (Wayland/X11/Etc.) you can run an X server from windows and connect to it from linux. Not bug free but it does work.
- deleted 10y ago[deleted]
- ploxiln 10y agoI recently came across this fuse for windows, enabling sshfs, almost as good as NFS in many situations IMHO https://github.com/billziss-gh/winfsp https://github.com/billziss-gh/winfsp
- 10y ago
- Animats 10y agoWhy would you need a Linux subsystem to run Python? Python runs just fine on Windows. All my Python programs run on both platforms. If you just want command line tools, there's Cygwin.
- benlower 10y agoPython isn't installed by default on Windows. So this makes it easier.
- ambicapter 10y agoPython not being installed by default honestly makes it very easy to install and manage on Windows.
- spapas82 10y agoWhy not just use the good old python windows installer? I am using it for many years on various systems for both pytgon 2x and 3x and never had any problem or thought that it was difficult. 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).
- jcastro 10y agoFor development reasons it's nice to have the same exact version and environment on your Windows desktop as you would on a server.
- xabotage 10y agoMy experience with WSL has been excellent so far, I see it making Cygwin obsolete almost entirely. Cygwin was always a pain to set up and occasionally very buggy.
- spapas82 10y agoAnd slow. For some reason all commands I execute through cygwin seem to be taking a little more than if executed through a normal windows command prompt. This really breaks the cygwin experience for me :/
- dan-silver 10y agoLooks like the comment on their warning isn't rendering html? Hopefully people still see this :) $ rm -rf /mnt/c/ <strong>[DO NOT DO THIS]</strong>
- SturgeonsLaw 10y agoI hope that results in a malformed command, should anyone try and paste it in. Not gonna test it myself though :)
- petercooper 10y agoAppreciate this is a minor point but the name Windows Subsystem for Linux confuses me. Am I missing how to read it properly? It seems more like a Linux subsystem for Windows to me :-)
- spb 10y agoIt's a Subsystem of Windows for Linux execution.
- DocG 10y agoHow stable is it? I've been playing around with the idea installing it on my only (dev)machine. I dont expect the ubuntu subsystem to work perfectly but my old workflow to be stable. 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.
- dingo_bat 10y agoIt's pretty stable. But also pretty useless. Fun to play around and use a bit of byobu. I had a repo that wouldn't check out in windows because of some file names. But bash on Ubuntu on Windows worked like a champ. 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.
- supernovae 10y agoTHis makes no sense.. Most people don't comprehend that it's not just bash, its the entire Ubuntu user space. You can run Ubuntu apps just by running apt-get. VI, Ruby, Golang, Rust. You can set Bash as your debug shell in VS Code, you can have all your familiar SSH keys/forwarding/scp tools.. Of course there is a ton of windows native stuff, but in essence this makes Linux native so now you have just that much more.
- dingo_bat 10y ago>You can run Ubuntu apps just by running apt-get. VI, Ruby, Golang, Rust 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.
- GeorgeHahn 10y agoI think many of us who use Windows take for granted the number of tools we use to cover over our pain points. 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.
- kevindong 10y agoI found that blog post to be very disappointing. It didn't really demonstrate a meaningful use case for WSL (i.e. programming in C by compiling with gcc). I think that blog post is mostly made for tech journalists who aren't actually very techy. For example, the author used nano to copy and paste in a Python script. There's a two things wrong with that: 1) he used nano for "programming" (regardless of which text editor you use, I think we can all agree that nano definitely shouldn't be used for programming) and 2) Python already has native support on Windows.
- nitinreddy88 10y agoYou need to re-read the post "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."
- kevindong 10y agoMy example was meant to support my assertion that: > 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.
- sbuttgereit 10y agoI think you're right though I wasn't disappointed by the fact. I saw quickly that the audience wasn't me and kept reading for curiosity's sake... to test who they're trying to reach. 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.
- asrt 10y agoThat name bothers me. I understand that people don't want to use the name GNU/Linux because it's stupid and overcomplicated, but in this case there is no Linux at all. This is quite literally GNU running on top of the NT kernel, so why use the Linux name at all? On a side note, the irony of GNU/NT must be killing Stallman.
- AWildDHHAppears 10y agoIt's the Linux OS API. It can run Linux binaries. So I'm fine with the name
- ajdlinux 10y agoCygwin is GNU on top of the NT kernel. WSL is an implementation of a Linux ABI. In theory, you could run a non-GNU userland environment compiled for Linux on top of WSL.