I have WSL (Linux subsystem on Windows 10) installed with ubuntu 21.04 (not from the store, it's the first version that appeared on Windows 10), how can I migrate to version 2 (with an actual kernel) while keeping all my files (system and user), if possible without reinstalling everything ?
EDIT wsl -l -v gives:
NAME STATE VERSION
* Legacy Running 1
Ubuntu-20.04 Stopped 2
Which is WSL 1. I would like to go to WSL 2.
wsl --set-default-version 2. Full Documentation Here. What part of the process are you stuck on exactly? – Ramhound Nov 02 '21 at 19:47wsl --set-default-version 2and then starting the instance? – Ramhound Nov 02 '21 at 23:38uname -rstill gives "4.4.0-19041-Microsoft" (ie., WSL 1). – Soleil Nov 02 '21 at 23:41wsl -l -v. Ifwsl --set-default-version 2does "nothing" then you have forgotten to install something. Just to confirm you are running 21H1+? – Ramhound Nov 02 '21 at 23:44Ubuntu 2you have an instance calledUbuntu-20.04which is already WLS2 by the way. It is currently NOT running. – Ramhound Nov 02 '21 at 23:47wsl -l -vsays Legacy is "version 1" is very misleading. – It's not! The response should have said "version 0" or "version beta" or something else that clarifies that Legacy is pre version 1. This also explains why this answer got it all wrong. Given the title WSL 1 to 2 migration, that answer is perfectly fine. One has to know that Legacy is a special case in order to understand and answer your question correctly. – Henke - Нава́льный П с м Aug 05 '22 at 12:09wsl -l -v). – Soleil Aug 07 '22 at 22:32