Unable to install WSL on azure VM windows 11

Gaurav Wagh 0 Reputation points
2025-06-10T06:44:46.92+00:00

I want to install WSL2 on azure VM windows 11. I have tried two approaches:

wsl --install

and

wsl --install --no-distribution

Before trying this approaches, I've turned on the required windows features:

  1. Windows subsystem for linux
  2. Virtual machine platform

However, WSL2 is not installing and throws the following error for both the above commands:

Installing, this may take a few minutes...
WslRegisterDistribution failed with error: 0x80370102
Please enable the Virtual Machine Platform Windows feature and ensure virtualization is enabled in the BIOS.
For information please visit https://aka.ms/enablevirtualization
Press any key to continue...

What can I do to successfully install WSL-2?

Azure VM configurations:

  • Security type: standard
  • Size: Standard B4as v2
  • vCPUs: 4
  • RAM: 16 GiB
Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
9,016 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Markapuram Sudheer Reddy 2,050 Reputation points Microsoft External Staff Moderator
    2025-06-10T07:56:49.47+00:00

    Hi Gaurav Wagh,

    The error looks like virtualization is not enabled at the host level or your VM size does not support nested virtualization and ensure to select an Azure VM that supports nested virtualization.

    According to Microsoft’s official documentation, the Basv2 series (which includes B4as v2) does not support nested virtualization. https://learn.microsoft.com/en-us/azure/virtual-machines/sizes/general-purpose/basv2-series?tabs=sizebasic

    When trying to use WSL2, as it requires virtualization features that may not be enabled by default on Azure VMs.

    Please check here for more information on Nested Virtualization.

    Ensure the security type is Standard.

    Please try with the command, wsl --set-default-version 1

    If the issue still persists, uncheck Windows Subsystem for Linux and Virtual Machine Platform, restarting the pc and enable them again and try to install WSL 2.

    Please check the workarounds followed here for more detailed information.

    https://learn.microsoft.com/en-us/windows/wsl/troubleshooting#error-0x80370102-the-virtual-machine-could-not-be-started-because-a-required-feature-is-not-installed

    If the information is helpful, please click on "Upvote"

    If you have any queries, please do let us know, we will help you.

    0 comments No comments

  2. Alex Burlachenko 9,780 Reputation points
    2025-06-10T09:30:46.53+00:00

    Hi Gaurav Wagh,

    hanks for posting this on q&a

    u gotta make sure nested virtualization is ON for ur azure vm. some sizes don't support it, but b4as v2 should be fine. check the docs here enable nested virtualization in azure vms. if its off, wsl2 won't work no matter what u try. Then, run this in ps as admin

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

    reboot the vm after this. yes, even if it says 'norestart', just do it lol ))

    also, set wsl2 as the default version

    wsl --set-default-version 2
    

    if u still get errors, try updating the wsl kernel manually from wsl2 kernel update.

    sometimes hyper-v conflicts with other virtualization tools. if u have docker or vagrant running, pause them before installing wsl2. worth looking into bios settings too if u were on physical hardware, but with azure, its all cloud magic and yes, i know how its looks like ;D

    as well azure vms sometimes have old windows images. make sure u're on the latest windows 11 build. run winver to confirm. if its outdated, windows update might save u a ton of pain.

    aha, and one more thing! if u hit memory issues, tweak the .wslconfig file to limit ram usage. this might help in other tools too if u juggle multiple vms.

    microsoft docs are gold for this, full guide install wsl2 on windows. let us know if u still get stuck..

    Best regards,

    Alex

    and "yes" if you would follow me at Q&A - personaly thx.
    P.S. If my answer help to you, please Accept my answer
    PPS That is my Answer and not a Comment
    

    https://ctrlaltdel.blog/

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.