以下是列表:
aaa@2UL:~$ wsl.exe --list --verbose
NAME STATE VERSION
* Ubuntu-20.04 Running 1 <------------note - this is version one
docker-desktop-data Running 2
docker-desktop Running 2
当我docker ps
在 bash 中运行时,我得到:
The command 'docker' could not be found in this WSL 1 distro.
We recommend to convert this distro to WSL 2 and activate
the WSL integration in Docker Desktop settings.
这是我的 Windows 信息:
Edition Windows 10 Home
Version 21H1
Installed on 10/07/2021
OS build 19043.928
Experience Windows Feature Experience Pack 120.2212.551.0
该命令无效:wsl --set-default-version 2
我希望能够从 ubuntu 访问 docker,怎样做?
更新
当我运行时:wsl.exe --set-version Ubuntu-20.04 2
什么也没有发生。这是输出:
Conversion in progress, this may take a few minutes...
For information on key differences with WSL 2 please visit https://aka.ms/wsl2
The Windows Subsystem for Linux instance has terminated.
Press any key to continue...
谢谢
答案1
你试一试:
wsl.exe --set-version Ubuntu-20.04 2
确保从命令提示符 (CMD) 或 Powershell 运行此命令。