Open In App

Virtual Machines in Operating System

Last Updated : 08 Mar, 2024
Improve
Improve
Like Article
Like
Save
Share
Report

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.


Like Article
Suggest improvement
Previous
Next
Share your thoughts in the comments

Similar Reads