Curious, what does Windows bring to the table that someone would prefer it over just Linux? I did the whole development with WSL2 thing for a bit, and it sort of worked OK, but then I setup dual boot and it's so much nicer to have a minimal WM / lighter OS / Windows out of the way.
I can think of a few things. First, you get Windows for everything else (if you use the machine for personal stuff, gaming, need Office desktop apps, if you need Photoshop, etc).
You get a lot of that on Mac though (well, less so on the gaming front, but Macs have some apps that aren't on Windows too). But that's "real" Linux, so you don't have to spend time installing GNU tooling or fighting with brew.
Dual booting can get annoying, because you have to, well, reboot.
You don't have to worry about hardware. Linux has come a long way, but there's still the random peripherical that doesn't work, or some where the configuration software is Windows only. It's pretty easy to avoid hardware that won't work with Linux, but in this world you don't even have to worry about that. Especially relevant in the desktop space where you have to look at every component.
WSL2 also has some interesting benefits, like being able to install a couple of different distros, or wipe out and start over in a few seconds if you screw things up. It's kind of the docker experience without docker.
In the corporate world, it also means not having to convince your employer to get a Linux install they'll support. The company I work for only allows Windows or Macs. Sure, I've worked at big companies where after some back and forth with IT we could get Linux on the PC machines, but it's nice not even have to go through the hoops.
There's some drawbacks: interop between the WSL2 file system and the Windows one works fantastic, but it's FREAKISHLY SLOW. If you're trying to git clone a big repo or npm install a big library and you're crossing boundaries between the two system, you're not going to be happy (as long as you stay within the WSL world you're fine though).
GUI apps are an issue. It's pretty easy to get most apps working using a Windows compatible X Server, but hardware acceleration is an issue. It looks like it might be possible to get working, but I sure as hell haven't been able to. The team is working on an official way to run GUI apps without going the X Server forwarding path, but it's not there yet. For now it works fine for simple things, like terminals and text editors, but trying to use Google Maps in Firefox is simply not useable (but it does work!).
I'm one of those weird people who actually likes Windows, and for 99% of my development use cases, Windows + WSL2 let's me do everything I need with zero compromise, and without having to reboot all the time. I can have a Windows-only game running with my Linux terminal open to do some development while I'm waiting for a group in my favorite MMO. Docker + WSL2 is great too.
> First, you get Windows for everything else (if you use the machine for personal stuff, gaming, need Office desktop apps, if you need Photoshop, etc).
Does that include all the phone-home stuff and ads as well?
I only run Windows (10) on a work laptop, and I'm guessing it's the 'Enterprise' edition, so all of that is not present. I've heard that there's a lot of intrusive garbage in the home-oriented editions: is that accurate?
(I sysadmin, so dog food Linux on my workstation.)
Edit: why the downvotes? As someone who runs an Helpdesk/IT-managed Windows laptop I have no idea what the state of the consumer Windows sphere is. The parent lists many good things: are there any bad things worth mentioning?
My Windows 10 Home Single Language license cost the OEM $50 AFAIK and despite that MS decided to put placeholder tiles on the start menu which are replaced with apps (e.g. Candy Crush) once you connect to the internet after setting up the OS and those are finished being downloaded.
Xbox app can be uninstalled, but not Xbox Game Bar? Bing on the Start menu search which for some reason I can't disable because there isn't any straightforward option for that.
When I try to download an app from Windows Store, the instant I press 'GET' button a dialogue window asking me to log into my MS account is opened upon closing which I can proceed to download the app.
I can shed some light on that. I am a long time linux user and recently brought a gaming laptop which comes pre-installed with Windows 10 Home. I made up my mind to use whatever software came with it rather than installing linux since I don't want to mess up with my system too soon. I gave away all my pro-linux biases and gave Windows a honest try. I didn't last two days with Windows, main reasons:
1) Privacy Nightmare: I was not able to login without first creating and logging in to an outlook account. They're pushing very aggressively than I'm comfortable with. And data stealing booby traps are everywhere. On the activities view, it always shows a "Keep more recent activity" button or something like that, which when clicked will send my browsing history to Microsoft servers to sync.
I didn't find any way to completely uninstall edge. It rings similar to Android, we get extremely less control on our own system.
For system updates, it will by default send update files to other users in the internet(like torrenting).
2)Excess data usage: When I was on linux, the data usage is almost null when idle but windows seems to be always downloading something.
3)Development: WSL2 definitely made Windows a bearable platform for development but I did encounter some problems. Installation was not straight forward, got some errors and fixed it by searching for an hour. There is no intuitive way to open bash in a terminal. Now, I don't know if I didn't search hard enough, but I was unable to setup a Ionic development environment on Windows and failed. That was when I realized windows wasn't really for me and switched to PopOS the second day.
Everything expect the nvidea card worked out of the box, and fixed it after reading a couple of threads on reddit. Battery life reduced by about 1 hour as compared with Windows but I can live with that.
The linux operating system and community is awesome, it is much frictionless to develop in linux than to use WSL2 in windows and you get a elegant operating system respecting our privacy than a bloated OS subsidized by data. And linux is free! I really wish linux will be around on desktops for a very long time and thanks to this recent experience, I will dread the day when Windows becomes the only available choice for personal computers.
> There is no intuitive way to open bash in a terminal.
I have the new Windows terminal setup to open the WSL2 Linux bash shell by default (and have it set so I can optionally use git bash if I need a shell in the Windows world).
Though a great way to use WSL2 is with Docker, which will leverage it for Linux environments instead of using a virtual machine (which it would do if WSL2 wasn't there). It's quite nice.
> You get a lot of that on Mac though (well, less so on the gaming front, but Macs have some apps that aren't on Windows too). But that's "real" Linux, so you don't have to spend time installing GNU tooling or fighting with brew.
So instead I can run IntelliJ under WSL2? Nope, not until there's a performant X server. Ok, so under Windows, pointed at my Linux filesystem? Wouldn't there be dos2unix file format issues there? And it sounds like it's painfully slow for now until they fix the networking.
But this is somehow better than having to "brew install" a few things? I'm very eager to try this out, but I think WSL3 might be a better starting point.
> So instead I can run IntelliJ under WSL2? Nope, not until there's a performant X server. Ok, so under Windows, pointed at my Linux filesystem? Wouldn't there be dos2unix file format issues there? And it sounds like it's painfully slow for now until they fix the networking.
What would the dos2unix issues be? Intellij on Windows can deal with and preserve all three line ending types, so it's not clear what the issue would be.
Can't say I've noticed any significant issues on performance. It does complain about filesystem case sensitivity (every time!), but it works pretty well overall.
> And it sounds like it's painfully slow for now until they fix the networking.
That will depend on the size of the project. If you're dealing with tens of thousands of files, yeah. In JS-land the problem comes around node_modules folder. BUt a few hundreds or even thousands of files would be okay. Reads are actually quite fast (using ack/ag from Linux to search Windows isn't bad), it's writes that are awful.
Also there won't need to be a performant X Server. The solution they're working on is using a seemless RDP window, where everything works (including drag and drop between the Linux app and Windows)
Very good points! Rebooting is so fast these days it isn't an issue, but I also only use Windows for gaming so I'm not rebooting a ton (twice a day at most). As far as Linux gaming has come it's still not there yet.
Incompatible hardware/software are definitely a real problem that probably affect a large enough percentage of people unfortunately.
> Rebooting is so fast these days it isn't an issue
Rebooting still means you can't do both things at once. And even if its instant, losing all my state is annoying. Sure, a proper window manager can restore state, and a good tab manager will preserve those too, but its a freagin pain in the ass. Plus the pre-boot sequence is slower than the actual OS booting, so I still consider that a pain.
Maybe I'm petty (to each their own), but rebooting once a week would drive me nuts, nevermind once a day.
Using Windows only for gaming means there is not a lot to gain from having work things opened while having the game running.
If you are going to use Windows for work alongside gaming, wouldn't game launching being so convenient affect your focus?
Also, if you even think about compilation/rendering, if those are supposed to take long enough to complete so as to let you game long enough, wouldn't the game also use some of the system resources, maybe just enough to make the work even longer to complete?
Probably depends on the game you play. I like to hack on some code while waiting for groups to form in MMOs for example.
And I'm not building 10 million lines of C++ on the side. For moderate sized apps (<100k LoC) in higher level languages (JS, Java, Python), building and/or running the code is mostly unaffected. While actually going through the code with grep or ag, cloning repos, reviewing PRs, making a commit, those aren't super CPU intensive.
And well, my gaming machine is so far beyond the macbook pros my employer provides, it's still going to be faster by a factor, game or not.
Lastly, even if there was a significant perf impact, being able to close the game and immediately fire up a terminal is still a lot better context switching experience than having to go through a reboot cycle.
That was actually part of it for me as well. Just running what you need in i3 is super productive. Windows is for gaming, with the occasional quick SSH to get something done (mintty though, Windows Terminal is slower for me).
it's not just windows per say, the fact that you can have multiple linux installations without going through the hassle of setting up something like vmware or virtualbox (with all of their quirks) is such a timesaver.
Note to readers: This is for the old way of running GUI Apps on WSL and is not the new, more integrated approach that Microsoft is working on and announced at BUILD.
I have been using the wsl2 for a while now as a primary dev environment and so far it has been a great experience.
Compared to wsl1, everything from nginx to mongo, docker etc. works out of the box and isn't a pain anymore.
I've had issues (loosing network until reboot) with VPNs, core isolation and something, somewhere, in the way windows was managing routes and vswitch nat. But it has been fine since the recent 2004 update.
Quite surprisingly, VcXsrv works very well as well out of the box. No additional configuration to what's mentioned in the article has been needed.
Running a full GUI is a bit over the top but being able to run Linux GUI apps is sometimes a must.
This setup is all I've been asking for a long time and is worth trying to anyone who devs on Linux but wants to run windows as everyday OS.
IME Docker for Windows works pretty well with WSL2. it just mounts the socket file into the WSL2 instance from the Docker instance, for most purposes it's pretty seemless.
There are some oddness with things like `--net=host` as the daemon is running in effectively another VM, but for standard Docker workflows it's been fine.
Startup time for Docker is about 15 seconds, compared to Linux which is immediate. You're also going to get additional slowness because Docker is running inside another VM.
I was referring to the actual Docker service startup time for Windows. Once it is started, of course it is going to be much faster. I'm getting half that on Linux on an computer from 2012.
> it has replaced an always on Linux VM for me (well, it is an always on Linux VM for me).
Here's a question I've been dying to ask someone who admits this is just a VM: What makes it better than running VirtualBox or VMWare Workstation, and having a nice GUI to control the various elements of the virtualization settings?
The major benefits over a fully managed VM from my exp. with it have been
- easy integration with the Windows filesystem (it's automounted into the WSL env)
- Using VS Code to work with files in the WSL2 env. works out of the box (just type `code .` in a WSL windows)
- It's very quick to spin up new WSL2 instances. you can just use `--import` and it'll bring in a tarball to create your new instance. You can even export a Docker image and use that as a WSL instance base filesystem which is handy.
- Docker for Windows works pretty well for most usecases and you get one shared Docker instance across all your WSL setups.
Sure I could do all that with discrete managed VMs but this is easier
Do you know if docker and minikube work inside wsl2? I loaned my only windows machine to a colleague and won't get it back for a week or two, otherwise I would check it out myself.
OP here, there is a doc from Microsoft that talks about the changes from WSL1->WSL2, and WSL2 IS a VM. The reason it's "better" than VirtualBox or VMWare is that it's "optimized" for Windows. Which seems like a vague way of saying it uses their proprietary Hyper-V VM. I think what you're saying is true though. If you want to have fine-tuned controls, I feel like VirtualBox is nicer. I don't actually know whether or not you can go into the Hyper-V settings and manipulate memory or vCPU at all... maybe worth investigating.
It feels like part of Windows. It may not quite be there yet, but your drives just appear, you can pipe back and forth, start programs from/within either subsystem.
A VM has always felt a little cumbersome, even with all of the integrations working correctly.
It's just "there", hard to explain but the fact it's a VM is completely hidden, it's so well integrated I have a hard job believing it really is a VM now. I often shutdown WSL2 completely and when I open a bash shell back into it, it just springs into life, just a couple of seconds and it's back
Both VirtualBox and VMWare Workstation are type 2 hypervisors i.e. hosted hypervisors. This means they run on top of Windows for the most part. WSL 2 runs on Hyper-V, which is a type 1 hypervisor and therefore tends to be much more performant in practice. The integration with Windows is also much better, and the startup times are so fast it can be hard to believe it's a VM. So I wouldn't necessarily call it "just a VM".
For things that lots of people do I find it OK. But whenever I'm resorting to a less frequently used chain of technologies, I find WSL to turn into a pain in the ass of sharp edges.
When it comes to user friendliness and things "just working", it's easily the worst choice you could make.
Once Microsoft's native WSL GUI integration is in place I am probably going to abort using Fedora as my primary and just use Windows. I've been avoiding WSL because the Windows to WSL FS performance wasn't good enough but I think soon that will not be a problem.
I'm just not seeing a good reason to stay Linux-native and I've been Linux-native for 10+ years now.
Note that this uses an x11 server on windows and simply setting it as the DISPLAY. It works but I found things to be slow. You can use it if you must but not a pleasant experience.
Apparently the integration Microsoft is working on uses RDP but with some magic or whatever to avoid tcp overhead? Maybe shared memory?
I hope it turns out performant cause the x11 method is like a party trick at best.
I believe there is a way to connect to WSL2 using RDP instead of an X server. I think I tried this before, but for some reason my setup was laggier than just using the X server.
WSL2 & VSCode have completely replaced Virtualbox/Vagrant/SublimeText for me.
The WSL2 Linux VM runs on Hyper-V, BESIDE windows, not on top of it. So the VM is fast and i/o is fast.
VSCode has a WSL2 plugin which enables it to operate in client/server mode with server running in Linux and client on Windows (seamless to end user). The setup works really well.
I've tried the GUI approach described in this post but there's a noticeable latency in GUI apps running in the VM. Microsoft has announced a new approach they're trying out so let's see how that plays out.
We use OpenFOAM for a lot of our CFD needs in my University’s Engineering department. Most students have Windows laptops. When it comes to final year projects (especially in COVID times where we can’t guarantee lab access) WSL has proven very useful for getting students up and running easily enough without the need for graphical software. It’s easy to access files in \\wsl$ for ParaView etc.
>According to a W3Techs survey, Unix operating systems (the under-pinning OS of Linux, as well as MacOS) make up 71% of the Web, the remaining 29% being Windows. Additionally, every Android phone, tablet and smart TV runs on a modified version of the Linux kernel. So, I guess if you can't beat 'em, join 'em?
I'm not sure what he's trying to say here. unix based operating systems are gaining market share, so microsoft is adding support to stay relevant? The main problem is that most of the growth is coming from mobile/embedded devices, where the platform is so walled off to the user that it really doesn't matter whether the kernel is unix-like or not.
If anyone prefers video about 6 months ago I recorded https://www.youtube.com/watch?v=idW-an99TAM which is about a 30 minute drive by of setting up WSL 2 + Docker + VcXsrv and a bunch of other tools that are handy on Windows for web development.
While this is interesting, WSL2 is getting suppport for graphical applications integrated right into the Windows desktop/taskbar - so unless you absolutely must have the desktop environment, this won't be necessary anymore. Good in the short term though!
Ever since it came out I've asking myself why is it called "Windows subsystem for Linux"?! Isn't Linux that's actually running as a SUBsystem, since Windows is the host?!
Some stupid rules (probably around patents) prevent them for starting the name of the project with the word Linux. Since they own the Windows brand, they can start the name of the project with that.
Yeah, this drives me nuts. Even if they can't use Linux at the start of the project name for copyright rules or whatever there must be another name that isn't the exact opposite of what it is.
I was a little confused about the broken heart emoji in the title. I kept hunting for the big "... all this sounds fine and dandy BUT..." but think it was just a small mistake.
Article did not cover the "Why" question. WSL solves the problem of using Windows while still having a fast Linux/Docker development environment always at your fingertips. I'd understand the "because it's there" argument, which is a really great reason to do just about anything. But is there any other reason why you would need to use a Linux GUI on top of Windows?
Because if there is something that you can do from an actual Linux install (VM or otherwise), and not WSL, then WSL is not a complete solution, and most devs will see it as such, whether they have a pressing need to run gui apps or not. If it can't, then it's not real.
Definitely. I was totally put off by wsl1 when I could apt install foo, but foo wouldn’t run because shim X was missing. For one, no haskell based apps was working in the beginning, full stop. I also had problems with git-lfs losing files somehow. I stopped using it as fast as I could hit ctrl-D.
Personally, it's because Linux is a wonderful development environment that meets my needs better than windows. Plus emacs (and most linux-first editors, for that matter) is lightyears faster on wsl than on the native windows builds.
The only issue is with WSL I'm limited to console apps, so if I want to build an OpenGL or Vulkan or GUI project, I have to use Visual Studio or VSCode if I want a good development experience, and even then, it's not quite as comfy.
I can only hope that with better GUI support comes some kind of GPU passthrough, but a woman can only hope.
That Chart, the ratio of Linux vs Windows used for web serving has remained remarkably stable for the last 20+ years despite the rapid growth, and technology churn
That excuses MS how? MS is so big, that the left hand there doesn't know what the right one is doing. Some contribute to good things, others are toxic and spread lock-in. And their gaming division is in the later category.
It's called those who slow down progress with their despicable "business practice". Though explaining it to you is pointless - you very consistently support lock-in and the damage it's causing, whitewashing it as "that's what industry does", as if that was ever a valid excuse.
I never thought I would see the day I prefer Windows to OSX AND Linux for a development environment, but that day has come.
I am ASTOUNDED by how well WSL2 works, especially when integrated with VSCode.
For a much better terminal experience, I recommend Windows Terminal. Easy to configure, works great.