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

Thanks. I had looked at that reference originally too but it does a lot of things unrelated to running Docker on WSL 2 and overcomplicates running Docker.

Realistically getting Docker to run on WSL 2 involves running a few standard install steps from Docker for installing Docker and Docker Compose v2 on Linux (such as Ubuntu, Debian or whatever distro you prefer) and then adding a 3 line shell script to your ~/.profile to ensure the init.d based Docker service starts when your WSL 2 process starts -- that's it.

I've been running this set up for months, it's super solid.



thats basically what I do... I didn't even realize there was the 'service' thing till a few months ago. Login, start the daemon, and go :-)


Does this method still require hyper-v?


If you can run WSL 2 then you can use this method.

I personally run Windows 10 Pro which does have Hyper-V enabled (I use Hyper-V for standalone VMs unrelated to Docker) so I can't disable it to check for you but I'd say I'm 99.99% sure it'll work without Hyper-V because this is focused on running an application (Docker) inside of a WSL 2 environment. If WSL 2 is available to run then Docker can run in it because WSL 2 is providing the Linux environment. There is no separate VM running Docker.

Try it out and let us know.


WSL2 definitely works on Windows 10 Home, which doesn't have Hyper-V. My understanding is that they split off the VM functionality needed for WSL2 into the "Virtual Machine Platform" feature so that pro+ is no longer required.


That's the important question really. If it still requires a vm, then there is almost no difference between methods.


Where I really need docker, I also need VMware workstation more. It’s been a limiting factor for me. Was asking to ensure this wasn’t some trickery but sounds promising. I already have WSL working just didn’t think to try docker in that layer!


VMware and hyper-v have both worked on the same machine for some time now. since v15 or v14.




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

Search: