Microsoft provides WSL as a way to bridge the gap between the Windows and Linux world. You can choose from several distros that are available in the Microsoft store, but one that’s missing is CentOS. The tutorial below will walk you through installing CentOS on WSL using Docker containers.

Prerequisites:

Windows 10 Enterprise (build 1903 or newer)WSL feature installed (tutorial)Docker setup for Windows and WSL (tutorial)

Enter these commands to complete the CentOS install from WSL prompt:

docker image pull centos:7 docker create -i centos bash docker export <first few digits of image number> > centos.tar

powershell.exe wsl --import CentOS-WSL .\CentOSStorage\ centos.tar

Test new distro wsl -d CentOS-WSL cat /etc/centos-release

Here is a complete rundown on the commands: