DEV Community

The difference between a Virtual Machine (VM) and a Container

They are two ways to deploy multiple, isolated services on a single platform

The Difference

VM's

  • VM's have an hypervisor managing the resources in connecting to the main physical machine
  • Multiple machine with multiple OS's can run separately in isolation

Pros

  • System reliability: host OS wont be affected even if it crashes because of isolation.
  • Provides layer of security, even if infected by some malware. Host OS will not be affected
  • Multiple OS environment running on the system.

Cons

  • Running multiple os's can lead to instability
  • Less efficient
  • Can be infected with the weakness of the Host Os

Containers

  • Key: There are exceptionally lightweight.
  • A form of operating system virtualization.

An Abstraction of the app layer that package the code and dependencies together

  • They can share The host OS kernel, libraries and binaries too

Pros

  • Extremely Lightweight and fast
  • Exemplary when it comes to CI?C implementation

Cons

  • depends on the Host OS
  • Cannot all by themselves provide security at a commendable level.
  • When a container is deleted, if the data inside is lost. You will have to add Data volumes in order to store the data.

Major Difference: Vm's Hypervisor virtualizes the physical
hardware, Each VM contains a guest OS, a virtual copy of the
hardware the oS requires to run WHILE a container
virtualizes the OS and only contains the application and it
libraries.

Discussion (0)