A virtual machine, or VM, is a software-defined computer environment that behaves sufficiently like a physical computer to run an operating system and applications. It is created and managed by a hypervisor, which presents virtual processors, memory, storage devices, network interfaces and other virtual hardware to the guest operating system. From the guest's perspective, these resources can appear similar to physical hardware, although the underlying resources are provided by a physical host and mediated by virtualisation software. Multiple virtual machines can run simultaneously on one physical server, with each VM maintaining its own operating system, filesystem, applications and configuration. This provides isolation and portability while allowing physical hardware to be shared.
A VM consists conceptually of virtual hardware plus a guest operating system and its applications. The virtual machine may have a defined number of virtual CPUs, a specified amount of virtual memory, virtual disks and one or more virtual network interfaces. The guest operating system operates within this environment and does not normally need to know the exact physical hardware on which it is running. The hypervisor translates or mediates privileged operations and maps virtual resources to physical resources.
Virtual disks may be stored as files or logical storage volumes, and VM configuration can be represented as metadata describing allocated resources and virtual hardware. Because the operating system and applications are contained within the VM environment, administrators can often move or copy the workload without physically moving a server.
CPU virtualisation enables the guest to execute instructions on the host processor while the hypervisor retains control over operations that require privileged access. Modern x86 processors provide hardware-assisted virtualisation features that allow guest operating systems to execute efficiently while certain privileged operations transition through controlled hypervisor mechanisms. The guest sees virtual CPUs, often called vCPUs, which the hypervisor schedules onto physical CPU cores or threads.
Allocating more vCPUs does not automatically make a VM faster because the physical host has finite processing capacity and excessive virtual CPU allocation can create scheduling contention. Performance therefore depends on both the resources assigned to the VM and the contention created by other workloads sharing the host.
Memory virtualisation provides each VM with the illusion of its own physical memory. The guest operating system maintains its own view of memory addresses, while the hypervisor maps those addresses onto actual host memory. Hardware mechanisms such as extended or nested page tables reduce the overhead of translating these addresses. Some hypervisors can reclaim memory from guests using techniques such as ballooning, while host-level swapping can provide emergency capacity at a substantial performance cost. Memory overcommit can improve utilisation when VMs do not simultaneously consume their maximum allocations, but it must be managed carefully. A VM that requires more memory than the host can provide may experience severe performance degradation even if its configured virtual memory appears sufficient.
Virtual machines provide strong practical isolation compared with ordinary processes because each VM contains a separate guest operating-system kernel. A failure in an application inside one VM normally does not directly terminate applications in another VM, and security boundaries are stronger than ordinary process separation when the hypervisor is functioning correctly. However, virtualisation is not an absolute security guarantee. Vulnerabilities in hypervisors, virtual devices or management systems can potentially cross isolation boundaries, and administrators can accidentally expose shared resources or management interfaces. VM isolation should therefore be combined with network segmentation, secure configuration, access control, patching and monitoring rather than treated as a complete security model.
Virtual machines support many operational capabilities. Administrators can create templates and clones for consistent deployment, take snapshots for short-term rollback or testing, resize virtual resources where supported, and migrate workloads between physical hosts. High-availability platforms can restart VMs on another host after a hardware failure. Disaster-recovery systems can replicate VM storage or images to another site.
Development teams can use VMs to run different operating systems on the same physical computer, while testing teams can create isolated environments that reproduce specific software configurations. Snapshots require care because they can consume significant storage and are not equivalent to independent backups; a robust backup system should retain recoverable copies outside the immediate VM state.
Virtual machines also have costs and limitations. Each VM normally includes a complete operating-system instance, which consumes memory, storage and management resources even when its applications are small. Booting a VM can take longer than starting a lightweight process or container, and maintaining many guest operating systems increases patching and administration requirements. Performance is usually close to native for many workloads but can be affected by CPU contention, memory pressure, storage latency, virtual network overhead and inefficient configuration. Some workloads with direct hardware requirements or strict latency constraints may require specialised virtualisation configurations or physical hardware. VM density must therefore be planned according to actual resource usage rather than simply the number of virtual CPUs or gigabytes assigned.
A virtual machine differs from a container primarily in what is virtualised. A VM normally contains a complete guest operating system and its own kernel, whereas containers usually share the host kernel while isolating processes, filesystems, networks and other resources. A VM is also different from a physical server because its hardware is virtual rather than dedicated physical equipment. It differs from an application process because the VM can host an entire operating system and multiple processes. VMs remain central to enterprise virtualisation, cloud infrastructure, software testing and disaster recovery because they provide a useful combination of operating-system independence, resource abstraction, isolation and portability.