Step 1: Enable WSL 2 and Virtual Machine Platform (Explicitly)

On the Windows machine:

  1. As an administrator, open PowerShell.

  2. Run the following commands:

    dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
  3. Restart the machine.