When installing a WSL2 distribution on Windows Server 2022 you may receive the error An error occurred during installation. Distribution Name: 'Ubuntu 22.04 LTS' Error Code: 0x8000ffff
. First you need to update WSL after enabling the feature.
Steps for a fresh installation:
- Enable Windows Subsystem for Linux
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux
- Reboot