9 ms·
I don't really understand the use case for WSL. What are the advantages? You could run a full Linux VM and do everything on it on any machine these days. Which
by bserge 6y ago
I don't really understand the use case for WSL. What are the advantages? You could run a full Linux VM and do everything on it on any machine these days. Which is what I do, but I'm just an old school hack. Anyone who uses WSL care to enlighten me? Thanks!
- syshum 6y agoLower overhead, and full integration with the host filesystem I believe are the 2 primary reasons many use it
- pjmlp 6y agoTo sell Windows laptops to the same crowd that buys Apple laptops to develop GNU/Linux software, instead of supporting Linux OEMs, and are unhappy that Apple only cares about developers on Apple ecosystem. Microsoft understood that they only care about having some kind of POSIX support, and nowadays being Linux compatible is more relevant than straight POSIX, as the BSDs and IllumniOS also found out with their compatibility layers.
- jevgeni 6y agoOr, alternatively, a crowd whose needs aren’t completely met by Linux.
- pjmlp 6y agoThen why they develop GNU/Linux software to start with?
- detaro 6y agoBecause their needs aren't met by developing Windows or macOS software?
- pjmlp 6y agoThen again why they don't support GNU/Linux vendors?
- Dylan16807 6y agoSo if someone installs Linux themselves they don't meet this bar you're setting? That seems pretty far from the normal open source ethos.
- pjmlp 6y agoAh, so using evil commercial OSes is part of that so called ethos?
- Dylan16807 6y agoNo, installing your own OS is very open source.
- pjmlp 6y agoWhich isn't a thing with macOS and Windows, so where is that ethos again?
- Dylan16807 6y agoYou were confused why people would do things with GNU/Linux without "supporting GNU/Linux vendors". But that's restricting it to people that use the preinstalled OS, which is strange, because of how fitting it is to install your own copy of GNU/Linux.
- jevgeni 6y ago"Yes, you see, you're only free if you do exactly what we tell you." Also, it's a thing on Windows/PCs.
- 6y ago
- pram 6y agoPeople might get paid money to develop (proprietary!) software that deploys to Linux. That doesn't mean they enjoy using Linux.
- pjmlp 6y agoIndeed, I have been doing that for years and am yet to install WSL.
- jevgeni 6y agoOne reason might be, is that they might need to in part work with a server-side system that runs on Linux and it’s easier this way. But maybe they also need to work with stuff thats Windows only. Say they need to produce media assets with the Adobe suite. Not everything is vimmable.
- pjmlp 6y agoSSH and X Windows servers also exist for Windows.
- jevgeni 6y agoIt takes me 2 minutes to install WSL Ubuntu. Or I could spend half a day on figuring out a hacky solution to a Windows/SSH/XWindows workflow that offers even a comparable level of integration. It will grow into weeks of obsessive tweaking until I feel compelled to write a blog post for HN where I show my sick setup and hours and hours I dumped into this, while meaningful work piled up in my TODOs. ... Or I could just install WSL.
- pjmlp 6y agoOr just install Humming Bird, working just fine for me since 2000.
- whenitrains 6y agoOr just install WSL? What's the problem with Microsoft having an answer to this?
- pjmlp 6y agoIn what concerns Microsoft, I praise them for having acknowledged the strategy error that was not giving the UNIX subsystem the same love as Win32. Because as proven by macOS and now WSL adoption, GNU/Linux would never have taken off if PCs already had a mature set of POSIX toys, given that its users care 0% about GNU/Linux, and would be deploying to HP-UX, Solaris, Aix, Irix, Tru64 just as well.
- flohofwoe 6y agoI guess you'll have to use it to "believe" ;) Setup is much less hassle, startup is much faster (one or two seconds) and resource usage is much lower than running Linux in a VM. Also little things like VScode (running as Windows UI application) automatically detecting WSL and setting itself up to connect to the WSL side. To do the same for a VM requires at least to configure the SSL ports on the VM.
- omk 6y agoBeing light-weight won it for me. And the hassle free setup to use the same disk on both environments.
- tikkabhuna 6y agoDocker for Windows using WSL2 as its engine is also nice. The Docker commands somehow (magically) get added to your Linux distro and you can mix and match how you like.
- umvi 6y agoWhen I launch my WSL2 Ubuntu shell, I have a CLI prompt in < 1 second. Clipboard works perfectly since it is a window similar to PowerShell, my windows file system is mounted in under /mnt, and generally everything is lighting fast. Getting that same quality of experience under VirtualBox was nightmarish. Longer boot times, shared clipboard/filesystems were always breaking, random stuff related to hardening made update difficult.
- sam_lowry_ 6y ago>Clipboard works perfectly Which one? Secondary? And the primary does not work at all?
- pydry 6y agoOther than the startup time (mitigated by starting the VM right after startup) I have no issues with virtualbox. File mounts, copy & paste... everything works more or less fine. WSL, on the other hand, has been nothing but trouble.
- jayflux 6y agoIt's very useful for projects that require (or work better in) a linux environment. I don't want to start up a full linux VM, that sounds like a lot of overhead and I'm more likely to not bother at all. WSL is much lighter than that (we're not talking virtualbox here), if I open windows terminal its up and running, there's almost-zero start up cost. With VSCode I can switch between working in WSL and windows easily, without needing a desktop GUI to write code in. There's no startup cost, I'm immediately in the correct environment for that project. I've found it very useful since it came out.
- BlueTemplar 6y agoYou've not explained why you would not run a native Linux system in the first place…
- easton 6y agoOffice, which doesn’t have a good replacement on the web or on Linux.
- BlueTemplar 6y agoWhat is inadequate about Libre Office ?
- ojnabieoot 6y agoCalc is really not an adequate substitute for Excel if you need to use VBA macros - which might be coming from your customers! And in the wild I see plenty of older Excel documents (before 97) which I don’t think are compatible with LibreOffice. Obviously this isn’t an ideal situation but historical data around prices/etc from the 90s are often stored as old Excel binaries. In general I think using Calc (or Google Sheets) instead of Excel is a bad idea for a business. Word processing and spreadsheets - sure (although there might be some things specific to Word/PPT that I am not aware of). But Excel is a very specific piece of software and should not be thought of as a general “spreadsheet tool.”
- Reventlov 6y agoI have been teaching computer related classes to uni students for some time. Most of them run Windows. Running a virtual machine often means accessing the UEFI to be sure they have virtualization extensions enabled. And many of them have shitty personal laptops, which means running a VM will really slow the "Linux" experience. Sharing files between the host and the guest is also sometimes tricky, and I don't want to force them to install another OS on their personal laptops. WSL is nice in that it allows them to have a bit of Linux world without being very intrusive, and runs better than virtual machines on many of their laptops. I'm what is called a "vacataire", which means I'm also not in the position of asking the school IT departement to enable stuff on the computers for the classes…
- temac 6y ago> Running a virtual machine often means accessing the UEFI to be sure they have virtualization extensions enabled. Likewise for WSL2. I hope modern computers with a capable processor are all shipped with virtualization enable at firmware level, because Hyper-V can be used for tons of things in recent Windows.
- proactivesvcs 6y agoEnabling hardware virtualisation opens up a significant and deep attack surface. Considering the vanishingly small percentage of users which benefit from it, I hope it stays off by default.
- jrockway 6y agoWindows is moving to a model where Windows itself is run as a virtualized OS. I believe this is enabled by default in new installs. So having a Linux VM in Hyper-V isn't opening up much new attack surface.
- ylor 6y agoFirst I hear of this. Source? Googling for this predictably returned unhelpful results.
- sdoering 6y agoTo chime in. The company I work for has (after being acquired by Accenture) implemented "Endpoint Management" for all machines (read monitoring and spyware). EPM prohibits us from creating virtual machines, but WSL2 is possible. So a lot of devs at our shop (at least the 5% or so who are using WIN) use this setup. Personally - I do this on my private machine - I switched, because with the EPM software I wanted to separate my work machine from my private efforts, as I just do not like Accenture to be able to read all mails, read all files and install arbitrary software on a machine that I have private data on. Before we got acquired my employer allowed private use, we were admins on the machines and there was no spyware installed - so only using one machine for work and private stuff was feasible.
- herdcall 6y agoI used to do all work on Fedora, dual booting to Windows for the Windows apps. WSL was OK when I tried long back, so hadn't bothered. But for the last few months I was forced to try WSL (now WSL2) again due to some Windows work, and have been using the Ubuntu app. I've got to say I'm now a believer and don't scoff anymore. I can now do ALL my work without problems on WSL2: mainly Go/C++/Dart, containers (podman/buildah), Flutter, GRPC, etc. The added beauty is that you can go seamlessly between Windows and Linux apps: e.g., you can just run an .exe from the BASH command line in WSL2 just as you run an Linux command. It's insane how they did it, and you have to try it to experience it. There are some issues still: GUI apps are still a pain to set up (but they're fixing this), there are some networking issues (e.g., accessing servers running on Linux), file path issues on some apps (like I guess git here), etc. I never personally experienced any of the git issues cited, and I use it regularly from the Ubuntu command line. Overall, I very highly recommend WSL2 now, Microsoft hit a home run with VSCode with devs and IMO WSL2 is turning out into another.
- mkr-hn 6y agoI can pop open an Ubuntu tab in Microsoft Terminal and use *nix utilities as though they were made for Windows. For example: I could chain some scripts and commands together to process and produce reports on my Ableton Live sets without fussing with host extensions in a VM.
- icegreentea2 6y agoI use a mix of WSL2, and VMs. WSL2 has a few nice properties for some use cases: a) It comes default with some network binding magic (ok, just configuration) that makes your WSL env almost actually behave like localhost. I know you can configure this yourself, but it's nice out of the box. (on the other hand, sometimes is this exactly the opposite of what you want...) b) My main machine is a bit RAM constrained, and WSL2 will "magically" reclaim RAM when I close the consoles (unless I left something running...). Once again, not the biggest win, especially if you spec'd out your machine to run VMs, but still nice. I think WSL2's biggest wins are not for 'full out development'. But it's nice when you need want to jump in and poke at something quickly in Linux land. The startup time for the console/VM is fast enough (~1-2 seconds), and the cleanup is good enough I can quickly jump between, without having a VM actually hanging around all the time. I'm sure the file system integration is useful for some usecases... classic one would be if someone emails you data files or something. You download in your browser in Windows and then can access pretty seamlessly from WSL. I think I would summarize WSL's advantages as being a bunch of little quality of life advantages that are very much suited for Windows dominant workflows that periodically jump into Linux. There are all sorts of other disadvantages though - I would not recommend anyone who has a comfortable VM based workflow to ditch for WSL. An example of an uncomfortably stupid rough edge would be periodically time-desyncing: https://github.com/microsoft/WSL/issues/4149 https://github.com/microsoft/WSL/issues/4149 . I shit you not, my workaround is to manually adjust my linux time forward and back with `sudo date --set "${INCREMENT} seconds" until it gets close enough that OAuth doesn't shit itself.
- shawnz 6y agoHave you tried WSL1? It sounds like it might fit your use cases better: - WSL1 shares the same network interfaces and addresses as the host, no proxying like WSL2 - Significantly less RAM usage - No time sync bug
- icegreentea2 6y agoOh, I use both =P I use WSL2 for some docker based projects.
- 6y ago
- smartmic 6y agoI do not use WSL but see a good reason for WSL. The benefits for the users are superficial but the really big thing is on the business side for Microsoft. With WSL they try to trap more and more Linux developers into their ecosystem. It is all about getting more control of the most talented and fruitful developer minds. In the end Microsoft and its shareholder will benefit if it keeps its hands on this crowd.
- nijave 6y agoBusiness. For better or worse, there are plenty of places where the policy and tech allow WSL but installing a hypervisor on your machine is much more challenging. WSL2 is basically just a Linux VM, though (I think it actually uses Hyper-V containers which seem to occupy some weird space between Linux container and VMs)
- pram 6y agoHyper-V is VMs not containers. When you enable Hyper-V it's actually the 'operating system' and Windows is a guest VM believe it or not.
- pjmlp 6y agoThis is how every type 1 hypervisor works. https://en.wikipedia.org/wiki/Hypervisor https://en.wikipedia.org/wiki/Hypervisor
- Dylan16807 6y agoBut it's not how type 2 hypervisors work, and traditionally when you used virtual machines on a desktop it was type 2.
- pjmlp 6y agoThat was long time ago, most people using VMware also use ESXi, and mainframes use type 1 as well. Just those using Virtual Box for free not.
- Dylan16807 6y ago> most people using VMware also use ESXi Most people using it are also using servers. Is ESXi on desktops/workstations anything other than very niche?
- pjmlp 6y ago
- quaffapint 6y agoDocker. Docker can use WSL2, so it works much nicer and less problematic than when running under standard windows emulation.
- CJefferson 6y agoWSL2 is "just a full Linux VM", just easy to install and integrated nicely with other parts of the OS
- smileybarry 6y agoI just like being able to work in a Windows IDE and compile in a (99%) Linux environment without messing with a VM or mounting shares. Like QMK[1] -- develop in Visual Studio, compile in WSL, flash in QMK Toolbox (Windows). Or in some very specific corner cases, have a Linux-based workflow that suddenly calls into a Win32 utility. In some cases I need to test something that's Linux-only -- an idea or a GitHub project that just doesn't run on Windows -- and it's easier to jump into a WSL console than boot a VM. But on the other hand, I don't do that frequently enough to just keep a VM running all the time. (Plus there's VM idle RAM usage, and I can't use Hyper-V [which can reduce VM RAM] due to host performance concerns) [1] https://github.com/qmk/qmk_firmware https://github.com/qmk/qmk_firmware