CentOS 8 or any other of its version is not officially available on Windows 10 App store for WSL- Windows subsystem for Linux, however, you can still install and use it.
Microsoft has continuously shown its love towards the Linux and that can be seen in WSL. With the latest Windows 10 May update, the WSL 2, an upgraded version of previous WSL 1 will be available for regular users. The benefit of that is, now we will have full-fledged Linux kernel to operate various Linux apps such as Ubuntu, Debian Kali, SUSE and more… Recently, Ubuntu 20.04 LTS, the latest version of this Linux is available to download and install on Windows 10 for WSL but sorry to say, we don’t have popular CentOS server Linux there. Perhaps, it is because of CetnOS less popularity among standard Desktop Linux users. However, if you are a developer or just a Linux enthusiast and want to use CentOS8 on Windows 10 WSL, here is the tutorial on that.
- WSL on Windows 10
- Internet connection to download the required files.
Step 1: Enable WSL on your System
If you already have Windows subsystem for Linux enabled on your system then you can move to the next step. However, those yet need to Turn it ON, simply start the Powershell as Administrator and copy-paste the below command in it. Once the process gets completed, restart your system.
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux
Step 2: Download CentOS 8 WSL files
Well, to get the CentOS WSL Linux app, we don’t need to visit Windows 10 store because it is not there, instead of that it is available on the Github as an open-source project developed by some Japanese developer, named as yuk7 (profile name). Therefore go to his Github project page and under CentOS WSL release you will get the latest 8.1 version. But remember to use this release you should be on the latest Windows 10 May update 2004 or later. Otherwise, you can run the CentOS 7 WSL app.
Step 3: Unzip CentOS8.zip
The downloaded file will be in zipped format, thus simply right click and unzip it somewhere you won’t delete the file accidentally.
Step 3: Install CentOS 8 on WSL
Open the extracted folder and run the CentOS8.exe file. If Windows shows some suspicion on that, just select the option “Run Anyway”.
In a few minutes, it will register this new Linux app under WSL feature of Windows 10.
Step 4: Run the Linux app
Now, again run the same CentOS8 executable file present inside the extracted folder, but this time you will see the command line with root user. Or Simply in the windows 10 search box type CentOS.
To test everything is working fine, we ran a system update command. You can do the same as well.
By default, the root user is without any password and if you want, you can set one.
Furthermore, those want to run it under WSL 2, they can see this tutorial: how to run a Linux app on WSL 2.
Uninstall CentOS 8 from WSL (optional)
If in future, if you want to delete this Linux app then don’t just delete the CentOS 8 unzipped folder directly otherwise it will create a problem in reinstalling the same, thus properly deregister it and then delete the files.
- Open its folder and press & hold shift and right-click inside that folder.
- Select Open Powershell window here.
- Run command:
The output for the above command:
PS C:\Users\Raj\Desktop\CentOS8> ./CentOS8.exe clean This will remove this distro (CentOS8) from the filesystem. Are you sure you would like to proceed? (This cannot be undone) Type "y" to continue:Y Accepting is required to proceed.
So, this was the simple tutorial on running CentOS 8 server on Windows 10 WSL.