Week 1 of My Devops Journey: WSL and peek into Linux

Introduction:

Brief overview of the article

The significance of Week 1 in a DevOps journey

Introduction to key tools: WSL, Linux, Bash

Getting Started with WSL (Windows Subsystem for Linux)

What is WSL?

If you are a Windows user who wants to learn Linux on Windows without using Virtual Box or dual booting, WSL is the solution.

WSL 2 (Windows Subsystem for Linux 2) is a compatibility layer developed by Microsoft that allows Windows users to run a Linux distribution directly on Windows, enabling a seamless Linux experience alongside Windows.

Why choose WSL over VM or Dual Boot:

  1. Faster startup: WSL launches Linux instantly, unlike VMs or dual-booting.

  2. Seamless integration: Easily access and share files between Windows and Linux.

  3. Less resource usage: WSL uses fewer system resources compared to full VMs.

  4. No rebooting: Unlike dual-booting, you can run Windows and Linux side by side.

  5. Simpler setup: WSL is easier to install and configure than dual boot or VM environments.

  6. Windows tool access: Run Linux tools alongside Windows apps in WSL.

Install and configure WSL on Windows:

Here is the link where you can install WSL: Install Guide

WSL architecture:

  • Real Linux Kernel:

    • WSL 2 uses an actual Linux kernel (version 4.19+) built by Microsoft. The Linux kernel in WSL 2 runs in a lightweight virtual machine (VM), providing full compatibility with Linux system calls.
  • Virtual Machine (VM) with Hyper-V:

    • WSL 2 operates within a lightweight VM using Hyper-V technology. However, this VM is highly optimized and starts in seconds, giving the feel of a native Linux environment without the overhead of traditional VMs.
  • Filesystem Performance:

    • WSL 2 offers improved file I/O performance compared to WSL 1. It now supports Linux file systems (ext4) natively inside the VM and provides faster access to the Linux filesystem, though Windows-to-Linux filesystem access is slower.

    • Memory and Resource Usage:

      • The virtualized environment dynamically manages system resources such as CPU, memory, and disk space. WSL 2 adapts its resource usage based on demand, making it efficient in terms of system resource utilization.
    • Integration with Windows:

      • Even though WSL 2 runs in a VM, it integrates seamlessly with Windows, allowing you to run Linux commands and applications while accessing Windows files through the \\wsl$ network share and vice versa.
  • Note: WSL isn’t a Linux distribution; it is a technology layer that provides a Linux environment.

  • Note: You can install various flavors of Linux through WSL.


Diving into Linux

Linux is an open-source operating system (OS) based on Unix, widely used for its flexibility, security, and community-driven development. Created by Linus Torvalds in 1991, Linux is now a foundation for many operating systems like Ubuntu, Fedora, CentOS, and Debian.

Key Components of Linux:

  1. Kernel: The core part of Linux, responsible for managing hardware resources and providing an interface between hardware and software.

  2. Shell: A command-line interpreter that allows users to interact with the OS by executing commands.

  3. File System: Linux organizes files in a hierarchical directory structure, starting from the root directory (/).

  4. Distributions: There are various Linux distributions ("distros"), each tailored for specific uses (e.g., Ubuntu for desktop, CentOS for servers, Kali Linux for security testing).

Why Use Linux?

  • Open Source: Linux is free to use, modify, and distribute, making it a cost-effective solution.

  • Security: Linux is known for its robust security model, making it less vulnerable to malware and viruses.

  • Customization: Users have full control to customize Linux according to their needs.

  • Stability: Linux systems are stable and can run for extended periods without requiring reboots, making them ideal for servers.

  • Community Support: A vast community of users and developers contributes to its development and offers support.

You can use either a Command Line Interface (CLI) or a Graphical User Interface (GUI) when using Linux. For repetitive tasks, the CLI is often more efficient, while the GUI is easier to navigate if you do not remember all the details or do something only rarely.

To know about my article on bash

Connect me on X(Formerly Twitter)

Did you find this article valuable?

Support Shrivatsa's Blog by becoming a sponsor. Any amount is appreciated!