LAUNCHMongoDB 8.3 is built for the sub-100ms retrieval & zero downtime AI demands. Read blog >
AI DATAStop fighting your data layer. Get the memory & retrieval agents need to scale. Read blog >

A Guide to Virtual Machines (VMs)

Try Atlas Free

A virtual machine (VM) is an isolated software system that lets multiple operating systems (OS) run on a single physical computer or server. Virtualization technology makes this possible by dividing the machine into separate virtual environments.

IT teams rely on VMs because a single physical machine rarely meets every need. Students may use them to run class-specific software or a second operating system on the same device.

In all cases, VMs provide cost savings and a flexible way to optimize resources without adding new hardware, enabling businesses to scale without purchasing new equipment.

Key takeaways

Table of contents

What is a virtual machine?

A virtual machine is a software-based computer (known as a “guest”) that runs its own operating system on part of a physical computer (the physical “host” computer). Virtualization software divides the host into separate spaces that can hold multiple VMs at once—each with its own operating system, isolated workspace, and virtual hardware.

IT teams often use VMs to:

  • Try out different operating systems.
  • Test software in a clean, repeatable environment.
  • Preserve legacy applications.
  • Adjust virtual hardware on demand.

In practice, a VM feels like spinning up a new computer whenever you need one—and shutting it down just as easily.

How virtual machines work: Virtualization and hypervisors

Virtualization creates virtual versions (guests) of physical hardware (hosts) by letting multiple VMs share hardware resources. A virtual machine monitor (hypervisor) manages this process by coordinating CPU time, allocating physical resources like memory and storage, and translating requests into machine code that the physical hardware can execute.

Every request a VM makes—reading memory, writing to disk, or sending network traffic—passes through the hypervisor. This is how cloud platforms safely run thousands of workloads on shared physical hardware. Without this layer, virtualization—and much of modern cloud computing—would not be possible.

Two common virtualization stacks show how these layers relate on a physical machine:

  • Physical hardware → Hypervisor → Virtual machine (guest OS)
  • Physical hardware → Host OS → Hypervisor → Virtual machine (guest OS)

In some respects, system virtual machines extend the concept of virtual memory—which gives each process the illusion of its own dedicated memory space—to the entire machine, so each VM appears to have dedicated hardware resources.

This approach is foundational to cloud computing. It enables cloud providers to deliver infrastructure as a service (IaaS), offering virtualized servers, storage, and networking that scale on demand.

Core responsibilities of a hypervisor

  • Scheduling access to CPU, memory, storage, and networking so multiple VMs can run efficiently on the same physical machine
  • Enforcing resource limits and priorities so no VM consumes more than its allocated resources or affects the performance of others
  • Providing hardware abstraction, which allows VMs to run different guest operating systems regardless of the host’s underlying hardware
  • Maintaining isolation so that issues within one VM—such as crashes or unsafe files—do not impact other VMs or the host environment

Tech tip: what “isolation” really means

Isolation doesn’t just separate workloads—it protects them. If a test VM crashes, the host and other VMs continue running. This is one reason developers rely on VMs for safely testing changes.

Deep dive: Type 1 vs. Type 2 hypervisors

A hypervisor comes in two main forms, each suited for different environments and use cases.

Type 1: Bare-metal hypervisors

  • Run directly on the physical machine's hardware (or convert the host kernel into a hypervisor, as KVM does)
  • Provide strong performance and stability
  • Have direct access to host hardware for better performance
  • Common in data centers and cloud service providers
  • Examples: VMware ESXi, Microsoft Hyper-V (Server), KVM

Type 2: Hosted hypervisors

  • Run as applications on top of a host OS like Windows, macOS, or Linux
  • Useful for trying out a new operating system without replacing your existing one
  • Ideal for personal use, testing, and development
  • Examples: VirtualBox, VMware Workstation, and Parallels Desktop

Tech tip: choosing the right type

  • Use Type 1 for production workloads.
  • Use Type 2 for a simple, local way to run another operating system

Deep dive: Types of virtual machines

Virtual machines come in two forms, but most real-world infrastructure relies on system virtual machines.

Process virtual machines

Process VMs—also called application virtual machines—provide a managed runtime environment for applications rather than virtualizing full operating systems. Examples include Java Virtual Machine (JVM) and .NET CLR.

System virtual machines

A system VM behaves like a complete computer—it runs its own OS, applications, and virtual hardware. It is created from a guest OS image that defines the operating system and base configuration for the VM. These are the VMs used in cloud computing data centers, such as AWS EC2, Azure Virtual Machines, and Google Compute Engine.

System VMs rely on hypervisors like VMware ESXi, Hyper-V, and KVM to run multiple isolated environments on shared physical host machines.

Common examples include:

  • A Linux VM running a web server.
  • Windows virtual machines powering internal business apps.
  • A temporary VM for testing updates or patches.
  • A legacy operating system preserved for compatibility.

System VMs are the “virtual computers” this guide focuses on.

How organizations use virtual machines

VMs run on everything from laptops to enterprise data centers. Organizations use VMs because they create isolated environments that offer flexibility, improve efficiency, reduce costs, and strengthen security.

Local tools

Developers use tools such as Oracle VirtualBox, VMware Workstation, Hyper-V, and Parallels Desktop to run multiple operating systems from a single laptop or desktop.

Cloud platforms

Services like Amazon EC2, Azure Virtual Machines, and Google Compute Engine run on physical servers in secure multi-tenant environments, delivering scalable, on-demand VM instances for running web apps, analytics jobs, and development workloads.

Common use cases

  • Testing software across different operating systems
  • Running applications that require isolation from the host machine
  • Maintaining legacy applications without dedicated hardware
  • Creating temporary environments for experiments or development work
  • Supporting software development workflows with isolated, repeatable environments

Real-world examples

Powering classroom computer labs: A university lab may use the same set of PCs to host multiple VMs. Students log into different virtual desktops depending on the course—data science, game design, cybersecurity—without needing separate physical workstations.

Integrating legacy and modern systems: A retailer may depend on an older point-of-sale application that runs on an outdated version of Windows, while other departments use modern Linux tools. Instead of maintaining old hardware, IT can host the legacy system in a virtual machine alongside newer workloads on a single physical server.

These examples show how VMs support diverse workloads and keep systems independent and flexible.

Sizing and allocating virtual machines

Teams choose a VM size by matching the CPU, memory, and storage to the workload it needs to run. Cloud providers offer predefined VM families for everyday use cases, making selection easier. Choosing the right size keeps things running smoothly without driving up costs.

 

Criteria for choosing the best virtual machine
VM type Optimized for Typical workloads
Lightweight Minimal CPU and memoryUtility scripts and small test environments
General-purposeA balanced mix of CPU, RAM, and storage Web apps and internal business tools used by multiple users
Compute-optimizedExtra processing power (more CPU) Data analysis, math-heavy jobs, and scientific models
Memory-optimizedMore RAM for handling large data sets Databases, caching systems, and apps that need fast access to lots of data
Storage-optimizedFast reading and writing of large files Log processing, data pipelines, and workloads that move or scan big datasets

 

Tech tip: bigger isn't always better

It’s tempting to assume a bigger VM will perform better, but oversizing can lead to "noisy neighbor" issues—where one massive, underutilized VM hogging resources affects the performance of others on the same physical host.

For managed databases, MongoDB Atlas runs on cloud-provider virtual machines and automatically selects configurations that match CPU, memory, and storage requirements.

Other types of virtualization

Virtualization applies to more than full computers. It can also virtualize desktops, storage, networks, software environments, and individual applications—each solving a different problem for organizations.

Hardware virtualization

  • Creates full VMs by allocating a physical machine's CPU, memory, storage, and networking resources
  • Example: An IT team quickly provisions new VM instances for different departments without buying additional physical servers.

Desktop virtualization

  • Delivers a remote desktop environment that users can access from any device
  • Example: A healthcare organization gives clinicians a secure, cloud-hosted desktop they can access from exam rooms on laptops or tablets.

Storage virtualization

  • Combines multiple physical storage devices into one logical storage system
  • Example: A media company stores large video files across multiple drives but treats them as a single central storage system for editors.

Network virtualization

  • Builds a virtual network that operates independently from physical switches
  • Example: A development team creates temporary, isolated test networks for staging environments without altering the company’s production network.

Software virtualization

  • Simulates an entire software environment for compatibility or testing
  • Example: A QA engineer runs an older operating system inside a virtual environment to test how an application behaves on legacy software.

Application virtualization

  • Runs or streams individual applications without installing them on the host machine
  • Example: An employee launches an internally managed app from a server even though the software is not installed on their laptop.There are many types of virtualization, including application, desktop, network, hardware, storage, data, data center, GPU, Linux, and cloud virtualization. For the purposes of this discussion, the following types of virtualization are most relevant.

Deep dive: Virtual machines vs. containers vs. microVMs

Virtual machines aren’t the only option for running isolated environments. Containers and microVMs offer lighter-weight approaches, but they solve different problems.

Virtual machines: VMs include their own full operating system (kernel + user space) and provide the strongest isolation. They are best suited for complete OS control, legacy applications, and multi-tenant security.

Containers: Containers package the application and its dependencies but share the host OS kernel. This makes them incredibly lightweight (starting in milliseconds) but means they have a shared attack surface with the host.

MicroVMs: These combine VM-level isolation with container-like startup speed. Technologies like AWS Firecracker strip away unnecessary hardware emulation to create minimalist VMs that start in a fraction of a second, making them ideal for serverless workloads.

Developers often test MongoDB in containers, but MongoDB Atlas runs on cloud VMs to ensure isolation, predictable performance, and automated scaling.

Setting up a virtual machine

Before creating a VM, ask yourself a few questions:

  • What's the primary use case?
  • Which resources will it need (memory, storage, CPU)?
  • Which operating system will it run on?
  • How will you handle backups and security?

Most cloud providers, including AWS, Azure, and Google Cloud, offer VM wizards that walk you through setup in minutes. You'll typically name your VM, choose a region, select a machine type, pick an OS image or machine image, and configure access controls.

Cloud providers also attach a virtual disk (sometimes called a boot disk) that stores the VM’s operating system and data, making it easy to create a new virtual machine configuration repeatedly without touching the underlying hardware.

For local development or personal use, tools like Oracle's VirtualBox and VMware Workstation let you run virtual machines directly on your laptop or desktop.

The future of virtual machines

Virtual machines are one of the easiest, most reliable ways to run workloads in a virtualized environment on shared hardware, whether you’re testing new software, supporting legacy systems, or powering cloud apps.

Market forecasts suggest steady growth ahead, with VM spending expected to top $43 billion by 2034 (Precedence Research, 2024). And with AI now helping handle tasks like capacity planning and auto-scaling, VM environments are becoming easier—and more efficient—to manage.

FAQ: Common questions about virtual machines

What is IaaS (Infrastructure as a Service)? Learn how IaaS delivers virtualized compute, storage, and networking as on-demand cloud services.

Cloud Architecture: A Comprehensive Guide Explore how virtual servers, storage, and networking combine to build scalable cloud environments.

What is a Virtual Private Cloud (VPC)? Understand how VPCs create isolated network environments within public cloud infrastructure.

Horizontal vs. Vertical Scaling Compare strategies for expanding database capacity by adding resources or machines.

Get started with Atlas today

Get started in seconds. Our free clusters come with 512 MB of storage so you can play around with sample data and get oriented with our platform.
Try FreeContact sales
GET STARTED WITH:
  • 125+ regions worldwide
  • Sample data sets
  • Always-on authentication
  • End-to-end encryption
  • Command line tools