How do operating systems use a general technique called virtualization and virtual machines?¶
Virtualization is a general technique that allows multiple virtual machines to run on a single physical machine, which means that OS takes a physical resource and makes it appear to be multiple resources (a virtual form of itself) (Arpaci-Dusseau, 2018).
Virtualization is one of the essential functions of operating systems. It can be applied to memory, CPU, storage, network, and operating system (Arpaci-Dusseau, 2018).
CPU Virtualization allows multiple processes to run on the same CPU simultaneously, giving an illusion of multiple CPUs, where each process runs on a virtual CPU (Arpaci-Dusseau, 2018).
Memory virtualization each process accesses its own virtual address space (address space), a subset of the physical memory. The OS maps the virtual address space to the physical memory. A memory reference within a process does not affect the address space of other processes.
Virtualization is also important in cloud computing because it allows the vendors to provide a single physical machine to multiple customers by selling (or renting) virtual machines on the physical one. Thus, cloud vendors can virtualize their single big server and provide smaller servers to multiple customers (Jagroopofficial, 2021).
A virtual machine (guest machine) is a subset of another machine’s resources (the host machine) while holding -usually- its own operating system.
The host machine provides resources to the guest machine, which has its own operating system; it can run its own applications and programs.
Sometimes, the guest machine does not provide direct access to the resources; instead, the OS of the host machine gets what it needs by making system calls to the host OS. It all depends on the type of permissions that the host OS gives to the guest OS.
Isolation of resources: By virtualizing memory, OS ensures that every process has its own memory and does not have access to the memory of other processes.
Run programs in parallel: By virtualizing the CPU, OS ensures that multiple processes can run on the same CPU simultaneously (or close to that).
Ability to run multiple operating systems on the same machine: By virtualizing the operating system, OS ensures that multiple operating systems can run on the same machine.
Some other Benefits may include hardware efficiency, cost reduction, increased availability, better disaster recovery, and security (Jagroopofficial, 2021).
Arpaci-Dusseau, R. H., & Arpaci-Dusseau, A. C. (2018). Operating systems: three easy pieces (1.01 ed.). Arpaci-Dusseau Books. https://pages.cs.wisc.edu/~remzi/OSTEP/