Skip to content
IT glossary
DevOps and cloudUpdated December 3, 2026

Virtual machine

Виртуальная машина

A virtual machine (VM) behaves like a separate computer with its own operating system, but uses the hardware of a physical computer. A single physical computer can run several VMs at once.

Also known as: VM, виртуалка

What is a virtual machine?

When you rent a cloud server, you often get a virtual machine rather than an entire physical server. You can boot an operating system, install packages, and restart the VM without rebooting the physical machine. The physical machine is the host, and the operating system running inside the VM is the guest. Each VM boots its own kernel, so Linux and Windows guests can run side by side on the same hardware.

How the hardware is shared

A hypervisor manages the VMs and presents each guest with virtual hardware: processors (vCPUs), memory, disks, and network adapters. It schedules vCPUs on the host's physical processors, while a virtual disk might be backed by a file or a storage volume. With hardware-assisted virtualization, most guest instructions can run directly on the CPU rather than being interpreted by software.

A VM configured with four vCPUs doesn't necessarily have four physical cores reserved for it. Other guests may use the same physical CPU capacity, and performance can drop if they all get busy together. Guests can also compete for storage throughput even when plenty of CPU time is available.

Example: testing an operating system upgrade

Suppose you maintain an application on Ubuntu and want to test it on the next release. Create a VM from an image of the current release, deploy the app with test data, then upgrade the guest OS and check that the service starts after a reboot. The test exercises the boot process and system services without upgrading the host. To make the exercise repeatable, define the VM's size, image, and network in infrastructure as code and automate the application setup separately.

When to choose a VM

VMs are useful when you need control over the operating system, must support workloads with different kernel requirements, or want to run several servers on one physical machine. A container typically shares the kernel of the environment that runs it, so it doesn't have to boot a separate OS. That usually makes containers quicker to start and less resource-intensive. In practice, it's common to run containers inside cloud VMs.

An image is a starting point for provisioning a VM. A snapshot captures disk state at a point in time; some VM snapshot modes also capture memory. Snapshots are useful for rollback, but if a snapshot relies on the original disk or storage system, losing that storage can make the snapshot unusable too.

What comes up in interviews

Interviewers may ask whether two application replicas on two VMs are enough for high availability. The key question is where the VMs run: if they share a physical host, a host failure can take both down. Place replicas in separate failure domains and plan how traffic reaches a healthy replica when one fails.