Unable to setup nestedVirtualization in Windows VM (Standard_D4s_v3)

Rishabh Gupta 0 Reputation points
2025-01-10T15:37:14.3066667+00:00

I have installed WSL and rancher desktop but, rancher desktop is giving below error

WSL2 is not supported with your current machine configuration.

Please enable the "Virtual Machine Platform" optional component and ensure virtualization is enabled in the BIOS.

Enable "Virtual Machine Platform" by running: wsl.exe --install --no-distribution

For information please visit https://aka.ms/enablevirtualization

Error code: Wsl/Service/RegisterDistro/CreateVm/HCS/HCS_E_HYPERV_NOT_INSTALLED

We have tried below solutions

  1. " wsl.exe --install --no-distribution" and rebooted the VM but no luck.
  2. "az vm update --resource-group rg-name --name vm-name --set additionalCapabilities.nestedVirtualization=true" though Azure CLI, but it's also giving error

Also, we have used Standard_D4s_v3 size.

Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
8,223 questions
Hyper-V
Hyper-V
A Windows technology providing a hypervisor-based virtualization solution enabling customers to consolidate workloads onto a single server.
2,787 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Luis Arias 7,841 Reputation points
    2025-01-10T16:17:07.6766667+00:00

    Hello Rishabh,

    It looks like your VM size support nested virtualization beside that you can follow this guide (https://techcommunity.microsoft.com/blog/itopstalkblog/how-to-setup-nested-virtualization-for-azure-vmvhd/1115338) Here a summarized guide to troubleshoot the WSL2 error on your Azure VM:

    • Enable Nested Virtualization: Use the command az vm update --resource-group <rg-name> --name <vm-name> --set additionalCapabilities.nestedVirtualization=true. Stop and restart the VM if needed.
    • Install WSL Features: Run wsl --install --no-distribution inside the VM. If needed, enable "Virtual Machine Platform" with dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart and reboot.
    • Verify BIOS Virtualization: Ensure that VT-x or AMD-V is enabled for the VM. Recreate the VM if necessary.
    • Test WSL: Confirm WSL2 is working with wsl --list --verbose and set default version with wsl --set-default-version 2.
    • Check Logs: Use wsl --update and wsl --status for debugging.

    References:


    If the information helped address your question, please Accept the answer. Luis

    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.