Linux & Virtualization
Linux & Virtualization
What is Virtualization?
Consider your computer as an office workspace. Without virtualization, it operates like a single employee
handling one task at a time. With virtualization, it transforms into a versatile executive managing multiple
projects concurrently. Each virtual instance is like having separate departments working independently –
marketing, finance, and development – all within the same office space.
Virtualization optimizes your computer's efficiency, allowing it to seamlessly handle diverse tasks without
any interference. It's the corporate strategy for digital multitasking, ensuring a smooth workflow in the
professional arena.
What is Hypervisor?
A hypervisor, also known as a Virtual Machine Monitor (VMM), is the unsung hero of the virtualization world.
Think of it as the wise conductor orchestrating the symphony of virtual parties on your computer. This
software layer sits between the hardware and the virtual instances, ensuring that each virtual machine (VM)
believes it's the star of the show.
The hypervisor is like a traffic cop for computing resources, allocating CPU, memory, and other hardware
goodies to each VM with precision. It creates a harmonious environment where multiple operating systems
and applications can coexist peacefully, each within its own isolated bubble.
There are two types of hypervisors: Type 1 (bare-metal) hypervisors run directly on the hardware, while
Type 2 (hosted) hypervisors operate on top of an existing operating system. Regardless of the type, the
hypervisor is the maestro of the virtualization orchestra, ensuring a smooth performance for all the virtual
machines under its command. It's the unsung hero, silently enabling the magic of virtualization to unfold.
Types of Hypervisors
What is Linux?
Linux is an open-source operating system renowned for its stability, security, and versatility. It serves as the
digital backbone for a multitude of devices, from servers and smartphones to embedded systems.
As an alternative to proprietary systems, Linux empowers users with customizable and efficient computing,
making it a favorite for developers, enterprises, and tech enthusiasts alike. In the world of operating systems,
Linux stands out as a robust and collaborative force, embodying the principles of open-source innovation.
Linux distributions, commonly known as distros, come in various types, each tailored to specific user
preferences and purposes.
1. Desktop Linux:
a. User-Friendly: Includes distributions such as Ubuntu and Linux Mint, tailored for a smooth
desktop experience.
b. Lightweight: Examples like Xubuntu and Lubuntu cater to resource-efficient desktop
environments.
c. Specialized: Kubuntu and Ubuntu Studio serve specific desktop needs, emphasizing the
KDE desktop and multimedia production, respectively.
2. Server Linux:
a. Enterprise: Red Hat Enterprise Linux (RHEL) and CentOS are recognized for robustness in
enterprise server environments.
b. Community: Debian and Ubuntu Server are widely adopted community-driven choices for
server deployments.
c. Specialized: openSUSE and Arch Linux offer specialized server configurations to
accommodate various requirements.
3. IoT Linux:
a. General IoT: Raspbian (for Raspberry Pi) and Ubuntu Core are designed for general Internet
of Things applications.
b. Embedded Systems: OpenEmbedded and Yocto Project provide solutions for developing
embedded systems.
c. Industrial IoT (IIoT): Wind River Linux is tailored for industrial IoT applications demanding
high reliability.
4. Container Orchestration (Kubernetes):
a. Example: While not a Linux distribution, Kubernetes is a widely used container
orchestration platform often deployed on Linux systems.
5. Special Linux:
a. Source-Based: Gentoo is known for its source-based nature, allowing users fine-grained
control over system optimization.
b. RPM-Based: openSUSE and Mageia use the RPM packaging system, providing a
standardized approach to software management.
c. Slackware-Based: Slackware, one of the earliest Linux distributions, is recognized for its
simplicity and minimalism.
d. Pacman-Bases: Arch Linux is know for the pacman based distro, knowing for it’s Arch User
Repositories and community support.
Linux OS is composed of several components which work in accordance to keep the system running. Let's
discuss them below.
Types of Kernels
Monolithic Kernel: Imagine the monolithic kernel as the superhero manager of your computer, doing it all –
juggling tasks, managing memory, and talking directly to computer parts. It's like a multitasking hero, but if
you need to fix or update something, it's a bit like searching for a needle in a haystack. Examples include
the Linux kernel versions before 3.0.
Hardware Kernel: Hardware is the behind-the-scenes hero turning your computer's digital instructions into
the real stuff on your screen. It's the wizard behind the curtain, making sure your computer follows your
commands. Examples are your computer's processor, memory, and graphics card.
Microkernel: Now, picture a team of specialized heroes, each with its own superpower. The microkernel is
like having this team. It keeps the basic functions simple and assigns specific tasks to these special heroes.
Need to make changes? You just bother the hero in charge, making updates more like adding a new power
to the team. Examples include the QNX operating system.
Hybrid Kernel: In the computer world, the hybrid kernel is like a multitasking maestro. It's a smart mix of
doing lots of things at once and calling in specialists when needed. Picture it as a computer hero that's good
at everyday tasks but can also bring in experts for specific jobs. The Windows NT kernel, making modern
Windows tick, is a great example. So, the hybrid kernel gives your computer the best of both – it can handle
many tasks smoothly and bring in specialists for the tricky stuff.
In computer land, the monolithic kernel is the multitasking hero (like old Linux versions), hardware is the
behind-the-scenes wizard (processor, memory, etc.), the microkernel is your team of special heroes (like
QNX), making sure everything runs smoothly and the hybrid kernel is the modern kernel, making it’s
specialization in multitasking.
In the Linux file system, directories are like digital filing cabinets where you organize your files. Each
directory has a specific purpose and contains files or additional directories. Here are some key directories
commonly found in Linux:
1. / (Root Directory):
- Purpose: The big boss directory.
- Example: `/` (Where it all begins).
2. /bin:
- Purpose: The superhero command center.
- Example: `/bin/ls` (The list-files superhero).
3. /boot:
- Purpose: The launchpad for the computer spaceship.
- Example: `/boot/vmlinuz` (The spaceship kernel).
4. /dev:
- Purpose: The backstage pass to all the gadgets.
- Example: `/dev/sda` (The first rockstar hard drive).
5. /etc:
- Purpose: The secret lair of system settings.
- Example: `/etc/motd` (The message of the day, a secret code perhaps).
6. /home:
- Purpose: The cozy neighborhood of user homes.
- Example: `/home/alice` (Where Aayush hangs her digital hat).
7. /lib and /lib64:
- Purpose: The library of magical spells.
- Example: `/lib/libc.so.6` (The enchanted C library).
8. /media:
- Purpose: The red carpet for USB celebrities.
- Example: `/media/usb` (Where USB stars make an entrance).
9. /mnt:
- Purpose: The temporary campground for digital explorers.
- Example: `/mnt/cdrom` (CD-ROMs camping under the stars).
10. /opt:
- Purpose: The VIP lounge for optional software.
- Example: `/opt/party-app` (Where the optional party app resides).
11. /proc:
- Purpose: The carnival with information booths.
- Example: `/proc/cpuinfo` (Where CPUs spill the beans).
12. /root:
- Purpose: The mansion of the root user.
- Example: `/root` (Root's exclusive digital abode (home)).
13. /run:
- Purpose: The bustling runtime street.
- Example: `/run/pizza-delivery` (Where the pizza runtime is in full swing).
14. /sbin:
- Purpose:* The superhero toolkit.
- Example: `/sbin/reboot` (The reboot superhero).
15. /srv:
- Purpose: The service-themed amusement park.
- Example: `/srv/database` (The thrilling db server ride).
16. /sys:
- Purpose: The space station for kernel secrets.
- Example: `/sys/class/gov` (Classified gov information).
17. /tmp:
- Purpose: The playground for temporary fun.
- Example: `/tmp/funapp ` (A temporary application having a blast).
18. /usr:
- Purpose: The bustling city of user-related programs.
- Example: `/usr/bin/ninja` (Where digital ninjas train).
19. . /var:
- Purpose: The virtual amusement park with variable rides.
- Example: `/var/log/releaseapp` (Log entries from the app relase).
20. /swap:
- Purpose: The magical extra room where your computer can temporarily store things when it runs
out of space in the regular places.
- Example: `/swap` (The secret hideout for digital treasures when memory is full).
These directories create a structured organization for files in a Linux system, making it easier to navigate
and manage the various components of the operating system. Understanding the purpose of each directory
helps users maintain a well-organized and functional file system.