Virtual Machine (VM): A Computer Inside a Computer
A Virtual Machine (VM) is a complete computer simulated in software, letting you run multiple isolated operating systems on a single physical machine. This is how cloud providers rent out server space.
Why it exists
Virtual Machines were created to solve the problem of underutilized hardware. Instead of dedicating an entire physical server to a single operating system and application, virtualization allows one server to host many isolated environments, maximizing hardware usage, improving efficiency, and enabling the multi-tenant architecture of the modern cloud.
The mental model
A Virtual Machine is a complete computer—with its own OS, CPU, and memory—that lives as a software file on a physical machine. You can run multiple of these "software computers" on one piece of hardware, and each one is completely isolated from the others as if it were its own physical box.
How it works
A software layer called a hypervisor runs on the physical hardware (the host). The hypervisor's job is to carve up the host's physical resources—CPU, memory, storage, networking—and allocate them to one or more guest VMs. Each VM runs on this abstracted hardware, completely unaware of other VMs on the same host. This isolation is key. There are two main types of hypervisors: Type 1 (bare-metal) runs directly on the hardware for maximum performance, which is standard in data centers. Type 2 (hosted) runs as an application on top of an existing OS, which is common for desktop development.
When to use it
Use a VM when you need full, robust isolation at the operating system level. This is perfect for running applications that require different OS versions or types on the same server, testing software in a sandboxed environment that can be easily reset, or hosting legacy applications that are tied to an older OS.
When not to use it
Avoid VMs when a lighter-weight solution will do. If you only need to isolate an application and its dependencies, not an entire operating system, a container is a far more efficient choice. Containers share the host's OS kernel, so they use fewer resources, start almost instantly, and have less performance overhead.
One canonical example
When you spin up an "EC2 instance" on AWS or a "Compute Engine" VM on Google Cloud, you are using a system VM. You choose an operating system (like Ubuntu or Windows Server), a size (e.g., 2 vCPUs, 8GB RAM), and the cloud provider's hypervisor provisions it for you on their massive physical servers, fully isolated from all other customers.
Interview question
What is a key characteristic that distinguishes a Virtual Machine (VM) from simply running multiple applications on a single operating system?
- a.VMs allow applications to run directly on the physical hardware without an intermediary.
- b.Each VM provides its own isolated operating system, sharing the host's kernel.
- c.VMs are primarily designed to reduce the overall resource consumption compared to containers.
- d.VMs enable the execution of entirely separate operating systems on a single physical machine.Correct
Why? this is the answer
The core purpose of a VM is to run multiple isolated operating systems on a single physical machine, each with its own OS. Option B is incorrect because VMs do not share the host's OS kernel; that is a characteristic of containers.
Just read this? Test yourself on what you have been reading.
Read the original → cloud.google.com
- #virtualization
- #cloud
- #infrastructure
- #os
Put your scrolling time to good use
Learn one idea, try a quiz and save useful cards for revision. Tezvyn makes it easy to learn and stay current in your tech field, a few minutes at a time.
The iPhone app is on the way
We are building it. Until it lands, nothing here is held back from you: every interview card, your saved cards, streaks and the job board all work in Safari, plus hundreds of free practice quizzes of thirty questions each. Sign in and it all carries over to the app the day it arrives.
Want it as an icon? Tap Share at the bottom of Safari, then Add to Home Screen. It opens full screen and the cards you have read stay available offline.
We are hiring for this. Every open role lists the topics its interview covers, so you can prepare for the real thing rather than guessing.
See open roles