I'm using Docker Toolbox, recently I got to know about the Docker installation using WSL 2.
What are the differences between Hyper-V and WSL 2? Which has better performance?
I'm using Docker Toolbox, recently I got to know about the Docker installation using WSL 2.
What are the differences between Hyper-V and WSL 2? Which has better performance?
Please read this: https://www.docker.com/blog/docker-hearts-wsl-2/
We will replace the Hyper-V VM we currently use by a WSL 2 integration package. This package will provide the same features as the current Docker Desktop VM: Kubernetes 1-click setup, automatic updates, transparent HTTP proxy configuration, access to the daemon from Windows, transparent bind mounts of Windows files, and more.
A technical preview of Docker Desktop for WSL 2 will be available for download in July. It will run side by side with the current version of Docker Desktop, so you can continue to work safely on your existing projects. If you are running the latest Windows Insider build, you will be able to experience this first hand. In the coming months, we will add more features until the WSL 2 architecture is used in Docker Desktop for everyone running a compatible version of Windows.
Additionally I recommend to watch this video: https://www.youtube.com/watch?v=lwhMThePdIo
Good comparison you will find here: https://blog.logrocket.com/working-with-node-js-on-hyper-v-and-wsl2/
cite:
Comparing Hyper-V to WSL2
The biggest difference between running Ubuntu Linux in a Hyper-V virtual machine versus running the operating system in WSL2 lies in the ability to access the Ubuntu user interface in Hyper-V.
The user interface allows you to install and use more than just command-line tools.
Depending on your system’s hardware performance, you likely found that WSL2 is the faster option. To expedite the process of running Ubuntu Linux on Hyper-V, you could set up SSH access to the virtual machine.
This speeds up command-line access. However, WSL2 may still have the upper hand since it does not require SSH to enable access.
Hyper-V and WSL2 (WSL2 runs on Virtual Machine Platform, the name of Hyper-V's architecture packaged separately and made available to all SKUs) could have negative interactions with other VM solutions, for example VirtualBox v5 and under will not coexist with Hyper-V. As of VirtualBox v6+ there is support to run VirtualBox in a configuration to replace its own virtualization with that of Hyper-V paravirtualization. In the recent past there are reports that 'performance will be worse' as outlined in Use VirtualBox and Hyper-V simultaneously. If this is of particular interest to you, I'd encourage you to research what progress has been made on that front.
When people judge WSL2 as being "faster" they're typically talking about setup time being easier and thus faster. Actual performance depends on how many presets and customizations were made for WSL2's Hyper-V instance but more importantly, it depends on your use cases.
If you're ONLY using docker:
WSL2
If you require Linux, additional VMs or want access to Docker's Advanced tab for resource allocation:
Hyper-V
Final Note:
Although Hyper-V is officially unsupported for Windows 10 Home edition and is stated so throughout published material, there is a proposed way to enable it which can be found in this MicrosoftDocs Virtualization-Documentation issue posting. While I am unable to comment on how well it works or if it works at all, there are guides available if you wish to try.
Windows subsystem for linux 2 is a virtual machine for operating Linux. It initiallizes minimal hyper-v toolkit for booting Linux kernel. And hyper-v is virtualization software that can be used to virtualize other operating systems as well as Linux distros. The file sharing, command line, and networking between your Windows machine and the WSL2 environment is instant on launch. You do not have to manage this environment because it will update alongside Windows. If you don't want to virtualize other operating systems rather than linux, then uninstall hyper-v and choose wsl2 because hyper-v doesn't let other applications use virtualized hardware environment.
if you have WSL 2 installed, you can't use hosted VM platforms like virtualbox
.. that's not true for me .. when Hyper-V installed Vbox stopped working! And with WSL2 I think you can't Dockerize Windows Applications .. which this answer mentions
Apr 17, 2021 at 2:38
What are the differences between Hyper-V and WSL 2
On MS Windows 10, one difference is the system requirement: WSL 2 backend requires a more recent version of Windows 10. Specifically: