But when I start to launch docker, a warning message tells me WSL 1 is installed but not WSL 2.
So how to upgrade from WSL 1 to WSL 2.
First, identify versions of WSL by using :
wsl --list
Result tells me that I use Ubuntu-20.04 and WSL 2 but I still get a warning message that Ubuntu not running under WSL 2.
I found this article from Microsoft Docs : Troubleshooting Windows Subsystem for Linux | Microsoft Docs talking about an error : "Invalid command line option: wsl --set-version Ubuntu 2".
So, secondly, I try to update by using this command :
wsl --set-version Ubuntu-20.04 2
And it works. My Ubuntu 20.04 is now working on WSL2.
Hoping it will help others.