# Virtual machine

> A complete computer made of software, running inside a real one.

- Level: Basic
- Topics: Cloud, Hardware
- URL: https://tidbit.legios.com.ar/virtual-machine/
- In Spanish: [Máquina virtual](https://tidbit.legios.com.ar/es/virtual-machine/)

A **virtual machine** (VM) is a computer that exists as software. It has what looks like its own processor, memory, disk and network card, runs its own operating system and its own programs, and as far as that software can tell, it is a real machine. Underneath, it is sharing a physical computer with other virtual machines.

A layer called a **hypervisor** makes this possible: it splits the real CPU, RAM and disks into slices and gives each VM its own, keeping them isolated so one cannot see or crash another. That lets you run Windows inside a Mac, test software on several systems at once, or keep an old program alive on an operating system that no longer runs on modern hardware.

VMs are the foundation of cloud computing. When you launch an Amazon EC2 instance or a Google Compute Engine machine, you get a virtual machine on a server in someone's data center, ready in a minute and billed while it runs. Containers are a lighter alternative: they share the host's operating system instead of each bringing their own, so they start faster but are less isolated.

## An analogy

Apartments in a building. Everyone shares the same foundation, pipes and wiring, but each apartment has its own door, its own key and its own furniture, and what happens in one does not spill into the next.

## Keep in mind

- Software that behaves like a full computer, with its own operating system.
- A hypervisor splits one physical machine into many isolated VMs.
- Cloud servers like EC2 instances are virtual machines.
- Containers are lighter because they share the host's operating system.

## Go deeper

- [What is a virtual machine? (AWS)](https://aws.amazon.com/what-is/virtual-machine/)
- [Virtual machine on Wikipedia](https://en.wikipedia.org/wiki/Virtual_machine)

## Related terms

- [CPU](https://tidbit.legios.com.ar/cpu/): The chip that runs your programs, one instruction after another, very fast.
- [Operating system](https://tidbit.legios.com.ar/operating-system/): The base software that runs a device and lets every app share its hardware.
- [Hypervisor](https://tidbit.legios.com.ar/hypervisor/): The software layer that splits one physical computer into many virtual machines.
- [RAM](https://tidbit.legios.com.ar/ram/): The computer's short-term memory: fast, small and wiped when you turn it off.
- [Cloud computing](https://tidbit.legios.com.ar/cloud-computing/): Renting computers over the internet instead of buying your own.
- [Amazon EC2](https://tidbit.legios.com.ar/amazon-ec2/): Virtual computers you rent by the hour, in any size, and switch off when done.
- [Google](https://tidbit.legios.com.ar/google/): The search company that gives most products away and makes its money on ads.
- [Server](https://tidbit.legios.com.ar/server/): A computer whose job is to answer requests from other computers, all day, every day.
