How to Set a Window 10 terminal with Ubuntu (Other Distros) using WSL

Kushal Dave
5 min readMay 29, 2020

--

Woah

In this, I will show how to set up a beautiful terminal that you will love to open in daily work.

Initial days of computer there was not any GUI (Graphical User Interface) based thing that we have now to interact with things like email, Slack, or Others. That time people have to write a thing on the terminal to do some work with a computer as we saw in the movie (Black & Green like thing).

I will not go on the deep back of the history of any other you can Google it if you want to know more.

Let Begin —

Photo by Artem Maltsev on Unsplash

Things to note before following my step —

  • Make Sure You are on Window 10 Build 19041 or higher.

Check your Windows version by selecting the Windows logo key + R, type winver, select OK. (Or enter the ver command in Windows Command Prompt)

Install the Windows Subsystem for Linux

So What we are going to do Install Some Type of Unix Based Command to Work with Window 10

Before installing any UNIX(Ubuntu, Kali, or any other) we have to first install WSL2(Window Subsystem for Linux). This was realized by Microsoft at Build 201* to Enabling the window to work with Linux.

Step 1-

  • Search for window feature in the Search Box (Ctrl +Q)
Search for Window Feature
  • Open it Some Dialogue Box will open in this browse down & Enable Window Subsystem for Linux.
Enable the following
  • The Following Process will take Sometimes so be patient after that Restart to apply a Changes to Device.
  • After Restarting a System Just Open Microsoft Store and Search for Ubuntu & Download any one of the following.
MS Store Ubuntu Search
  • After it gets Completely Installed Just Launch the Application & it will take some time for setting up the things for you after everything work fine it will ask for a name enter anything you like & Hit Enter it will ask of Password (So enter the password you Can Remember Because some Command will ask for Password to do some Work)

Hurray, You have Done Good Work. Now You can work will UNIX based command on window simply direct opening ubuntu or command terminal typing(ubuntu)

Opening Ubuntu using Command Terminal Type ubuntu

Let add more power to it by Installing Window Terminal and adding Topping on it.

If Step 1 is working fine let now add some more things to utilize more window 10 power designed for Developer like Me & You. We will use Microsoft’s new terminal which is far more powerful than the previous ones we are using till now.

Description of Window Terminal — The Windows Terminal is a modern, fast, efficient, powerful, and productive terminal application for users of command-line tools and shells like Command Prompt, PowerShell, and WSL. Its main features include multiple tabs, panes, Unicode and UTF-8 character support, a GPU accelerated text rendering engine, and custom themes, styles, and configurations.

Step 2 -

  • Install New Window Terminal Which Provides a lot of things that were missing in older Terminal (Multiple Tab, Custom Theme, Styles & Important One WSL).

Download From Microsoft Store — https://www.microsoft.com/en-us/p/windows-terminal/9n0dx20hk701?activetab=pivot:overviewtab

  • After Installed & Opening, you see Default opened as PowerShell and it also Lists all the different CMD Line that installed in your window 10 device by Default(Powershell & Command Prompt) & WSL distros.
Window Terminal

Some Command Just Copy & Paste in Ubuntu Distros in Window Terminal -

sudo apt-get update
sudo apt-get upgrade
sudo apt-get install git curl zsh

When zsh get install set it to default

Note — Here we are using sudo to giving following command admin privileges it will ask for the password here you enter your ubuntu password.

"$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"

If all went well, your Ubuntu terminal shell should look like this. Just your username in the prompt.

My Default Drive %USERNAME% in Window 10

Now we are ready to add some themes. I will be using Powerlevel10k. And because we have oh my zsh installed we just need to run the following scripts.

git clone --depth=1 https://github.com/romkatv/powerlevel10k.git $ZSH_CUSTOM/themes/powerlevel10k

Set ZSH_THEME=powerlevel10k/powerlevel10k in your ~/.zshrc. To do that run nano ~/.zshrcand replace the ZSH_THEME value. Save(Ctrl + X then y button) and exit nano editor (then Enter Button).

Change Value of ZSH_THEME

Now restart the Windows Terminal and you should see the Powerlevel10k configuration wizard

Just Read & Follow the screen

Just Read & Choose What You Like Make Sure to Yes for a diamond look

Customize a Terminal -

Window Terminal setting.json

https://gist.github.com/ikushaldave/2a7bc86b0825ee381bdc791f44575609

Some Command It Will Help Ubuntu in WSL -

cd /mnt/d 
cd /mnt/c

If Your Device has multiple drive (C D or E) use /mnt/{drive} to switch between drive

--

--

Kushal Dave

Learning Full Stack @altcampus GitHub - @ikushaldave