Let’s talk about abstraction.

On a high level Hypervisors abstracts the hardware & allows us to run multiple Operating Systems where Containers abstracts the Operating System Kernel and allows us to run multiple applications.

It’s a very deep topic with lots of moving parts but let’s just understand the difference between Hypervisors & Containers in this post.

Hypervisors

Hypervisors are systems that either run on top of a bare metal (physical) server or inside a host Operating System and enables Hardware Virtualization which can be used to run multiple operating systems completely isolated from each other on top of it.

There are two types of hypervisors

  • Type 1 Hypervisors (Native)
  • Type 2 Hypervisors (Hosted)

Type 1 Hypervisor (Native)

Type 1 hypervisors run directly on a bare metal (physical) servers / Infrastructure and allows us to run multiple Operating Systems on top of it.

Type 1 Hypervisors

Let’s say we have a Type 1 hypervisor running on top of our server now we can run Windows 10, Ubuntu & CentOs Operating systems on the same machine completely isolated from each other.The Hypervisor will provide virtual cpu, storage & memory to the operating systems.

The Operating Systems will use these abstracted virtual resources as they would use a physical resource.

Few examples of Type 1 Hypervisors are Microsoft Hyper-V , VM Ware EXSi, Citrix Hypervisor, KVM etc.. ​

Type 2 Hypervisor (Hosted)

Type 2 Hypervisors are also known as hosted hypervisor runs inside a host operating system.The host operating system runs on a physical server / Infrastructure and the hypervisor runs inside the host operating system enabling virtualization.

Type 2 Hypervisors

In this setup we will have our host operating system (lets say Windows 10) running on top of our bare metal (physical) server and we can install a Type 2 hypervisor in our host operating system and now we can install our guest operating system (lets say ubuntu) using our hypervisor.

Few examples of Type 2 Hypervisors are VMWare Workstation , Oracle Virtual Box, Parallels etc.

Containers

The new kid in the block is container.
Although containers seems like Virtual Machines to many its not.

Lets take Docker for example.

Containers

Docker requires Docker Daemon (Container Engine) that runs inside a host operating system.Here the host Operating System which runs on a bare metal server / VM can be very basic and minimal.We don’t need all the dependencies which are required to run our application(s) to be available in the host operating system.

Docker Daemon runs containers from Docker Images which is built specific for each application.These containers are the running processes of our docker Images which runs our applications in its own environment completely sandboxed.

We can have as many containers running completely isolated from each other.

Containers can have their own base OS or no OS configuration.They can even have their own kernel (windows Hyper-v containers) - This is a topic on its own & we will get back to this in detail in a future post

Few alternatives to docker are LXC, rkt etc..

In comparison as you can understand Hypervisors helps us to run multiple OS completely isolated & containers helps us to run multiple applications completely isolated communicating with the host OS kernel directly.

To Conclude you can imagine Virtual Machines as Independent Houses & Containers as Apartments.

Share