Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> 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.


I've not tried it but I don't think minikube would work inside WSL as it needs a VM layer (I suppose technically it could with nested virtualization).

TBH for throwaway Kubernetes cluster in WSL, I'd recommend kind (https://github.com/kubernetes-sigs/kind) it works just fine with WSL/Docker for Windows.


Docker works inside WSL2; it's one of the improvements over WSL1 that MS has been touting.


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.

https://docs.microsoft.com/en-us/windows/wsl/compare-version...


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 balances RAM allocation between Windows and Linux dynamically. That's a major feature. It starts up in 1 second.

One interesting thing is that if you have WSL2 turned on, then Windows runs virtualized as well -- it's just the 'root partition' under Hyper-V.


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".


Basically doesn’t eat all your RAM for nothing so you can have 50 more chrome tabs open.




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: