Install CentOS on Windows 10 WSL

Join TipsMake.com to find a simple way to manually install CentOS on Windows 10 Subsystem for Linux and run commands in RHEL's YUM or RPM repository.

Join TipsMake.com to find a simple way to manually install CentOS on Windows 10 Subsystem for Linux and run commands in RHEL's YUM or RPM repository.

Windows Subsystem for Linux is an advanced feature for Windows users. Windows Subsystem for Linux allows you to practice and learn Linux operating system commands directly on Windows 10 systems without using virtual machine software like VirtualBox.

Windows Subsystem for Linux, also short for WSL, is deployed by Microsoft in Windows 10 and Windows Server 2019 operating systems, to provide compatibility and execution of Linux binary files.

In order to install the Linux Distro image in general, users must depend on Microsoft Store, where there are a number of compact images that are pre-compiled. Currently, the Linux WSL image is available as Ubuntu, Kali Linux, Debian, AlpinLinux, OpenSUSE and SUSE Enterprise Server. Therefore, if you want to try out some Linux operating systems such as CentOS / RHEL (Red Hat Enterprise Linux) and Arch Linux, install them on Windows 10 Subsystem for Linux yourself. Today's article will show you how to do it.

Note : Before installing CentOS on WSL, you must activate Windows Subsystem for Linux. If you don't know how to do that, read the article: Running Linux on Windows 10 does not require a virtual machine, here are 18 things you should know for more details.

How to install CentOS on Windows 10 Subsystem for Linux

Step 1: Download CentOS WSL

The first thing to have is a CentOS on WSL (Windows 10 FCU or above), based on WSldl. Basically, it's a zip file containing rootfs and some other files. CentOS as WSL Instance is an open source project available on Github, so download it here.

The latest version at the time of writing is CentOS 7.6.

Install CentOS on Windows 10 WSL Picture 1Install CentOS on Windows 10 WSL Picture 1

Step 2: Unzip the WOS CentOS 7.x folder

The size of the downloaded folder will be about 300MB and after downloading, right-click to unzip this folder. Here, the article is using WinRAR to extract files. However, you can use the default Windows program or any other option to extract it.

Install CentOS on Windows 10 WSL Picture 2Install CentOS on Windows 10 WSL Picture 2

Step 3: Run CentOS.exe to install CentOS on Windows 10 Subsystem for Linux

After extracting the directory, you will see two files in it: The first file is rootfs.tar.gz and the second file is CentOS.exe. You need to run CentOS.exe to extract the files and register them on WSL. Right-click on the file and select Run as administrator .

Install CentOS on Windows 10 WSL Picture 3Install CentOS on Windows 10 WSL Picture 3

Step 4: Complete the installation

After the installation is complete, you will receive a message on the CentOS command screen. Now, press the Enter key to exit the setup.

Install CentOS on Windows 10 WSL Picture 4Install CentOS on Windows 10 WSL Picture 4

Step 5: Run CentOS 7 on WSL

To run CentOS 7, again go to the unpacked folder of CentOS for WSL and this time, you will see 4 files. Again, right-click Centos.exe and select Run as administrator .

Install CentOS on Windows 10 WSL Picture 5Install CentOS on Windows 10 WSL Picture 5

Finally, the Linux subsystem installed manually for CentOS has appeared here.

Install CentOS on Windows 10 WSL Picture 6Install CentOS on Windows 10 WSL Picture 6

Step 6: CentOS update command on WSL

You can run any command you want to execute on CentOS, just to see if it works well. Example running CentOS update command with YUM.

 yum -y update 

Install CentOS on Windows 10 WSL Picture 7Install CentOS on Windows 10 WSL Picture 7

Step 7: Uninstall CentOS 7 WSL

If in the future you accidentally delete the CentOS WSL folder and want to reinstall, first, delete the existing settings first.

To uninstall CentOS 7 WSL, just use the menu command below:

 CentOS.exe clean 

Then again extract the files from the compressed folder of CentOS that you downloaded above and then run Windows 10 PowerShell with admin rights, navigate to the unzipped folder and run the command below:

 ./CentOS.exe clean 

Install CentOS on Windows 10 WSL Picture 8Install CentOS on Windows 10 WSL Picture 8

To reinstall, run the executable file CentOS.exe in the same extracted folder to register the files to Windows 10 Subsystem for Linux.

Hope you are succesful.

4 ★ | 656 Vote