WSL2 issue on Windows 11 Azure Virtual Machine

asked 2023-01-04T07:47:21.353+00:00
GeorgeM 6 Reputation points

I am trying to enable WSL2 on an Azure VM using a Windows 11 21H2 (Build 22000.1335) image. The VM size is Standard D2s v3 (2 vcpus, 8 GiB memory).

WSL2 has been enabled with no problems and was set to default to WLS2 using: wsl --set-default-version 2

The VM seems to support Virtualization although I can't get all the details in SystemInfo:

275909-image.png

When I tried to install an Ubuntu 20.04 image, during the installation process I get the following error:

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...

I would like to ask if it possible to use WSL2 on Azure Virtual Machine and deploy a Linux VM, and if yes what actions shall I take to overcome this error message?

Thank you in advance for you help.

GeorgeM

Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
4,562 questions
No comments
{count} votes

2 answers

Sort by: Most helpful
  1. answered 2023-01-05T10:36:11.107+00:00
    GeorgeM 6 Reputation points

    Thank you for your prompt reply.

    Indeed, the VM type supports nested virtualization (D2s v3) and nested virtualization was enabled as described in the document. However, WSL2 was not able to successfully install a Debian image.

    I did forget to mention that vTPM and Secure Boot were enabled on the VM during deployment, and it seems that this was the root cause that prohibiting WSL2 to operate as expected. Deployed a VM using exactly the same type and Windows image, but with Trusted Launch disabled and WSL2 was found to be working with no problems.

    Many thanks for your reply.

    George M.

    No comments

  2. answered 2023-01-04T21:58:54.587+00:00
    deherman-MSFT 23,516 Reputation points Microsoft Employee

    @GeorgeM

    WSL requires an Azure VM that is compatible with nested virtualization. You also need to enable nested virtualization for your VM. Please check and let me know if you are still experiencing issues.

    -------------------------------

    Please don’t forget to "Accept the answer" and “up-vote” wherever the information provided helps you, this can be beneficial to other community members.

    No comments