According to Microsoft WSL2 is way faster than WSL1 for running Linux images. So, why even after upgrade to WSL2 is Linux running slow and with the same IO inefficiency like it was on WSL1?
The reason is simple. Even though the WSL2 was added to the operating system, the old images are running on WSL1. You can verify it by command:
Output:
As you can see both Ubuntu and openSUSE has set version to 1 which means that these images runs on WSL1. It’s necessary to explicitly change the version by following commands:
The conversion will take some time. Output:
Now you can verify the version of WSL for the image:
Simply start the shell of the distribution and you’ll experience better performance.
It’s also possible to set version for future images by command: