WSL 不會切換到 WSL2,忽略指令

WSL 不會切換到 WSL2,忽略指令

我正在執行 Windows Server 2019 預覽版,版本 2004,內部版本 20262.1000

我已經安裝了 WSL,包括 Ubuntu 發行版。該wsl --help命令完美地列出了--set-default-version <Version>--set-version <Distro> <Version>命令。

但是,當我執行任何<Version>設定為 2 的命令時,它似乎完全忽略該命令並僅列印幫助文件。它甚至沒有說Invalid command line option:,只是打印幫助。

它似乎完全了解該命令,在指定其他版本(如 1、3、4 等)時拋出錯誤。

例子:

PS C:\Users\Administrator> wsl -l -v
  NAME      STATE           VERSION
* Ubuntu    Stopped         1
PS C:\Users\Administrator> wsl --set-version Ubuntu 1
Conversion in progress, this may take a few minutes...
No such interface supported
PS C:\Users\Administrator> wsl --set-version Ubuntu 4
A version number could not be parsed.
PS C:\Users\Administrator> wsl --set-version Ubuntu 2
Copyright (c) Microsoft Corporation. All rights reserved.

Usage: wsl.exe [Argument] [Options...] [CommandLine]

Arguments for running Linux binaries:

    If no command line is provided, wsl.exe launches the default shell.

    --exec, -e <CommandLine>
        Execute the specified command without using the default Linux shell.

    --
        Pass the remaining command line as is.

Options:
... [rest of help file] ...

同樣的事情--set-default-version

PS C:\Users\Administrator> wsl --set-default-version 2
Copyright (c) Microsoft Corporation. All rights reserved.

Usage: wsl.exe [Argument] [Options...] [CommandLine]

Arguments for running Linux binaries:
...

如何開始在 Windows Server 安裝上使用 WSL2?

答案1

我相信您必須將 Windows 版本更新到 202011 或更高版本。嘗試加入內部計劃以獲取此版本,更新後它將正常工作。

相關內容