Virtual Machines and Containers

Virtual machines (VMs) are virtual computers that don’t physically exist but are created on a physical server virtually with the help of hypervisor. A single server can host multiple VMs, each acting as a separate computer, allowing various tasks to run simultaneously. For example, one VM run on Linux operating system and other VM on Windows operating system on the same server.

Hypervisor - It is software installed on physical server which helps to create VMs on physical server. (IBM/XEN-hypervisors)

Each VM has its own Operating system and its secure

What Is a Virtual Machine and How Does It Work?

Containers are lightweight because they don't include a full operating system. Instead, they contain application libraries and system dependencies, along with a minimal operating system to run the application. They use resources from the base operating system.

What is a Container? | Docker