Skip to content
Latchkey

What Is a Virtual Machine? Emulated Computers in the Cloud

A virtual machine (VM) is a software-emulated computer: it runs its own full operating system on top of a hypervisor that shares one physical machine among many isolated VMs.

A VM lets one physical server pretend to be many. A hypervisor allocates CPU, memory, and disk to each VM, and each runs a complete guest OS as if it owned the hardware. VMs are the foundation of cloud compute (EC2 instances, Compute Engine VMs) and of many CI runners.

How virtualization works

A hypervisor sits between hardware and guest operating systems, giving each VM a virtual set of CPU, memory, disk, and network. The guest OS runs normally, unaware it is virtualized, while the hypervisor enforces isolation between VMs on the same host.

VMs vs containers

A VM virtualizes hardware and runs a full OS with its own kernel, so it is heavier and boots slower but isolates strongly. A container shares the host kernel, so it is lighter and starts in milliseconds. Many systems run containers inside VMs to combine isolation with density.

What VMs are good for

  • Running legacy or OS-specific software.
  • Strong isolation between tenants or workloads.
  • Lift-and-shift of existing servers to the cloud.
  • Full control over the operating system.

Cloud VMs

Cloud providers rent VMs by the second or hour: EC2 on AWS, Compute Engine on GCP, Virtual Machines on Azure. You pick a machine type (CPU, memory) and image, and the provider handles the physical hardware and hypervisor.

Role in CI/CD

CI runners are very often VMs: each job runs in a fresh VM that is torn down afterward, giving a clean, isolated environment every time. Managed runner platforms like Latchkey provision VM-backed runners on demand so jobs start on a clean machine and release the VM when done.

Key takeaways

  • A VM is a software-emulated computer running a full OS via a hypervisor.
  • VMs isolate more strongly than containers but are heavier and slower to start.
  • CI runners are often fresh, per-job VMs for a clean, isolated environment.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →