Default Windows OS doesn’t allow hyperV feature to be enabled in VM
Create nested Hyper-V
- Shut down the VM.
- In the host open Powershell with administrator rights.
Set-VMprocessor ExposeVirtualizationExtension $true
VMName - Turn on VM.
Installation
- Open PowerShell with administrator rights
Hyper-V is requirement for WSL installationEnable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V -All
Enable WSL
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux - Windows server does not have Microsoft store, we will have to download the distribution files.
https://learn.microsoft.com/en-us/windows/wsl/install-manual#downloading-distributions - Extract the .appx package’s contents, using PowerShell:
Copy-Item .\Ubuntu.appx .\Ubuntu.zip
Expand-Archive .\Ubuntu.zip .\Ubuntu
Add-AppxPackage .\app_name.appx
Add your Linux distribution path to the Windows environment PATH$userenv = System.Environment::GetEnvironmentVariable("Path", "User")[System.Environment]::SetEnvironmentVariable("PATH", $userenv + ";C:\Users\Administrator\Ubuntu", "User")
You can now launch your distribution from any path by typing .exe. For example: ubuntu.exe.
After launching the ubuntu.exe you might encounter Kernel error. WslRegisterDistribution failed with error: 0x800701bc,
link to package https://learn.microsoft.com/en-us/windows/wsl/install-manual
Reference
https://learn.microsoft.com/en-us/windows/wsl/install-on-server
https://learn.microsoft.com/en-us/windows/wsl/install-manual#downloading-distributions


