A virtual machine is a complete computer, with its own operating system, carved out of a physical server by software called a hypervisor.
Each machine gets a share of the server's processors, memory and disk, and is kept apart from the other machines on the same hardware.
Use one when you need a full operating system you control: a database you run yourself, older software, or a service that does not fit in a container.
