zl程序教程

您现在的位置是:首页 >  其它

当前栏目

怎么把wsl1 变成wsl2

怎么 变成 wsl2
2023-09-14 09:09:45 时间

  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.