/ˈvɜːrtʃuəl məˈʃiːn/
noun … “An emulated computer inside a host system.”
Virtual Machine, commonly abbreviated as VM, is a software-based emulation of a physical computer system. It provides an execution environment that behaves like a real hardware machine, including a CPU, memory, storage, and peripheral interfaces, while running on top of a host operating system. Virtual Machines allow programs or entire operating systems to execute in isolation from the host hardware, providing portability, sandboxing, and resource abstraction.
There are two primary types of Virtual Machines:
- System VMs: Emulate a complete hardware platform, capable of running a full guest operating system. Examples include VMware, VirtualBox, and KVM.
- Process VMs: Provide an abstraction layer to execute programs compiled to an intermediate representation, such as Bytecode. Examples include the Java Virtual Machine (JVM) and the CPython virtual machine.
Virtual Machines execute instructions by translating guest operations into host operations. System VMs may leverage hardware-assisted virtualization features, such as Intel VT-x or AMD-V, to efficiently map virtual CPU instructions to the physical CPU. Process VMs read and interpret Bytecode or perform just-in-time compilation into native instructions. Both types isolate the guest from the host environment, protecting the host from crashes or malicious code while providing a controlled, replicable runtime.
Key characteristics of a Virtual Machine include:
- Hardware abstraction: the guest OS or program sees a virtualized CPU, memory, and devices.
- Isolation and security: faults or exploits in the VM typically do not affect the host system.
- Portability: VMs can be migrated between compatible host systems with minimal modification.
- Snapshotting and rollback: system states can be saved and restored for testing or backup.
- Support for multiple concurrent VMs on a single physical host, managed by a hypervisor or VM monitor.
In a typical workflow, a developer may deploy a JVM-based application on a cloud server. The JVM acts as a process VM, interpreting Bytecode instructions and managing memory and threads independently of the underlying host operating system. This abstraction ensures that the same application behaves consistently across Linux, Windows, or macOS hosts without recompilation. Similarly, a system VM allows an entire guest OS to run within a sandboxed environment, enabling testing, development, or multi-OS hosting on a single physical machine.
Conceptually, a Virtual Machine is like a shipping container for computation. Just as containers standardize how goods are stored, transported, and accessed regardless of the ship or truck, a VM standardizes execution so software runs predictably, securely, and independently of the host hardware or operating system.
See Bytecode, Interpreter, CPU, Hypervisor.