Beginner’s Guide to Virtualization

Aliya Fatima
9 min readApr 5, 2023

Whether you’re an aspiring IT professional or just curious about virtualization, in this article I’ll discuss the overview of what virtualization is.

Different Operating System logos

Imagine we have a Windows computer. As we learned, a computer has hardware components such as CPU, RAM, and storage. On top of these, we have a Windows operating system that controls how applications use these hardware resources. Applications talk to Windows, and everything works fine.

But what if we wanted to use Linux instead? Maybe for work, or maybe we just want to learn a new operating system. In that case, we would need a machine with hardware resources and Linux operating system on top of it. Then, we could run applications on that Linux operating system.

Traditional architecture vs Virtual architecture

Virtualization allows us to install an operating system on top of the Windows OS or vice versa, without needing a separate physical computer. A hypervisor is a technology that allows us to host multiple virtual computers on a physical computer on top of the operating system that we already have installed. One of the most popular hypervisors out there is VirtualBox from Oracle, which is open-source and works on all operating systems.

VirtualBox is a Type 2 Hypervisor, which is open source.

VirtualBox lets us create a virtual computer on our Windows computer by telling the Windows operating system, “Hey, can I have some of your hardware resources that you manage to create a virtual CPU, virtual RAM, and virtual storage for my virtual computer?” We can have multiple virtual machines running on our computer through a hypervisor. Note that we can only give the virtual computer the hardware resources we actually have available on that computer. If we have eight gigabytes of RAM and our Windows is using four gigabytes, and if we give our virtual machine another four gigabytes, then we have no RAM left to be used for another virtual machine. So, we can’t create another one.

The virtual machines are completely isolated, so they don’t see each other. The virtual machine itself thinks that it is an independent computer, and it doesn’t even know that it’s a virtual machine hosted on top of another operating system. This separation is great because if something happens to that virtual machine or someone hacks inside that virtual machine, it won’t affect the main operating system. The main OS probably won’t even know that the VM has some issues, and it doesn’t care. When this happens, we can just delete that VM and create a fresh new one easily.

The usage or benefits of having a hypervisor and virtual machines on your computer are numerous. First of all, it’s great for learning new operating systems. We don’t have to go and buy a new computer and install Linux on it. We can just host it on your Windows machine. We can experiment and play around with an operating system without actually destroying or endangering our main operating system. Second, it’s great for testing applications. For example, we can create virtual machines for different operating systems and browsers to test our web application’s performance and appearance.

Type 1 Hypervisor vs Type 2 hypervisor

Let’s explore the differences between type 1 and type 2 hypervisors. The type of hypervisor that creates virtual machines on top of an existing operating system is called a type 2 hypervisor. In this case, we have a host operating system or a main operating system that is already installed on the hardware of our machine. On that operating system, we install a hypervisor like VirtualBox, for example. We can then install guest operating systems using VirtualBox. These guest operating systems borrow hardware resources from the host operating system. Type 2 hypervisors are usually used for personal computers, for the use cases described above.

For big servers that companies use, the second type of hypervisor is a type 1 hypervisor, which works in the same way as the type 2 hypervisor. The main difference is that instead of installing a hypervisor on a host operating system, we install it directly on the hardware. This is why type 1 hypervisors are also called bare metal hypervisors. The hypervisor controls the hardware resources instead of talking to the host operating system for resources for its virtual machines. It sits directly on top of the hardware and controls everything. Some popular examples of type 1 hypervisors are VMware ESXi or Microsoft’s Hyper-V.

Once installed, the concept is the same as with type 2 hypervisors. We simply install any operating system on top of it. For big servers, we have one physical server with a bare metal hypervisor installed on it, and then we would have multiple virtual machines running on that hypervisor, all sharing the same hardware resources. Type 1 hypervisors are mostly used by big companies and big cloud platforms to create and run their whole infrastructure. When we create a server instance on a cloud platform like AWS or DigitalOcean or Google Cloud, we are creating these virtual machines on a physical server. Other users who create an instance may get a virtual machine on the same exact physical server as our virtual machine, but these VMs are completely isolated. They don’t share anything; they’re completely independent from each other.

Type 2 or hosted hypervisors are useful for personal computers, as described above. Type 1 hypervisors, on the other hand, are useful for efficient usage of hardware resources. We can let users put together any combination of resources they want in their instance by picking and choosing how much CPU, RAM, and storage we want. There is one more very important benefit and transformation that happened in the IT industry because of virtualization, and that is abstracting away the operating system that is running on the hardware from the hardware itself. That abstraction is a really big deal, as it eliminates the risk of losing all our services running on a machine if a hardware component fails. By containing the operating system and the application layer of it in a portable file, we can secure our application and our work very easily, and we can move it around machines without being dependent on any physical server. Virtual machines and the virtualization concept generally are very powerful, and that’s why we see them everywhere in IT. They have completely changed the way we work.

To summarize:

What is virtualization?

Virtualization is a process that allows a computer to share its hardware resources with multiple digitally separated environments or virtual computers commonly called as Virtual Machines (VMs). Each virtualized environment runs within its allocated resources, such as memory, processing power, and storage and behaves like an independent computer, even though it is running on just a portion of the actual underlying computer hardware. With virtualization, organizations can switch between different operating systems on the same server without rebooting.

Why is virtualization important?

By using virtualization, we can interact with any hardware resource with greater flexibility. Physical servers consume electricity, take up storage space, and need maintenance. We are often limited by physical proximity and network design if we want to access them. Virtualization removes all these limitations by abstracting physical hardware functionality into software. We can manage, maintain, and use our hardware infrastructure like an application on the web.

Virtualization example

Consider a company that needs servers for three functions:

  1. Store business email securely
  2. Run a customer-facing application.
  3. Run internal business applications.

Each of these functions has different configuration requirements:

  • The email application requires more storage capacity and a Windows operating system.
  • The customer-facing application requires a Linux operating system and high processing power to handle large volumes of website traffic.
  • The internal business application requires iOS and more internal memory (RAM).

To meet these requirements, the company sets up three different dedicated physical servers for each application. The company must make a high initial investment and perform ongoing maintenance and upgrades for one machine at a time. The company also cannot optimize its computing capacity. It pays 100% of the servers’ maintenance costs but uses only a fraction of their storage and processing capacities.

Efficient hardware use

With virtualization, the company creates three digital servers, or virtual machines, on a single physical server. It specifies the operating system requirements for the virtual machines and can use them like the physical servers. However, the company now has less hardware and fewer related expenses.

Infrastructure as a service

The company can go one step further and use a cloud instance or virtual machine from a cloud computing provider such as AWS. AWS manages all the underlying hardware, and the company can request server resources with varying configurations. All the applications run on these virtual servers without the users noticing any difference. Server management also becomes easier for the company’s IT team.

Benefits of Virtualization

  • Resource efficiency: Virtualization allows for better utilization of hardware resources since multiple virtual machines can run on a single physical server. This reduces the need for additional physical servers and associated power, cooling, and maintenance costs.
  • Minimal downtime: Virtual machines can be migrated to another physical server without any downtime, allowing for hardware maintenance or upgrades while still providing uninterrupted service.
  • Easier management: Virtualization simplifies server management by allowing for centralized control and administration of virtual machines. This reduces the need for physical access to individual servers and makes it easier to apply updates and patches.
  • Faster provisioning: Virtual machines can be created and deployed quickly, allowing for rapid scalability and faster time-to-market for new applications.
  • Faster disaster recovery: In the event of a hardware failure, virtual machines can be quickly restored to another physical server, minimizing downtime and reducing the risk of data loss.

How does virtualization work?

Virtualization uses specialized software, called a hypervisor, to create several virtual machines on one physical computer.

Virtual Machines

After installing virtualization software on our computer, we can create one or more virtual machines. We can access the virtual machines in the same way that we access other applications on our computer. Our computer is called the host, and the virtual machine is called the guest. Several guests can run on the host. Each guest has its own operating system, which can be the same or different from the host operating system.

From the user’s perspective, the virtual machine operates like a typical server. It has settings, configurations, and installed applications. Computing resources, such as central processing units (CPUs), Random Access Memory (RAM), and storage appear the same as on a physical server. We can also configure and update the guest operating systems and their applications as necessary without affecting the host operating system.

Hypervisors

The hypervisor is the virtualization software that we install on our physical machine. It is a software layer that acts as an intermediary between the virtual machines and the underlying hardware or host operating system. The hypervisor coordinates access to the physical environment so that several virtual machines have access to their own share of physical resources.

For example, if the virtual machine requires computing resources, such as computer processing power, the request first goes to the hypervisor. The hypervisor then passes the request to the underlying hardware, which performs the task.

The following are the two main types of hypervisors.

  • Type 1 or “bare-metal” hypervisors interact with the underlying physical resources, replacing the traditional operating system altogether. It has some operating system capabilities and is highly efficient because it interacts directly with the physical resources. They most commonly appear in virtual server scenarios.
  • Type 2 hypervisors run as an application on an existing OS. Most commonly used on endpoint devices to run alternative operating systems, they carry a performance overhead because they must use the host OS to access and coordinate the underlying hardware resources.

In conclusion, virtualization is a powerful tool that allows you to create and run multiple virtual machines on a single physical computer. This technology is widely used for learning new operating systems, testing applications, and for efficient usage of hardware resources. Virtualization has transformed the IT industry by abstracting away the operating system that is running on the hardware from the hardware itself. This makes it easier to manage and secure applications and the work, and we can move it around machines without being dependent on any physical server.

--

--

Aliya Fatima

Artificial Intelligence and Data Science undergrad | Exploring UI/UX, Python, & Data analysis | Avid Learner