Virtual machines allow users to run separate operating systems on a single computer by partitioning the hardware resources. Each virtual machine has its own virtual CPU, memory, disk, etc. mapped to the physical computer. This allows testing software in different environments, trying new operating systems safely, and setting up office systems quickly. However, virtual machines use the same physical resources as the host computer, so running multiple virtual machines can slow down lower-spec computers that run out of RAM and swap to disk storage.