WSL2 Impressions and Issues

My Windows PC received upgrade, which finally officially enabled WSL2. I don’t want re-post everything what is already written about WSL2. But main changes are that now WSL2 works from the Hyper-V layer and its main benefit is the speed of work.

Honestly saying, issues I met with are already covered on Microsoft documentation web-site. But I did not read it before migration and therefore I had to solve them later.

Converting of existing WSL1 to WSL2

I followed instructions and conversion of WSL1 to WSL2 went quite smooth.

Tip: Switch off your real time antivirus agent (including standard Windows antivirus agent) during the process. Then converting process will be much faster.

Improvements

WSL2 works with native Linux applications and it is much faster. Performance of WSL2 is drastically improved. I also without any issues upgraded my Ubuntu 18.04 to Ubuntu 20.04 using standard sudo do-release-upgrade -d.

Some of my Python tools which did not work on WSL1 started working on WSL2. This is great.

Issues and how I fixed them

Slow access to Windows file system

When I was using WSL1, I kept most of my files on Windows file system, and I just symlinked long paths to Windows directories to my home folder in WSL1.

After upgrade I discovered how slow WSL2 opens Windows directories and files. Then I discovered, that WSL2 is connected to Windows file system via network share (Hyper-V VM with WSL2 is connected via some sort of SMB-like share to Windows file system through internal Hyper-V network). Of course SMB access is much much slower, than simple syscall hook used in WSL1. For many simple apps it does not matter, but I have number of projects stored on Git servers. And I am using programs like powerline or starship for providing me more information in my command line (commit hash, number of changed, added, removed files, repository status, etc.).

Prompt modules (advanced ones and even standard git_ps1 for shell) start to slow down command line responsiveness if Git project is located on Windows file system. When project is very large, then command line with git status modules becomes completely unresponsive.

Solution: I just moved all my essential and active project files inside WSL2.

No IPv6

I have Dual Stack (IPv4 and IPv6) network for many years and I got used to the fact, that I can check my IPv6 connectivity from the WSL1 using e.g. ping6. But WSL2 does not support IPv6, therefore if you by some reason depend on IPv6 support - then avoid WSL2 (at least current release).

Because I have number of other native Linux systems at home, at work and in the cloud, loss of IPv6 support on WSL2 was not critical for me.

Solution: If IPv6 support is essential for you, then please keep using WSL1.

Final words

Despite of discovered issues, I am overall happy with WSL2 due to huge performance boost and more correct work with Linux applications.