paint-brush
Setting Up a Windows Subsystem for Linuxby@akbarzaidi
328 reads
328 reads

Setting Up a Windows Subsystem for Linux

by Akbar ZaidiJune 26th, 2023
Read on Terminal Reader
Read this story w/o Javascript
tldt arrow

Too Long; Didn't Read

Learn how installing WSL (Windows Subsystem for Linux) can transform your development process, enabling seamless integration of Linux tools and enhancing productivity in a Windows environment.

People Mentioned

Mention Thumbnail
Mention Thumbnail
featured image - Setting Up a Windows Subsystem for Linux
Akbar Zaidi HackerNoon profile picture
0-item
1-item

Why is WSL important for developers using Windows?

Working as a web developer can be an exciting and dynamic career choice, allowing individuals to create, design, and maintain websites and web applications. However, it's not uncommon to encounter technical challenges along the way, especially when working with different operating systems. Windows, being a popular choice among developers, sometimes presents compatibility issues with certain tools and frameworks.


One solution to overcome these obstacles is to install Windows Subsystem for Linux (WSL) on your Windows machine. WSL allows developers to run a Linux environment directly on Windows, bridging the gap between the two operating systems. By installing WSL, web developers gain access to a vast range of powerful and versatile tools that are commonly used in the development community.


Today, I will guide you on how to install WSL and set up the Linux environment in Windows with cool fonts and styling. It is crucial to ensure that your environment is up to date to avoid any potential issues.


Installing VS code

It is important to install Visual Studio Code (VS Code) as it is widely used by many web developers due to its reliability, efficiency, and simplicity. It is easy to use and offers a range of features that enhance the development experience.


Here is the link to download Visual Studio Code for Windows: https://code.visualstudio.com/download

Installing Ubuntu

Installing Ubuntu is essential as it serves as the underlying operating system within the WSL terminal. Simply open the Microsoft Store and install Ubuntu from there.


Installing WSL

Open Windows Powershell as an administrator then install WSL by following the command:

wsl --install

If you encounter any errors while installing WSL, you should open "Turn Windows features on and off" and enable the "Virtual Machine Platform" option. After the installation, it will prompt you to enter a UNIX username (which should be in lowercase) and then ask for a password.



To ensure optimal performance, it is recommended to work within the Linux root directory rather than the Windows directory when using WSL. Working in the root directory improves efficiency, making your work easier and faster. To navigate to the root directory, you can use the following command in PowerShell after installing WSL:

wsl -u root


Installing Terminal

Here We are using Fluent Terminal because it is more compatible with Ubuntu.



Shift the Fluent Terminal Profile From Powershell to WSL.



Now go to Themes and select Ubuntu Bash



Install the Bash


cp .prompt $HOME/.prompt
echo "source .prompt" >> $HOME.bashrc
source $HOME/.bashrc

Installing Zsh Themes

Now that the WSL has been set up, the next target is to make it Beautiful.

We will install Zsh Themes to install the Zsh Theme open the Fluent Terminal and Enter this command:

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


Now, you should ensure that the zsh theme is Working Perfectly.

Enter the Following commands one by one:

cp .prompt $ZSH/themes/fluent-git.zsh-theme
echo "ZSH_THEME="fluent-git"" >> $HOME/.zshrc
source $HOME/.zshrc


Your terminal should be looking like this:


PowerLine Fonts

You will need to set up your terminal to use a patched powerline font so the characters in the prompt will display correctly.


You can get pick a font from here:

https://github.com/powerline/fonts


Run sudo apt-get install fonts-powerline to install the Powerline Fonts.

This will install the PowerLine Fonts and then the Terminal will Look like this:

Conclusion

In conclusion, the installation of WSL (Windows Subsystem for Linux) greatly benefits Full Stack Developers. By providing compatibility with Linux-based tools, libraries, and environments, WSL enables developers to seamlessly work with a vast ecosystem of Linux software on their Windows machines. This compatibility ensures consistent development environments and allows for the integration of both Windows and Linux tools into the workflow. Additionally, by following proper installation steps, such as enabling the "Virtual Machine Platform" and choosing the root directory for work, developers can enhance the efficiency and speed of their development processes. Overall, WSL empowers Full Stack Developers by bridging the gap between Windows and Linux, expanding their options and capabilities in the development space.

Credits

Mentor: Muhammad Bilal