Virtual Machines in Operating System
Last Updated :
08 Mar, 2024
A Virtual Machine is an Operating System or application environment that runs on software that replicates special hardware. The end-user experience when utilizing a virtual machine is identical to that of special hardware.
What is Virtual Machine?
Virtual Machine abstracts the hardware of our personal computer such as CPU, disk drives, memory, NIC (Network Interface Card), etc, into many different execution environments as per our requirements.. For example, VirtualBox. When we run different processes on an operating system, it creates an illusion that each process is running on a different processor having its own virtual memory, with the help of CPU scheduling and virtual-memory techniques. There are additional features of a process that cannot be provided by the hardware alone like system calls and a file system. The virtual machine approach does not provide these additional functionalities but it only provides an interface that is the same as basic hardware. Each process is provided with a virtual copy of the underlying computer system. We can create a virtual machine for several reasons, all of which are fundamentally related to the ability to share the same basic hardware yet also support different execution environments, i.e., different operating systems simultaneously. The main drawback of the virtual-machine approach involves disk systems. Let us suppose that the physical machine has only three disk drives but wants to support seven virtual machines. It cannot allocate a disk drive to each virtual machine, because virtual-machine software itself will need substantial disk space to provide virtual memory and spooling. The solution is to provide virtual disks. After which they can run any of the operating systems or software packages that are available on the underlying machine. The virtual-machine software is concerned with multi-programming multiple virtual machines onto a physical machine, but it does not need to consider any user-support software. This arrangement can provide a useful way to divide the problem of designing a multi-user interactive system, into two smaller pieces.
How Does a Virtual Machine Work?
Virtualization is the method of creating a software-based, or “virtual” version of a computer with good amounts of CPU, memory, and storage that are “borrowed” from a physical host computer (such as your personal computer) and/or a remote server. The working of the virtual machine is very simple just check the published article on the Working of a Virtual Machine.
Types of Virtual Machine
There are two types of Virtual Machine
- Process Virtual Machine
- System Virtual Machine
Read the published article to know the detail of Types of Virtual Machine on GFG.
How to Set Up Virtual Machine?
The process for creating a virtual machine varies depending on the virtualization platform. Many platforms provide wizards and other capabilities to simplify the process of establishing and deploying a VM. For ex: To install a Linux Virtual Machine, the user have to follow the below steps:
Step 1: Make a blank virtual machine.
Step 2: Create a virtual disc for storage.
Step 3: Add a network interface to link the virtual machine to the network.
Step 4: Install the guest operating system (OS).
Step 5: Register the VM with the content delivery network and attach any necessary subscriptions.
Step 6: Install any necessary guest agents or drivers.
Advantages of Virtual Machine
- There are no protection problems because each virtual machine is completely isolated from all other virtual machines.
- Virtual machine can provide an instruction set architecture that differs from real computers.
- Easy maintenance, availability and convenient recovery.
- Energy and cost savings.
- Easy backup and clone.
- Virtual Machine provide Flexibility and Customization.
Disadvantages of Virtual Machine
- When multiple virtual machines are simultaneously running on a host computer, one virtual machine can be affected by other running virtual machines, depending on the workload.
- Virtual machines are not as efficient as a real one when accessing the hardware.
What is Hypervisors in Virtualization?
Hypervisor as name suggests, it is a software, hardware, or firmware that generally make virtualization possible. It simply creates virtualization layers that separates CPU/processors, RAM and all other physical resources from virtual machines that we create. Its type includes Native hypervisor and Hosted hypervisor. It is used to allocate each VM resources such as CPU, memory, storage, and network to simply run guest OS and applications. To know more check the published article Hypervisors on GFG
Frequently Asked Question on Virtual Machine – FAQs
What is the size limit for virtual machine?
The maximum size of a virtual hard disc is 2,040 gigabytes (GB). However, any virtual hard disc attached to the IDE controller must not exceed 127 gigabytes (GB).
How many virtual machines can I run?
It is not suggested to overload your computer with VMs, as this might create significant amount of delays. This depends on your computer’s resources, but normally, you can keep an average of 3-5 VMs running simultaneously without encountering any speed decrement.
Can you resize a virtual machine?
After you have created a virtual machine you can scale it up or down by adjusting its size.
How can multiple users use one virtual machine?
The solution is to enable Remote Desktop Services, which allows many users to work simultaneously on a VM.
Similar Reads
Operating System Tutorial
An Operating System(OS) is a software that manages and handles hardware and software resources of a computing device. Responsible for managing and controlling all the activities and sharing of computer resources among different running applications.A low-level Software that includes all the basic fu
4 min read
Types of Operating Systems
Operating Systems can be categorized according to different criteria like whether an operating system is for mobile devices (examples Android and iOS) or desktop (examples Windows and Linux). In this article, we are going to classify based on functionalities an operating system provides. 1. Batch Op
10 min read
What is an Operating System?
An Operating System is a System software that manages all the resources of the computing device. Acts as an interface between the software and different parts of the computer or the computer hardware. Manages the overall resources and operations of the computer. Controls and monitors the execution o
9 min read
Introduction of Deadlock in Operating System
A deadlock is a situation where a set of processes is blocked because each process is holding a resource and waiting for another resource acquired by some other process. In this article, we will discuss deadlock, its necessary conditions, etc. in detail. Deadlock is a situation in computing where tw
11 min read
Introduction to Linux Shell and Shell Scripting
If we are using any major operating system, we are indirectly interacting with the shell. While running Ubuntu, Linux Mint, or any other Linux distribution, we are interacting with the shell by using the terminal. In this article we will discuss Linux shells and shell scripting so before understandi
7 min read
CPU Scheduling in Operating Systems
CPU scheduling is a process used by the operating system to decide which task or process gets to use the CPU at a particular time. This is important because a CPU can only handle one task at a time, but there are usually many tasks that need to be processed. The following are different purposes of a
9 min read
Operating System Interview Questions
An operating system acts as a GUI between the user and the computer system. In other words, an OS acts as an intermediary between the user and the computer hardware, managing resources such as memory, processing power, and input/output operations. Here some examples of popular operating systems incl
15+ min read
Memory Management in Operating System
The term memory can be defined as a collection of data in a specific format. It is used to store instructions and process data. The memory comprises a large array or group of words or bytes, each with its own location. The primary purpose of a computer system is to execute programs. These programs,
10 min read
Paging in Operating System
Paging is a memory management scheme that eliminates the need for a contiguous allocation of physical memory. The process of retrieving processes in the form of pages from the secondary storage into the main memory is known as paging. The basic purpose of paging is to separate each procedure into pa
10 min read
Functions of Operating System
An Operating System acts as a communication interface between the user and computer hardware. Its purpose is to provide a platform on which a user can execute programs conveniently and efficiently. An operating system is software that manages the allocation of Computer Hardware. The coordination of
12 min read