G.
NARAYANAMMA INSTITUTE OF TECHNOLOGY & SCIENCE
(Autonomous) (For women)
COMPUTER SCIENCE AND ENGINEERING
OPERATING SYSTEMS
II-B. TECH II-SEM CSE-C
(2023-2027)
A CASE STUDY
ON
VIRTUALIZATION
SUBMITTED BY:
MEESALA GAYATHRI 22251A05E5
P.HARSHITHA 23251A05F3
K.SANDHYA 23251A05K0
SUBMITTED To:
Mrs.Radhika mam
CSE DEPARTMENT
1
Table of Contents
1.Introduction to virtualization
2.Hypervisors
3.Virtual Machines
4.Memory Virtualization
5.I/O Virtualization
Introduction to Virtualization:
Virtualization in computing is the process of simulating hardware and software, such as
computers, operating systems, storage, and networking. And it does it in a virtual or
software environment.
Now the traditional way a business operated is by having one machine for one application.
So, for example , lets say that a business has three serves .And they would have one of
those servers dedicated to running an email service and that server has Microsoft Windows
as its operating system, And then the Linux as its operating system, And then they would
have another server that’s running a database and its using Unix as its operating system ,
So one machine with one application each.
But instead of having three servers running one application each, what if just one server
could do the job just as good and do it more efficiently? So basically one server would take
the place of the three and run all the applications and even run their different operating
systems
.
Virtualization is basically consolidating all of these physical servers with their different
operating systems and applications and running them on just one physical server in a
virtual environment. So now this one server is running three VMs or virtual machines.
It's running all of the different applications such as email, web services, and databases.
And they're all running side by side on one machine.
2
Introduction to Hypervisors:
The software that creates and runs the virtualization is called a hypervisor. A hypervisor is
what allows one machine to run multiple virtual machines. It allocates and controls the
sharing of a machine's resources such as storage space, RAM, CPUs, and so on.
Types of Hypervisors
Hypervisors come in two different types. There's type 1 and type 2.
A type 1 hypervisor is installed on bare metal hardware. Because of this, the type 1
hypervisor is also known as a bare-metal hypervisor. The host machine does not have an
operating system installed in a bare-metal hypervisor setup. Instead, the hypervisor
software acts as a lightweight operating system.
A type 2 hypervisor is installed and runs on top of an existing operating system, such as
Microsoft Windows, MAC OS, Linux, Unix, and so on. So, the operating System fits in
between the machine and the hypervisor. The type 2 hypervisor is a hypervisor program
installed on a host operating system. It is also known as a hosted or embedded hypervisor.
Like other software applications, hosted hypervisors do not have complete control of the
computer resources. Instead, the system administrator allocates the resources for the
hosted hypervisor, which it distributes to the virtual machines.
Type 1 hypervisors compared to type 2 hypervisors:
Despite their differences, both types of hypervisors are helpful in different applications. For
example, enterprise cloud data centers use type 1 or bare-metal hypervisors because of
their efficiency, scalability, and flexibility when allocating resources to virtual machines.
Also, a type
3
1.hypervisor is generally more secure and stable because it does not run on top of another
operating system.
Conversely, administrators use type 2 hypervisors because they are more user-friendly. Type
2.hypervisors are easier to install, configure, and use than bare-metal hypervisors. It is
similar to installing and using other desktop applications.
Virtual Machines:
A Virtual Machine (VM) is a software-based emulation of a physical computer. It runs an
operating system and applications just like a physical machine, but it does so within a virtual
environment created by a hypervisor. Each VM operates independently, with its own virtual
CPU, memory, disk, and network interface, even though these resources are shared from
the same physical hardware.
To build a virtual Machine we start off with a Hardware such as server and then on top of it
we have a software called Hypervisor. It’s what allocates and Controls machine’s hardware.
Some common Hypervisors are VMware ESXI, Citrix Xen Server, Microsoft Hyper-V and on
top of the hypervisor are the virtual machine and each of these will have their own
Operating System such as windows, LINUX and UNIX and on top of that we have applications
that these machines are going to be running.
Here is the Basic Structure of a Virtual Machine:
4
Advantages of Virtual Machines
1. VMs run in a sandboxed environment, meaning each VM is isolated from the host
system and other VMs.
2. Multiple VMs can run on a single physical machine, improving hardware utilization.
3. VM images can be easily moved or copied to different hosts or data centers.
Disadvantages of Virtual Machines
1. Vms are slower than physical machines because they run on a hypervisor layer.
2. Each VM includes its own full operating system, consuming more resources than
lighter alternatives like containers.
Memory Virtualization:
Memory virtualization is a technique used in computing environments, especially in
virtualized systems, to abstract and manage physical memory more efficiently. It allows
multiple virtual machines (VMs) to share the same physical memory on a host system by
presenting each VM with its own isolated and continuous block of memory, known as guest
physical memory. The hypervisor, which sits between the hardware and the VMs, handles
the mapping of this guest memory to the actual physical memory on the host. This enables
features like memory overcommitment, where more memory can be allocated to VMs than
physically exists, as well as dynamic memory allocation and live migration of VMs without
downtime. Overall, memory virtualization improves flexibility, scalability, and utilization of
memory resources in virtualized environments.
1.In a traditional execution environment , the operation system maintains one stage
mapping from virtual memory to machine memory using page tables.
2.All modern x86 CPUs include a memory management unit and a translation look –aside
buffer.
3.Virtual memory virtualization involves sharing the physical system memory.
5
4.A two stage mapping process should be maintained by the guest OS and the VMM.
5.Virtual memory to physical memory and physical memory to machine memory.
6.MMu virtualization should be supported ,which is transparent to the guest OS.
7.The guest OS continues to control the mapping of virtual addresses to the physical
memory address of VMs.
8.The VMM is responsible for mapping the guest physical memory to the actual machine
memory.
The various Techniques for Virtualizing memory are:
• Memory Mapping
• Shadow Paging
Memory mapping:
One fundamental method in memory virtualization is memory mapping, also referred to as
address translation. In this approach, the memory addresses used by a program (known as
virtual addresses) are mapped to actual locations in the physical memory (physical
addresses). This mapping is carried out by a hardware component called the Memory
Management Unit (MMU).
When a program inside a VM tries to access a memory location, it uses a virtual address. The
MMU, in coordination with the hypervisor, translates this virtual address into the
appropriate physical address. This address translation allows multiple VMs to run
simultaneously without overlapping memory spaces. Each VM assumes it has complete
access to the system’s memory, while in reality, it only uses a portion of it, and the rest is
shared across other VMs.
6
This level of indirection enhances memory isolation and security. Even if one VM tries to
access memory belonging to another, the hypervisor prevents such actions, maintaining a
stable and isolated environment.
Shadow Paging
Another important technique used in memory virtualization is shadow paging. It is especially
useful in systems where the guest OS is not aware that it is running in a virtualized
environment and still tries to manage its own page tables.
In a typical system, the operating system maintains a page table that maps virtual addresses
to physical addresses. However, in a virtualized setup, the guest OS maintains what it
believes to be a valid page table, but the hypervisor cannot allow the guest to directly
control physical memory. To handle this, the hypervisor maintains a shadow page table.
The shadow page table is a special structure that mirrors the guest OS’s page table but
translates guest virtual addresses to host physical addresses (the real physical memory used
by the system). This ensures that the guest OS can continue functioning as if it were in
control, while the hypervisor safely and securely handles the actual mappings behind the
scenes.
Shadow paging helps maintain high levels of transparency and compatibility, especially with
unmodified guest operating systems. However, it can add overhead due to the extra
translations and maintenance of additional data structures.
7
I/O Virtualization:
I/O Virtualization, short for I/O Virtualization, is a technology that lets multiple virtual machines or
servers share the same physical device, like a network card. Instead of each machine needing its own
hardware, they can all use one, thanks to virtualization. This makes setup easier, saves space, and
allows systems to handle more tasks at once. It helps reduce the amount of hardware needed and
makes things more flexible and efficient.
There are three ways to implement I/O virtualization:
• Full device emulation
• Para virtualization
• Direct I/O
Full Device Emulation:
• All the hypervisor emulates standard hardware devices (like network cards, disk
controllers) entirely in software.
• Guest OS is unaware that’s its running in a virtualized environment.
• No modifications are need de in the guest OS or drivers
• Common in general –purpose hypervisors like VMware or Virtual Box.
• This software is located in the VMM and acts as a virtual device
• The I/O access requests of the guest OS are trapped in the VMM which interacts with the I/O
devices
Para-virtualization
• Guest OS is modified to use special para-virtualized drivers that communicate directly with
the hypervisor.
8
• It is also known as the split driver model consisting of a frontend driver and a backend driver
• Reduces overhead compared to full emulation , as it avoids unnecessary hardware
abstraction.
• Requires guest OS support and cooperation, ex:Xen PV drivers
• Commonly used in performance –sensitive virtual environments.
Direct I/O
• VM had direct access to a physical I/O device on the host.
• Uses technologies like SR-IOB or Intel VT-d
• Limits flexibility and live margins of VMs, since the VM is tightly coupled to specific
hardware.
• Ideal for workloads that require high performances I/O such as databases or GPU-
intensive applications.
• In direct I/O virtualization the VM accesses devices directly.