Azure Windows 11 VM | How to run Ubuntu on WSL

01kg - Aug 29 - - Dev Community

Prerequisites

  1. VM size series that support Hyper-V, which is essential for WSL, are Dv3 and Ev3.
  2. Regions that provide Dv3 and Ev3: US West 2, US East, Europe West, Southeast Asia. (Sorry, I did not googled out any official page that shows updated list of regions. Only found this old post. If you know the updated list, please leave a comment.)
  3. Windows 10, Windows 10 LTSB/LTSC, Windows 11, Windows Server 2016, Windows Server 2019 and Windows Server 2022 (which supports WSL)
  4. In the process of creating the VM, select "Security type" to "Standard". Not "Trusted Launch".

TL;DR

  1. Connect the VM through RDP
  2. Go to Microsoft Store, download Ubuntu 24.04 LTS. Or, follow this doc to install other versions in other ways.
  3. Open a PowerShell window, run wsl --install --no-distribution to install WSL.
  4. Restart Windows.
  5. In Windows start menu, click the newly installed "Ubuntu 24.04" Image description

Pitfalls

Do I need to run Set-VMProcessor -VMName <My Vm Name> -ExposeVirtualizationExtensions $true ?

No. Not in my case

What does this error mean?
Image description

You forgot to run wsl --install --no-distribution to install WSL and reboot.

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .