Fundamentals of Linux Operating Systems and Virtual Machines

Fundamentals of Linux Operating Systems and Virtual Machines

The OS concepts you were looking for !

Introduction

Linux operating systems and virtual machines are two key components in the world of computing that offer powerful capabilities and flexibility. Linux, known for its stability, security, and open-source nature, forms the foundation of numerous operating systems used across various devices and environments. Meanwhile, virtual machines enable the efficient utilization of hardware resources by allowing multiple operating systems to run simultaneously on a single physical machine. Let's explore the fundamentals of Linux operating systems, including the kernel, shell, file system, processes, user management, and package management. We'll also delve into the concept of virtual machines, understanding their types, benefits, and the software used to create and manage them. Whether you're a system administrator, developer, or simply curious about these technologies, this introduction will lay the groundwork for a deeper understanding of Linux operating systems and virtual machines.

  1. Kernel: The kernel is the core component of the Linux operating system. It interacts directly with the hardware and manages system resources such as memory, processes, devices, and file systems.

  2. Shell: The shell is a command-line interface that allows users to interact with the operating system. It interprets the commands entered by the user and executes them. Examples of popular Linux shells are Bash (Bourne Again Shell), C shell, and Zsh.

  3. File System: Linux uses a hierarchical file system structure, starting from the root directory ("/"). Directories contain files and subdirectories, and the file system organizes them in a tree-like structure. Common file systems used in Linux include Ext4, XFS, and Btrfs.

  4. Processes: In Linux, a process is an instance of a running program. The operating system manages processes, allocating system resources, scheduling their execution, and providing inter-process communication mechanisms.

  5. User Management: Linux supports multi-user environments, allowing multiple users to log in and use the system simultaneously. User management involves creating and managing user accounts, assigning permissions and privileges, and ensuring system security.

  6. Package Management: Linux distributions use package management systems to install, update, and remove software packages. Package managers handle dependencies, ensuring that all required software components are installed correctly. Examples of package managers are apt (used in Debian-based systems), yum (used in Red Hat-based systems), and pacman (used in Arch Linux).

Virtual Machines (VMs)

  1. Definition: A virtual machine is a software emulation of a computer system that enables multiple operating systems to run concurrently on a single physical machine. Each virtual machine acts as an independent entity, with its own operating system, applications, and resources.

  2. Hypervisor: A hypervisor, also known as a virtual machine monitor (VMM), is a software or firmware layer that enables the creation and management of virtual machines. It allocates physical resources to each virtual machine and ensures their isolation from one another.

  3. Types of Virtualization: There are two primary types of virtualization:

    • Full virtualization: In full virtualization, the guest operating system runs unmodified on the virtual machine, and the hypervisor intercepts and emulates hardware calls made by the guest OS.

    • Para-virtualization: In para-virtualization, the guest operating system is aware that it is running on a virtual machine and makes use of specific APIs provided by the hypervisor for efficient communication.

  4. Benefits of Virtual Machines:

    • Consolidation: Multiple virtual machines can be hosted on a single physical server, reducing hardware costs and increasing resource utilization.

    • Isolation: Virtual machines are isolated from one another, providing security and stability. A failure in one virtual machine does not affect others.

    • Testing and Development: Virtual machines offer an ideal environment for testing new software and development, as they can be easily created, modified, and restored to a previous state.

    • Migration and Flexibility: Virtual machines can be migrated between physical hosts with minimal downtime, enabling flexibility and efficient resource allocation.

  5. Virtual Machine Software: There are various virtual machine software options available, including:

    • VMware: VMware vSphere, VMware Workstation, and VMware Fusion.

    • Oracle VM VirtualBox

    • Microsoft Hyper-V

    • KVM (Kernel-based Virtual Machine)

    • Docker (container-based virtualization)

These fundamentals provide a high-level overview of Linux operating systems and virtual machines. Both topics are extensive and can be further explored in detail based on specific requirements or interests.

  • Virtual Machines are simply isolated systems based on host machine to boot another Operating system.

Screenshot 2022-07-12 at 8 01 05 PM

  • A hypervisor allows one host computer to support multiple guest VMs by virtually sharing its resources, such as memory and processing.

  • There are mainly two types of Hypervisor

    • TYPE 1

    • TYPE 2

  • The main difference between Type 1 vs. Type 2 hypervisors is that Type 1 runs on bare metal and Type 2 runs on top of an operating system. Each hypervisor type also has its own pros and cons and specific use cases.

  • Type 1 is adopted by most of the companies but for personal usage, we use Type 2.

Screenshot 2022-07-12 at 8 02 46 PM

  • Now, we are having Containers as a light weight alternative which is now been used in cloud and DevOps in a huge scale.

Linux Fundamentals

  • First of all, let's make it clear that Linux is not just an Operating System. Rather it is a Kernel.

  • Ubuntu, CentOS, Alpine, Kali, ParrotOS are few examples of Linux Distributions which are actual OS based on that Kernel.

  • When we boot up a Linux system, we find these existing folders. Here are the significance of those :

  1. /home --> Root user's home directory

  2. /bin --> Executables for most essential user commands

  3. /sbin --> System Relevant Executables (Requires Super User access)

  4. /lib --> Essential shared library that are used by executables from /bin and /sbin

  5. /usr --> User home directory (Obsolete)

  6. /usr/local --> Third party apps like Docker, Java, Minikube are installed here

  7. /opt --> Third party apps are installed which do not split data with different directories for example IDEs

  8. /boot --> System booting files

  9. /etc --> Configuration of System-wide applications are stored

  10. /dev --> Location of Device files like Keyboard, Mouse, Hardrive, etc.

  11. /var --> Contains files to which system writes data during the course of it's operation.

  12. /tmp --> Temporary resources required for the same processes

  13. /media --> Mounts removable media

  14. /mnt --> Mounts temporary file systems (Obsolete)

Screenshot 2022-07-13 at 9 31 24 PM

  • Files starting with dot (.) are hidden. They are also termed as dotfiles. You can view those by ticking the check box of the folder settings. Else you can try to run "ls -a" in terminal to show all files and folder including the hiddens ones.

  • Here is the list of Linux Terminal Commands prepared by myself : Handwritten Cheatsheet.pdf

Thanks for reading till the very end.

Follow me on Twitter, LinkedIn and GitHub for more amazing blogs about Tech and More!