Sitemap

Virtualization vs Containerization

4 min readFeb 11, 2025
Press enter or click to view image in full size

This is well known and basic concept for most of IT Engineers. In all stories, there can be little key areas, which you never knew or you didn’t want to know.

So let me clear everything !

IT Era was like bare-metal/physical > virtual > cloud > container > micro service

Even though I mentioned above, I did not mean we have completely moved from any of stages. There are many companies driving there infrastructure on different stages.

Physical Machine/Base Machine

So here after when I say physical machine / base machine, this is what I mean. For example assume, this is your personal workstation, laptop.

Press enter or click to view image in full size

Lets dive into Virtualization and Containerization concepts one by one.

Virtualization

Simply it create another machine (virtual machine), literally non-exist physical machine. So how virtual machine runs. We know for a physical machine, it need Kernel, CPU, Ram, Storage mainly.
Same applies to Virtual machine even it says virtual. Since no one provide these resources, Virtual machine request all the resources from base machine (except base machine’s Kernel).

So from where’s the Kernel of virtual machine ?

Well, when you build a VM (Virtual Machine) you have to select and download image from internet. That image is already packed with Kernel. Usually these images are more than 500MB size. My favourite free VM image site is https://www.osboxes.org/.

Okay now you have a VM image (eg: CentOS). These images are format of VDI (Virtual Disk Image) and VMDK (Virtual Machine DisK). Hence these image files can not read or process by Kernel. We need to have hypervisor client to install.
Hypervisor is a layer running on top of physical machine to enables the creation and management of VMs on a single physical machine (Ex: VMWare).

So now you install hypervisor on top of physical machine and then your downloaded VM image can read by physical machine to provide necessary CPU, Memory and Storage to VM from Physical machine. This resource sharing is manage by Hypervisor, so hypervisor act a crucial part of the Virtualization concept.

Press enter or click to view image in full size

Benefits:

  1. Hypervisor: A software layer that manages VMs and allocates physical resources.
  2. Full OS: Each VM runs a complete operating system, including its own kernel.
  3. Resource allocation: VMs are allocated dedicated CPU, memory, and storage resources.
  4. Isolation: VMs are fully isolated from each other and the host system.

Containerization

Now, let me begin in the middle again. So now you want to create containers on physical machine. This time you need to download container image from internet (eg: Docker hub). Most of docker images are less than size of 50MB.
Now you have a container image, but physical machine can not talk to container image. This time you need to install container runtime engine to physical machine.

Container Runtime Enginer is a software component that manages the lifecycle of containers, from creation to execution and termination. Also it works as a interface between containerized applications and the physical machine.

So this Container engine can unpack downloaded image and communicate to the physical machine Kernel. This is the main point, container image size is light weight, because it doesn’t comes with sperate Kernel. Container images always work using Physical machine Kernel (sharing physical machine Kernel all the time). Other resources (CPU, Mem, Storage) shares to containers through Container Runtime Engine.

Press enter or click to view image in full size

Benefits:

  1. Container engine: Software like Docker that manages containers and their resources.
  2. Shared kernel: Containers share the physical OS kernel, reducing overhead.
  3. Application focus: Containers typically run single applications or microservices.
  4. Resource efficiency: Containers are more lightweight and start up faster than VMs.

Okay, now lets compare. :)

Differences

Alright, lets compare these concepts in short form.

  1. Kernel usage
  • Virtualization: Each VM runs its own Kernel.
  • Containerization: Containers share the Physical Kernel.

2. Resource utilization

  • Virtualization: Higher overhead (host on top of host)
  • Containerization: Lower overhead, as containers share the Physical VM.

3. Isolation

  • Virtualization: Strong isolation between VMs.
  • Containerization: Less isolation (due to sharing Kernel)

4. Portability

  • Virtualization: Limited portability due to physical host dependencies.
  • Containerization: Highly portable across different platforms.

5. Startup time

  • Virtualization: Slower startup time due to full physical machine boot.
  • Containerization: Faster startup (seconds) as no physical machine boot is required.

6. Application compatibility

  • Virtualization: Can run different physical machine types on the same host.
  • Containerization: Limited to applications compatible with the physical machine kernel

Conclusion

We are done for today, Let me conclude. Virtualization and Containerization are two different concept, we should know very clearly. Each has its own pros and cons, that means depends to your situation you can use any concept. So think wisely, identify the pros and cons, then apply concept accordingly.

Thanks for reading, hope you got something new today.

--

--

Heshan Dharmasena
Heshan Dharmasena

Written by Heshan Dharmasena

Passionate about streamlining software delivery and building scalable, resilient infrastructure. https://CloudOps.lk/