5 ms·
You can launch into a WSL shell in seconds without having to wait for a VM to spin up. WSL doesn't run the full slew of linux processes and uses the same memory
by simonh 5y ago
You can launch into a WSL shell in seconds without having to wait for a VM to spin up. WSL doesn't run the full slew of linux processes and uses the same memory space, so both CPU and memory utilisation is much lower than a VM. You don't need to contend with all the fiddly configuration parameters and config of VM software, and it integrates into the Windows environment by default, again without fiddly configuration.
If you're doing sysadmin work or web development, and need to run Windows software as well or are on hardware with better Windows support, it's hard to see why you wouldn't use WSL.
To your point on total control of the emulation, not everybody needs that. If your use case means you need a real Linux OS environment, then sure, WSL isn't for you.
- yakubin 5y ago> You can launch into a WSL shell in seconds without having to wait for a VM to spin up. Serious question: how long does it take to spin up a VM on Windows then? Does it take seconds? (Not disputing your other points.)
- tehbeard 5y agoFor a "cloud image" I have in virtualbox (so no gui) for testing cloud-init/ansible, about 15-20 seconds. WSL1 takes about a second, and I'm pretty sure most of that is the init script that spits out network/update info.
- TheRealDunkirk 5y ago> WSL doesn't run the full slew of linux processes and uses the same memory space, so both CPU and memory utilisation is much lower than a VM. Well, I thought this was the case with WSL, but that WSL2 changed this, such that it's really just a full-blown VM now. Are you saying that you're still using WSL 1, or have I misunderstood the nature of WSL2?
- jve 5y agoWSL2 still runs instantly. I haven't been bothered with waiting. I tried wsl --shutdown and then opening wsl - didn't take a second. Cold boot may have been longer, but I don't remember being bothered with startup times. However older powershell console startup time did bother me for sure.
- alxlaz 5y agoNeither :-). WSL2 runs a full-blown machine but the startup process is considerably different from that of a real machine with a real Linux installation, so when you "start up" a WSL2 shell, it's spawned in seconds, you're already logged in and so on. It's essentially the WSL1 presentation format but with a different back-end.
- deleted 5y ago[deleted]
- deleted 5y ago[deleted]
- girvo 5y agoThough my Ubuntu VM on Hyper-V with multipass giving the Microsoft Terminal integration started up basically just as fast, to be honest. But the deeper integration and lighter underlying OS for WSL2 is better, especially for Docker dev container usage with VSCode.
- vbezhenar 5y ago> You can launch into a WSL shell in seconds without having to wait for a VM to spin up. Start VM in background at boot time and ssh in milliseconds when necessary. > WSL doesn't run the full slew of linux processes I don't know what linux processes are you talking about, but minimal Linux ram consumption is something like 50 MB, that's hardly noticeable. > uses the same memory space RAM ballooning is available in VirtualBox or Vmware for years. > CPU utilisation is much lower than a VM I don't think that's true. There's no inherent CPU utilization in Linux (and WSL2 is VM). > You don't need to contend with all the fiddly configuration parameters and config of VM software, and it integrates into the Windows environment by default, again without fiddly configuration. And that's probably the main reason why WSL is so popular. Installing VM software, creating virtual machine with proper configuration, installing guest tools, configuring it to start/stop at host OS boot/shutdown, configuring shortcuts for ssh is out of reach for most developers and power users. WSL just simplified that process. Probably could be implemented with some wrappers around VBoxManage years ago, but nobody understood the problem.
- allendoerfer 5y ago> Probably could be implemented with some wrappers around VBoxManage years ago, but nobody understood the problem. I'd say vagrant did something in that area.
- NikolaNovak 5y agoInteresting; different perspectives I suppose; not the OP, but for myself too VM always seemed an easier and cleaner solution: 1. Isn't WSL2 now actually a VM too? My biggest deal breaker with WSL2 is that it moves my main Windows into now a parent VM over the Type 1 hypervisor; making everything else in my main Windows just that little bit wonkier. Worse, this information isn't as readily easily grokkable as I feel it should be. I.e. if somebody isn't comfortable installing a clean, separate VM in Virtualbox, they may be even less aware of consequences of moving their main Windows installation into a VM now. 2.Re fiddliness: Installing Ubuntu into VIrtualbox has always seemed trivially easy; and there's any number of downloadable pre-built images from safe sources. Whereas figuring out how to access Windows filesystem from WSL2 and vice versa; let alone installing GUI tools - always seemed completely opaque to me with any number of half-built, quarter-supported guides and solutions out there. And I never seem to know or guess correctly what subset of Linux functionality will or will not work, normally or differently.