0% found this document useful (0 votes)
10 views

2-Week2 Osa Theory

The document covers virtualization technology, its types, benefits, and challenges, as well as the Linux boot process and command line usage. It explains how hypervisors create virtual machines (VMs) and containers, detailing their differences in resource management and portability. Additionally, it outlines the stages of the Linux boot process and the functionality of the command line interface for user interaction.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views

2-Week2 Osa Theory

The document covers virtualization technology, its types, benefits, and challenges, as well as the Linux boot process and command line usage. It explains how hypervisors create virtual machines (VMs) and containers, detailing their differences in resource management and portability. Additionally, it outlines the stages of the Linux boot process and the functionality of the command line interface for user interaction.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 16

Operating system and Administration- 20CS42P

WEEK-2

Topics : Virtualization technology, working, types , Potentials and challenges of Virtualization,


Virtual Machines, Containers. Linux Boot process. Linux command line - Interpreter, shell, CLI over
GUI, Types of users super and normal, Linux user manual.
Virtualization technology

 Virtualization is technology that allows you to create multiple simulated environments or dedicated
resources from a single, physical hardware system.
 Hypervisor is a software which connects directly to the hardware and allows you to split one system
into separate, distinct, and secure environments known as virtual machines (VMs).
 VM is an operating system installed on a hypervisor software.
 These VMs rely on the hypervisor’s ability to separate the machine’s resources from the hardware
and distribute them appropriately.
 The physical hardware, equipped with a hypervisor, is called the host, while the many VMs that use
its resources are guests.
 These guests treat computing resources—like CPU, memory, and storage—as a pool of resources
that can easily be relocated.

Fig: Virtualization technology

Dept. of CSE, GWPT, Shiralakoppa Page 1


Operating system and Administration- 20CS42P

Benefits of Virtualization
Partitioning: Run multiple operating systems on one physical machine.
 Divide system resources between virtual machines.

 Isolation: Virtual machines are completely isolated from the host machine and other virtual
machines. If a virtual machine crashes, all others are unaffected. Data does not leak across virtual
machines and applications can only communicate over configured network connections.
 Encapsulation: Complete virtual machine environment is saved as a single file; easy to back up,
move and copy Standardized virtualized hardware is presented to the application - guaranteeing
compatibility.
 Reduced heat and improved energy savings. Companies that use a lot of hardware servers risk
overheating their physical resources. The best way to prevent this from happening is to decrease the
number of servers used for data management, and the best way to do this is through virtualization.
 Better for the environment. Companies and data centers that utilize abundant amounts of hardware
leave a large carbon footprint. Virtualization can help reduce these effects by significantly
decreasing the necessary amounts of cooling and power, thus helping clean the air and the
atmosphere. As a result, companies and data centers that virtualize will improve their reputation
while also enhancing the quality of their relationship with customers and the planet.
 Easier migration to the cloud. Virtualization brings companies closer to experiencing a completely
cloud-based environment. Virtual machines may even be deployed from the data center in order to
build a cloud-based infrastructure. The ability to embrace a cloud-based mindset with virtualization
makes migrating to the cloud even easier.
 Lack of vendor dependency. Virtual machines are agnostic in hardware configuration. As a result,
virtualizing hardware and software means that a company does not need to depend on a vendor for
these physical resources.
How does virtualization works:

 Software called hypervisors separate the physical resources from the virtual environments—the
things that need those resources.

Dept. of CSE, GWPT, Shiralakoppa Page 2


Operating system and Administration- 20CS42P

 Hypervisors can sit on top of an operating system (like on a laptop) or be installed directly onto
hardware (like a server), which is how most enterprises virtualize.
 Hypervisors take your physical resources and divide them up so that virtual environments can use
them.

 Resources are partitioned as needed from the physical environment to the many virtual
environments.
 Users interact with and run computations within the virtual environment (typically called a guest
machine or virtual machine).
 The virtual machine functions as a single data file. And like any digital file, it can be moved from
one computer to another.
 When the virtual environment is running and a user or program issues an instruction that requires
additional resources from the physical environment, the hypervisor relays the request to the physical
system and caches the changes—which all happens at close to native speed.

Dept. of CSE, GWPT, Shiralakoppa Page 3


Operating system and Administration- 20CS42P

Types of Virtualization

Data Virtualization

Fig: Data Virtualization


 Data that’s spread all over can be consolidated into a single source.
 Data virtualization allows companies to treat data as a dynamic supply—providing processing
capabilities that can bring together data from multiple sources, easily accommodate new data
sources, and transform data according to user needs.
 Data virtualization tools sit in front of multiple data sources and allows them to be treated as single
source, delivering the needed data—in the required form—at the right time to any application or
user.
Desktop virtualization

Dept. of CSE, GWPT, Shiralakoppa Page 4


Operating system and Administration- 20CS42P

Fig: Desktop Virtualization

 Desktop virtualization allows a central administrator (or automated administration tool) to deploy
simulated desktop environments to hundreds of physical machines at once.
 Unlike traditional desktop environments that are physically installed, configured, and updated on
each machine, desktop virtualization allows admins to perform mass configurations, updates, and
security checks on all virtual desktops.

Server virtualization

Fig: Server Virtualization

Dept. of CSE, GWPT, Shiralakoppa Page 5


Operating system and Administration- 20CS42P

 Servers are computers designed to process a high volume of specific tasks really well so other
computers—like laptops and desktops—can do a variety of other tasks.
 Virtualizing a server lets it to do more of those specific functions and involves partitioning it so that
the components can be used to serve multiple functions.
Operating system virtualization

Fig: OS Virtualization

 Operating system virtualization happens at the kernel—the central task managers of operating
systems.
 It’s a useful way to run Linux and Windows environments side-by-side.
 Enterprises can also push virtual operating systems to computers.
 Increases security, since all virtual instances can be monitored and isolated.
 Limits time spent on IT services like software updates.
Network functions virtualization

Dept. of CSE, GWPT, Shiralakoppa Page 6


Operating system and Administration- 20CS42P

Fig: Network Virtualization

 Network functions virtualization (NFV) separates a network's key functions (like directory services,
file sharing, and IP configuration) so they can be distributed among environments.
 Once software functions are independent of the physical machines they once lived on, specific
functions can be packaged together into a new network and assigned to an environment.
 Virtualizing networks reduces the number of physical components—like switches, routers, servers,
cables, and hubs—that are needed to create multiple, independent networks
 And it’s particularly popular in the telecommunications industry.

Storage Virtualization
 This is widely used in datacenters where you have a big storage and it helps you to create, delete,
allocated storage to different hardware.
 This allocation is done through network connection. The leader on storage is SAN (Storage Area
Network). A schematic illustration is given below –

Dept. of CSE, GWPT, Shiralakoppa Page 7


Operating system and Administration- 20CS42P

Fig: Storage Virtualization

Virtual Machines

 A Virtual Machine is the representation of a physical machine by software. It has its own set of
virtual hardware (e.g., RAM, CPU, NIC, hard disks, etc.) upon which an operating system and
applications are loaded.
 The operating system sees a consistent, normalized set of hardware regardless of the actual physical
hardware components.
 Software called a hypervisor separates the machine’s resources from the hardware and provisions
them appropriately so they can be used by the VM.
 Virtual Machines are not emulators are simulators. They are real machines that can do the same
things physical computers can do and more.
 Because of the flexibility of virtual machines, physical machines become less a way to provide
services (application, databases etc.) and more a way to house the virtual machines that provide
those resources.
 Servers are easy to manage if they are on virtual machines.
 Virtual machines also reduce cost of hardware, maintenance and environment support.

Dept. of CSE, GWPT, Shiralakoppa Page 8


Operating system and Administration- 20CS42P

Containers

o Linux containers and virtual machines (VMs) are packaged computing environments that combine
various IT components and isolate them from the rest of the system. Their main differences are in terms
of scale and portability.

Dept. of CSE, GWPT, Shiralakoppa Page 9


Operating system and Administration- 20CS42P

o Containers are typically measured by the megabyte. They don’t package anything bigger than an app
and all the files necessary to run, and are often used to package single functions that perform specific
tasks (known as a microservice). The lightweight nature of containers—and their shared operating
system (OS)—makes them very easy to move across multiple environments.
o VMs are typically measured by the gigabyte.
o They usually contain their own OS, allowing them to perform multiple resource-intensive functions at
once.
o The increased resources available to VMs allow them to abstract, split, duplicate, and emulate entire
servers, OSs, desktops, databases, and networks.
Linux boot process

The following are the 6 high level stages of a typical Linux boot process.

1. BIOS
 BIOS stands for Basic Input/Output System
 Performs some system integrity checks
 Searches, loads, and executes the boot loader program.
 It looks for boot loader in floppy, cd-rom, or hard drive. You can press a key (typically F12 of F2,
but it depends on your system) during the BIOS startup to change the boot sequence.
 Once the boot loader program is detected and loaded into the memory, BIOS gives the control to it.
 So, in simple terms BIOS loads and executes the MBR boot loader.
2. MBR
 MBR stands for Master Boot Record.
 It is located in the 1st sector of the bootable disk. Typically /dev/hda, or /dev/sda

Dept. of CSE, GWPT, Shiralakoppa Page 10


Operating system and Administration- 20CS42P

 MBR is less than 512 bytes in size. This has three components
 1) primary boot loader info in 1st 446 bytes
 2) partition table info in next 64 bytes
 3) MBR validation check in last 2 bytes.
 It contains information about GRUB (or LILO in old systems).
 So, in simple terms MBR loads and executes the GRUB boot loader.
3. GRUB
 GRUB stands for Grand Unified Bootloader.
 If you have multiple kernel images installed on your system, you can choose which one to be
executed.
 GRUB displays a splash screen, waits for few seconds, if you don’t enter anything, it loads the
default kernel image as specified in the grub configuration file.
 GRUB has the knowledge of the filesystem (the older Linux loader LILO didn’t understand
filesystem).
 Grub configuration file is /boot/grub/grub.conf (/etc/grub.conf is a link to this). The following is
sample grub.conf of CentOS.
4. Kernel
 Mounts the root file system as specified in the “root=” in grub.conf
 Kernel executes the /sbin/init program
 Since init was the first program to be executed by Linux Kernel, it has the process id (PID) of 1. (Do
a ‘ps -ef | grep init’ and check the pid.)
 initrd stands for Initial RAM Disk.
 initrd is used by kernel as temporary root file system until kernel is booted and the real root file
system is mounted. It also contains necessary drivers compiled inside, which helps it to access the
hard drive partitions, and other hardware.
5. Init
 Looks at the /etc/inittab file to decide the Linux run level.
 Following are the available run levels
 0 – halt
 1 – Single user mode
 2 – Multiuser, without NFS

Dept. of CSE, GWPT, Shiralakoppa Page 11


Operating system and Administration- 20CS42P

 3 – Full multiuser mode


 4 – unused
 5 – X11(GUI)
 6 – reboot
 Init identifies the default init level from /etc/inittab and uses that to load all appropriate program.
 Execute ‘grep initdefault /etc/inittab’ on your system to identify the default run level
 Typical default run level is 3 or 5.
6. Runlevel programs
 When the Linux system is booting up, you might see various services getting started. For example, it
might say “starting sendmail …. OK”. Those are the runlevel programs, executed from the run level
directory as defined by your run level.
 Depending on your default init level setting, the system will execute the programs from one of the
following directories.
 Run level 0 – /etc/rc.d/rc0.d/
 Run level 1 – /etc/rc.d/rc1.d/
 Run level 2 – /etc/rc.d/rc2.d/
 Run level 3 – /etc/rc.d/rc3.d/
 Run level 4 – /etc/rc.d/rc4.d/
 Run level 5 – /etc/rc.d/rc5.d/
 Run level 6 – /etc/rc.d/rc6.d/
 There are also symbolic links available for these directory under /etc directly.
For ex: /etc/rc0.d is linked to /etc/rc.d/rc0.d.
Linux command line
 The Linux command line is a text interface to your computer. Also known as shell, terminal,
console, command prompts and many others, is a computer program intended to interpret
commands.
 Allows users to execute commands by manually typing at the terminal, or has the ability to
automatically execute commands which were programmed in “Shell Scripts”.
 The Bourne Shell (sh) was originally developed by Stephen Bourne while working at Bell Labs.
 The Bourne Again Shell (bash) was written as a free and open source replacement for the Bourne
Shell.

Dept. of CSE, GWPT, Shiralakoppa Page 12


Operating system and Administration- 20CS42P

 Given the open nature of Bash, over time it has been adopted as the default shell on most Linux
systems.
First look at the command line

When a terminal is open, it presents you with a prompt.


Let's analyze the screenshot above:
Line 1: The shell prompt, it is composed by username@hostname:location$
Username: our username is called “john”
Hostname: The name of the system we are logged on
Location: the working directory we are in
$: Delimits the end of prompt
After the $ sign, we can type a command and press Enter for this command to be executed.
Line 2: After the prompt, we have typed the command whoami which stands for “who am i“ and pressed
[Enter] on the keyboard.
Line 3: Shows us the result of the whoami command we have previously issued, also known as command
output. This command simply prints out the username of the current user.
Line 4: Shows an example of another basic command called pwd which stands for print working
directory(or present working directory).
Line 5: As seen before, this line shows the result of the command previously issued. /tmp is our working
directory.
Line 6: Presents us with a new prompt, and waits for us to type a new command.
There are a few important things to keep in mind when using a Linux shell:
 It is case sensitive
 The / (forward-slash) is a special character used as directory separator
 Nearly every Linux command supports --help argument
 File extensions don’t matter

Linux user types

Dept. of CSE, GWPT, Shiralakoppa Page 13


Operating system and Administration- 20CS42P

 There are two types of users – the root or super user and normal users.
 A root or super user can access all the files, while the normal user has limited access to files. In
computing, the superuser is a special user account used for system administration. Depending on the
operating system (OS), the actual name of this account might be root, administrator, admin or
supervisor.
 Normal users are the users created by the root or another user with sudo privileges. Usually, a
normal user has a real login shell and a home directory. Each user has a numeric user ID called UID.
A super user can add, delete and modify a user account. The full account information is stored in
the /etc/passwd file and a hash password is stored in the file /etc/shadow.
Interpreters: A command line interpreter is any program that allows the entering of commands and then
executes those commands to the operating system. It's literally an interpreter of commands.
CLI over GUI
CLI : Command line Interface, allows the users to interact with the system using commands.
GUI : Graphical User Interface, allows the users to interact with the system using graphical elements such
as windows, icons, menus
Sl no CLI GUI
1 CLI is difficult to use. Whereas it is easy to use
2 It consumes low memory. While consumes more memory
3 In CLI we can obtain high precision. While in it, low precision is obtained
4 CLI is faster than GUI The speed of GUI is slower than CLI.
5 CLI’s appearance can not be While it’s appearance can be modified or changed.
modified or changed.
6 CLI operating system needs only While GUI operating system need both mouse and
keyboard. keyboard.
7 In CLI, input is entered only at While in GUI, input can be entered anywhere on the
command prompt. screen.
8 In CLI, the information is shown or While in GUI, the information is shown or
presented to the user in plain text presented to the user in any form such as: plain text,
and files videos, images, etc.
9 In CLI, there are no menus provided. While in GUI, menus are provided.
10 There are no graphics in CLI. While in GUI, graphics are used.
11 While it uses pointing devices for selecting and
CLI do not use any pointing devices. choosing items.
12 In CLI, spelling mistakes and typing Whereas in GUI, spelling mistakes and typing errors
errors are not avoided are avoided.

Dept. of CSE, GWPT, Shiralakoppa Page 14


Operating system and Administration- 20CS42P

Linux User Manual


man command in Linux is used to display the user manual of any command that we can run on the
terminal. It provides a detailed view of the command which includes NAME, SYNOPSIS,
DESCRIPTION, OPTIONS, EXIT STATUS, RETURN VALUES, ERRORS, FILES, VERSIONS,
EXAMPLES, AUTHORS and SEE ALSO.
Every manual is divided into the following sections:
 Executable programs or shell commands
 System calls (functions provided by the kernel)
 Library calls (functions within program libraries
 Games
 Special files (usually found in /dev)
 File formats and conventions eg /etc/passwd
 Miscellaneous (including macro packages and conventions), e.g. groff(7)
 System administration commands (usually only for root)
 Kernel routines [Non standard]
Syntax : $man [OPTION]... [COMMAND NAME]...
Example: 1. $ man printf

2. man -f ls (-f option is used to print the section number of the manual)

Dept. of CSE, GWPT, Shiralakoppa Page 15


Operating system and Administration- 20CS42P

Assignment Questions

 Explain how does Virtualization Technology works


 Explain Linux Booting process
 Explain types of Virtualization
 Write Benefits of virtualization
 Compare two types of Linux Interpreter(GUI and CLI)
 Discuss two types of users inLinux

Dept. of CSE, GWPT, Shiralakoppa Page 16

You might also like