Skip to main content
AllDevToolsHub
Back to Glossary

Virtual Machine (VM)

An emulation of a computer system that runs on top of a physical host using a hypervisor.

Detailed Explanation

VMs allow multiple isolated operating systems to run on a single physical server. Each VM has its own virtual hardware, including CPU, RAM, and disk. While VMs provide strong isolation, they have high overhead because each one runs a full OS. They were the primary way to achieve server density before the rise of containerization.

Quick Summary

A virtual machine is a software-emulated computer running its own OS on top of a hypervisor that shares physical hardware. VMs gave us the cloud, every EC2, GCE, and Azure VM is a hypervisor slice of a much bigger box.

Key Takeaways

Key Takeaways

  • Hypervisors come in two flavors: Type 1 runs directly on hardware (ESXi, Xen, KVM); Type 2 runs inside a host OS (VirtualBox, VMware Fusion).
  • Strong isolation: a kernel exploit inside one VM does not, in normal conditions, leak to another VM on the same host.
  • Startup time is seconds to minutes (full OS boot) versus milliseconds for containers.
  • VMs are the unit of billing and isolation in IaaS clouds, even "managed" services often run on VMs under the hood.
  • Lightweight VMs (Firecracker, Cloud Hypervisor) close the gap with containers, fast boot, small footprint, VM-grade isolation.
Use Cases

When to use it

  • Running workloads that need a full OS and kernel-level control.
  • Multi-tenant cloud environments where strong isolation between customers is mandatory.
  • Legacy applications that need a specific OS version and can't be containerized.
  • Sandboxing untrusted code (CI runners, function-as-a-service) with isolation stronger than containers provide.
Watch out

Common Mistakes

  • Treating VMs as pets that must live forever; modern practice is cattle, rebuild from images, don't repair.
  • Forgetting that the underlying physical host can fail; design for VM mortality and use multiple AZs.
  • Running one VM per service when a few well-sized VMs running multiple services would be cheaper.
  • Underestimating the OS overhead per VM at scale (each ~hundreds of MB of RAM just for the kernel and userspace).
FAQ

Virtual Machine (VM), Frequently Asked

VM vs. container, when is each right?

VMs when you need strong isolation, multiple kernels, or full-OS access. Containers when you want speed, density, and your workload is a single application stack. Many teams run containers inside VMs to get both density and isolation.

What is a hypervisor?

The software that creates and manages VMs by partitioning the host's CPU, RAM, and devices among guests. KVM (Linux), Hyper-V (Windows), ESXi (VMware), and Xen (used in older AWS) are the major examples.

Are VMs still relevant in a container-first world?

Yes. Every container platform, Kubernetes, ECS, Fargate, App Service, ultimately runs on VMs. They are the isolation primitive that makes multi-tenant cloud safe.

Related Terms