1

I have two Windows 10 machines.

The first machine had WSL version 1 installed and I was able to successfully update it version 2 with the following commands in PowerShell:

wsl --update
wsl --shutdown
wsl --set-version Ubuntu-22.04 2

But when I tried the same command on the second machine

wsl --set-version Ubuntu-22.04 2

I got:

For information on key differences with WSL 2 please visit https://aka.ms/wsl2
Conversion in progress, this may take a few minutes.
The operation could not be started because a required feature is not installed.
Error code: Wsl/Service/CreateVm/HCS_E_SERVICE_NOT_AVAILABLE

what can cause this?

The both Windows 10 version are 22H2.

And the output of the commands

wsl --list --online
wsl -l -v

is exactly the same on the both machines.

Dmitriano
  • 427
  • 1
  • 5
  • 18
  • 1
    Enable Virtual Machine Platform within Optional Features – Ramhound Apr 21 '23 at 12:09
  • 1
    The alternative is to uninstall WSL, then run the command, wsl --install to reinstall it and enable all required optional Windows features. If you attempted to run your existing WSL2 instance you would find it does not work since you don’t have a required feature installed. Carefully read the instructions to install WSL2. If that still doesn’t work, [edit] your question, to include enough information to diagnose the current state of your system – Ramhound Apr 21 '23 at 12:53
  • @Ramhound Installing Virtual Machine Platform probably helped, at least the conversion has started. – Dmitriano Apr 21 '23 at 12:56
  • @Ramhound converted! – Dmitriano Apr 21 '23 at 13:19

2 Answers2

2

What can cause this? For information on key differences with WSL 2 please visit https://aka.ms/wsl2 Conversion in progress, this may take a few minutes. The operation could not be started because a required feature is not installed. Error code: Wsl/Service/CreateVm/HCS_E_SERVICE_NOT_AVAILABLE

You don't have Virtual Machine Platform installed on your system. You can either enable it, or unregister your existing WSL2 instances and uninstall WSL, then run wsl --install to resolve the problem.

You can install Virtual Machine Platform on your system by running:

dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart

Source:

  1. Manual installation steps for older versions of WSL
  2. Install Linux on Windows with WSL
  3. Wsl/Service/CreateInstance/CreateVm/HCS_E_SERVICE_NOT_AVAILABLE
Ramhound
  • 42,708
-1

Related to this: if you're trying to run wsl --update but the update argument isn't available (i.e. you're seeing the help screen), you need to run Windows update first. Updating from Windows 10 20H2 to 22H2 updated WSL2 and enabled the update argument for me.

Tyler
  • 99
  • So you are saying that wsl --update isn't possible without having feature v22H2 installed first? When was WSL2 released? – Jon Grah Jan 11 '24 at 00:12