Monday 13 June 2022

Theory - 104 :- What is a virtual machine? Concept, Types, And Adv/Dis Advantages of It.

 What is a Virtual Machine?



virtual machine is a special piece of software which emulates the operation of a physical machine. Despite being located within a real physical host and making use of its resources, a virtual machine remains completely independent: it uses its own software-based components (the CPU, motherboard, video adapter, network interface, memory and hard disks), which may even differ from those of the host, and runs its own OS and applications.


The operating system the virtual machine is installed on is called the host OS, while the operating system of the virtual machine itself is referred to as the guest OS. Each guest OS starts up and runs in an individual window on a host OS, similar to an ordinary program.

 

Types of VMs

System Virtual Machines

  • System VMs, sometimes called full virtualization, are run by a hypervisor and provide the functionality of an actual computer system. They use the host’s native operating system to manage and share system resources.
  • System virtual machines often require a powerful host with fast or multiple CPUs, large amounts of memory, and tons of disk space. Some, which run on personal or laptop computers, may not require the computing power that big enterprise virtual servers need; however, they’ll run slow if the host system is not adequate.

Process Virtual Machines

  • Process Virtual Machines are quite different from SVMs—you may have them running on your machine and not even know it. They are also known as application virtual machines or managed runtime environments (MREs). These virtual machines run inside a host operating system and support applications or system processes.

Why use a PVM?

They perform services without being dependent on specific operating systems or hardware. They have their own little OS with only the resources they need. The MRE is in a separate environment; it doesn’t matter if it runs on Windows, Mac OS, Linux, or any other host machine.

One of the most common Process Virtual Machines is one that you have probably heard of and may have seen running on your computer. It is used to run Java applications and is called the Java Virtual Machine or JVM for short.

All the virtual hardware which powers the guest OS is handled by a special engine called a hypervisor. The hypervisor is known as virtual machine manager: it allocates physical resources to each of the systems and ensures that they do not interrupt each other. As a rule, hypervisors are implemented on the software level, but there are also ones embedded into the system firmware.


Types of Hypervisors

Most of the virtual machines that we are concerned with use a hypervisor because they emulate an entire computer system. There are two different types of hypervisors: Bare Metal Hypervisors and Hosted Hypervisors. Let’s take a quick look at both of them.

 

  1. Bare Metal Hypervisor

  • BMHs may also be called native hypervisors, and they run directly on the host’s hardware instead of running within the host’s operating system. In fact, they take the place of the host’s operating system, scheduling and managing hardware use by each virtual machine, thus cutting out the “middle man” (the host’s OS) in the process.

  • Native hypervisors are normally used for large-scale enterprise VMs, which companies use to provide employees with server resources. Microsoft Azure or Amazon Web Services are VMs hosted on this type of architecture. Other examples are KVM, Microsoft Hyper-V, and VMware vSphere.

      2.  Hosted Hypervisor

Hosted hypervisors run on standard operating systems—just like any other application that we run on our machines. They use the host’s OS to manage and distribute resources. This type of hypervisor is better suited for individual users who need to run multiple operating systems on their machines. These include applications like Oracle VirtualBox, VMware Workstations, VMware Fusion, Parallels Desktop, and many others. You can find more detailed information about hosted hypervisors in our article, “The Best Virtual Machine Software.”

 

Why Use VMs

Now that you have a basic understanding of what a virtual machine is, you can probably think of some excellent applications. Here are some of the top reasons people use virtual machines.

  1. Cost-Effective
  2. Scalable and Flexible
  3. Quick setup
  4. Disaster Recovery
  5. Easy to Reproduce
  6. Perfect for Dev/Test

 

Benefits of Using a Virtual Machine

 

Due to the extra layer of abstraction, it’s possible to mix and match operating systems by running a Windows VM inside Linux OS or a Linux VM on macOS. There are even some hypervisors, like QEMU, designed to also run different architectures which will allow us to use software applications and operating systems written for different CPU architectures.

 

If we weren’t using virtualization we would have to purchase a physical server for each of our workloads. Virtualization allows us to consolidate our computing resources which allows us to reduce space and maintenance costs. It’s also easier for us to go out and “rent” the computing resources from providers like Digital Ocean or Amazon Web Services when we don’t need a lot of them.

 

Disadvantages of Using a Virtual Machine

Because there is at least one level of abstraction between our VMs workload and the physical resources it’s using there will always be at least a small performance hit. In cases where this loss of performance is unacceptable (database servers, applications with lots of CPU-bound operations, real-time application) virtualization is a poor choice. In these cases, it’s best to purchase a dedicated computer for the workload.

 

There is a limit to the number of VMs a single host can handle and we must monitor any system that has multiple VMs. The risk we run is that because the hypervisor abstracts the physical hardware away from the guest operating system it’s possible to “oversubscribe” the physical resources of the host computer. For example, we might have 8 GB of physical RAM but we can allocate 4 VMs with 4 GB each. When we do we must make sure the VMs aren’t using the total 16 GB we’ve assigned. If this happens, it will cause performance problems for all 4 VMs as they’re forced to use a swap file.

 

 


Popular Posts