Centos using WSL and Smart Terminal in Windows

Sathish
4 min readJun 21, 2020

I am comfortable using Linux (using Vagrant) with Apple laptop. Recent version of Apple laptop has hardware issues and laptop gets hanged frequently. Recently my display stopped working and gave it in the service center. I was forced to use Windows (which I hate using, in my professional life)until my mac laptop was repaired. I was struggling to use windows efficiently along with virtual box (vagrant). But down the time, I found some interesting ways to make myself efficient with windows OS .

Here are the hacks.

WSL

Windows Subsystem for Linux . Microsoft built WSL to enable Linux scripting in windows. They have built their own virtual machine to enable this, which is efficient than virtual box + vagrant combination (based on initial usage experience). They have also introduced WSL version2 with enhanced bug fixes and functionality. I am interested more in practical things than theoretical. So, please follow this link to get better insights on WSL

Steps to enable WSL and upgrade to WSL2 in windows 10.

(Note — Need admin access to perform the below steps)

  1. Open PowerShell terminal as Administrator and run the following command

dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart

2. Once WSL is enabled, please download the WSL update to enable WSL2 using the following link

https://wslstorestorage.blob.core.windows.net/wslblob/wsl_update_x64.msi

3. Please install the download WSL update by following the installation wizard.

4. Once the installation is successful, please run the following command to enable WSL version2 in PowerShell.

wsl — set-default-version 2

5. Next, we need to choose Linux OS of our choice. I prefer centos (as it is one of industry standard and I use it extensively). Please click on the following link to download centos for wsl.

https://github.com/yuk7/CentWSL/releases/download/7.0.1907.3/CentOS7.zip

Here is the github page url for the same — https://github.com/yuk7/CentWSL/releases

We can also download other versions of linux from Microsoft Store (eg. Ubuntu, Alpine, Debian, Fedora)

6. Once downloaded , extract the zip file and install CentOS7.exe by following the installation wizard.

Centos7.zip file —extracted folder

7. We all are set. Open a terminal and type wsl , this will take into centos linux bash.

Inside of centos box

8. Usually, WSL mount current windows user directory (eg. c:/Users/Sathish.Suresh ) is mounted to /mnt/c/Users/Sathish.Suresh . We don’t need to worry about file transfers between windows and linux os, since hard drive is shared and volume is mounted.

9. This also enables us to use all centos (linux) functionalities .

Smart Terminal

We have enabled centos using WSL in windows which has better performance, but now, the problem is with command prompt. Windows default Command Prompt is again not efficient, cannot display more lines of text and also doesn’t have needed functionalities as mac terminal provides. To overcome this, Microsoft has come up with a new terminal — the Windows Terminal , https://github.com/microsoft/terminal

Please refer the above link to know more about Windows Terminal behavior and functionalities. The key thing is, it support multiple tabs, easily opens WSL, beautiful texts and much more. Here is Windows Terminal — Program Manager views

https://devblogs.microsoft.com/commandline/introducing-windows-terminal/

Famous dialogue — Love at the first sight, I liked this terminal at the first use itself.

We can download this Terminal by following link.

This link will in-turn takes us to the Microsoft Store and we can install it from there .

Microsoft Store

This terminal enables efficiency using windows and linux . Here is a snapshot of the terminal.

Windows Terminal

Microsoft has really came a long way , back to the competition, holding and pulling back the (Windows) users.

This WSL and Windows Terminal makes my life easier, may be, am thinking to go back with windows. This solves key problems like, allocating resource to virtual box , as WSL uses whatever present in host OS, no need to manage port fowarding and much more…

Whenever, I solve something, I learn some lessons.

Today’s lesson — Instead of just blaming , change the things to work your way.

--

--

Sathish

Software Architect ★ Developer ★ Troubleshooter