A Virtual Machine(VM) is just an emulator for a PC. Most emulators you run on your computer you use to emulate other things like a Gameboy or N64 or Atari, but there’s no reason one can’t pretend to be a fully functional PC
VMs are used because they’re little containers. A program running in VM1 cannot interact with something in VM2, their memories are separated, and importantly they can’t change anything on the physical machine they’re running on. If you need to test a sketchy program to see if its actually a virus you can do this in a virtual machine, and if it tries to write somewhere its not supposed to, like the ROM on your hard disk that controls it, it’ll instead write to a fake memory location in the VM, and you can just nuke the VM with minimal risk to the actual machine and the rest of the data on it.
Most web servers are running tons of VMs. A powerful AWS server can be hosting a VM that runs a chunk of Netflix, and another that has a chunk of Reddit, and another that has a chunk of Amazon Video but none of them can tell the other exists on the same machine and they can’t interact with each other.
A common Virtual machine (probably less so now) was DosBox which basically created a VM of an older PC running MS-DOS so you could emulate and play older DOS games that were expecting a CPU at 66 MHz and don’t really know what to do when one reports 4 GHz, so you instead emulate a 66 MHz CPU and a reasonable amount of memory so things don’t get wild
Latest Answers