怎么把wsl1 变成wsl2

  • Post author:
  • Post category:其他


  1. Ensure the distribution runs in WSL 2 mode. WSL can run distributions in both v1 or v2 mode.

    To check the WSL mode, run:

      $ wsl.exe -l -v
    

    To upgrade your existing Linux distro to v2, run:

     $ wsl.exe --set-version (distro name) 2
    

    To set v2 as the default version for future installations, run:

     $ wsl.exe --set-default-version 2
    
  2. When Docker Desktop starts, go to

    Settings

    >

    Resources

    >

    WSL Integration

    .

    The Docker-WSL integration is enabled on your default WSL distribution. To change your default WSL distro, run

    wsl --set-default <distro name>

    For example, to set Ubuntu as your default WSL distro, run:

     $ wsl --set-default ubuntu
    

    Optionally, select any additional distributions you would like to enable the Docker-WSL integration on.



版权声明:本文为qq_52813185原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。