preface

Recently, I am learning docker-related knowledge and need to practice in the Linux environment. At the beginning, I built a virtual machine with VMware, but my computer was overwhelmed with the speed, you know…

Then I thought of WSL (Windows Subsystem Linux), which is used for Linux. I used CentOS, so I tried to deploy docker in WSL, but docker was not supported. WSL is an emasculated Linux environment, and many things are not supported. Later I went to the official website to check, it turns out that WSL2 was released last year, which can support Docker and even GPU computing, and can directly carry out AI-related development on Windows, which is not too cool!

WSL Microsoft Official documentation: docs.microsoft.com/zh-cn/windo…

advantages

  1. WSL2 is easy to install by following the official documentation and supports a wide variety of Linux systems.

  1. WSL2 booted very fast, my stupid machine booted in 5 seconds, it was great to use with Windows Terminal.

  2. WSL2 can deploy docker environment, running Docker is very stable.

  3. WSL2 officially supports Gpus.

disadvantages

  1. Memory and CPU usage are relatively high, which can be controlled by configuration of memory allocation and CPU core allocation, but sometimes the CPU is still up to 90%, I don’t know why.
  2. The IP address of a WSL2 VM changes every time it is restarted. A WSL2 VM is similar to a VMware VM in that it has an independent IP address. (If it is just for personal use, such as practicing docker command, IP change is not important. There are some methods to fix IP on the Internet, but they are very complicated.)
  3. After the IP address changes, the network may fail. If you run or test some applications that access the network, the network may fail.
  4. The performance of reading and writing disks is poor.

conclusion

In addition, if Windows is running with WSL2, the VMware virtual machine will not run, so you have to choose between the two, which is restricted by VMware software.

All in all, it’s a qualitative shift from WSL to WSL2, but there are still a lot of things about WSL2 that aren’t perfect enough to be used as a full Linux system, and if those flaws don’t affect personal use, it’s worth trying.