A virtual machine (VM) is a completely isolated guest operating system installation within a normal host operating system. It is a software implementation of a machine (i.e. a computer) that executes programs like a physical machine.
Modern virtual machines are implemented with either software emulation or hardware virtualization. In most cases, both are implemented together. Usually the term refers to system virtual machines which provide a complete system platform which supports the execution of a complete operating system (OS). Note that process virtual machine exist too, which are designed to run a single program (a single process).
An essential characteristic of a virtual machine is that the software running inside is limited to the resources and abstractions provided by the virtual machine—it cannot break out of its virtual environment.