Using Powershell (see https://docs.microsoft.com/en-us/windows/wsl/install-win10 for more information)
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux
(see https://docs.microsoft.com/en-us/windows/wsl/wsl2-install )
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
CentOS is not in the Windows Store. Luckily the internet elves have been hard at work creating root file systems that can be launched with WSLDL. I went with this one https://github.com/yuk7/CentWSL.
Why not Ubuntu? Ubuntu is fine if you have complete control of your environment. I'm setting this up to create a local environment that reflects my production environment which is CentOS. The company's admin elves insist that it is a better choice for their needs. Since they are the ones who have to troubleshoot at 3:00AM I'm not going to argue.
Download and unzip CentOS7.zip Double click Centos.exe This is the wsldl laucher that will unpack and register the rootfilesystem. The first time you run it, it will take a while to set everthing up.
wsl --set-version CentOS7 2
Conversion in progress, this may take a few minutes...
For information on key differences with WSL 2 please visit https://aka.ms/wsl2
Please enable the Virtual Machine Platform Windows feature and ensure virtualization is enabled in the BIOS.
For information please visit https://aka.ms/wsl2-install
The VPM is already active from the commands above, you may need to restart and configure the BIOS.
Restart and check that the conversion is complete
PS C:\Users\wombatpm> wsl -l -v
NAME STATE VERSION
* CentOS7 Stopped 1
PS C:\Users\bruce> wsl --set-version CentOS7 2
Conversion in progress, this may take a few minutes...
For information on key differences with WSL 2 please visit https://aka.ms/wsl2
Conversion complete.
PS C:\Users\wombatpm> wsl -l -v
NAME STATE VERSION
* CentOS7 Stopped 2
yum update
yum upgrade
Thank you, internet elves!