WSL: wsl --set-default-version 2 err:Invalid command line option

I run command in powershell as adminsitrator:

>Enable-WindowsOptionalFeature -Online -FeatureName VirtualMachinePlatform 
Path          :
Online        : True
RestartNeeded : False

>wsl --set-default-version 2
命令行选项无效: --set-default-version
版权所有 (c) Microsoft Corporation。保留所有权利。
用法: wsl.exe [参数] [选项...] [CommandLine]
....

“命令行选项无效: --set-default-version” means: Invalid command line option -set-default-version. Have I make a mistake?

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Reactions: 14
  • Comments: 17 (3 by maintainers)

Commits related to this issue

Most upvoted comments

WSL2 is currently only available via the Windows Insider Program.

note for future readers the linked installation guides notes: you'll need to be running Windows 10 build 18917 or higher to use WSL 2 .

For this your Insider Programme “Ring” needs to be changed from Default to Fast (Windows Insider Program Settings)

however this comes with associated risks (And inability to downgrade without complete re-install) you should consider these before doing so.

WSL2 is not at the time of writing on earlier builds (afaict) and requires >= 18917

Well… I solved. In my case windows installated 1903 update and windows update tool confirmed it, but! if i call system information than i see that my current build is 10.0.18362 Build 18362. I sovled it by downloading “Windows 10 Media Creation Tool” from https://www.comss.ru/download/page.php?id=3271 it updated my build to 1903 and all cmds now available.

Alternate options as i found is: https://www.groovypost.com/howto/manually-install-windows-10-1903-may-2019-update-now/

Good luck!

1903 is not higher than 18917. 1903 is the release, 18362 is the version. You are wrong. https://blogs.windows.com/windowsexperience/2019/06/12/announcing-windows-10-insider-preview-build-18917/

@Oneiroi on the wsl 2 install documentation it states that you need to be running build 18917 or higher, and also gives the solution to the error: Invalid command line option that you will need to upgrade.

Does this address your feedback?

@Oneiroi on the wsl 2 install documentation it states that you need to be running build 18917 or higher, and also gives the solution to the error: Invalid command line option that you will need to upgrade.

Does this address your feedback?

He use 1903 that is higher than 18917, as he wrote above. I have the same problem with build 1903, investigating.

Someone should update Microsoft Store. It specifically states to go to https://docs.microsoft.com/en-us/windows/wsl/wsl2-install

Microsoft Store should be “intelligent” enough not to tell me to go there if my current Windows build doesn’t support it. I didn’t even notice the text at the time that states I needed to have 18917. I incorrectly assumed that Microsoft Store would not have told me to install something that I didn’t need to install.

Hi @Msadr471 In a theory yes, but in my opinion, better if you make a backup before upgrade, as always… Docs.: https://docs.microsoft.com/en-us/windows/wsl/wsl2-install