A virtual machine (VM) is a computer made of software. It runs its own operating system and applications, but its CPU, memory, disk and network card are virtual versions that a hypervisor carves out of a real, physical machine. The physical computer is the host, the operating system inside the VM is the guest, and the hypervisor sits between them and keeps each guest isolated from the others.

VMs are used to test, run and back up applications, to host servers and cloud instances, to keep legacy software alive, and to learn Linux without wiping your main OS. This guide covers how a VM works, what a hypervisor does, the components, types, uses, advantages, disadvantages, and how VMs compare to containers.

Layered VM diagram showing a physical host, hypervisor, and three guest VMs with virtual resources.

⚙️ How Does a Virtual Machine Work?

Host machine vs guest operating system

The host has the real hardware. The guest OS runs as if it had a machine to itself, and it doesn't have to match the host: a Windows laptop can run a Linux guest, and a Linux server can run Windows guests. The guest never sees the physical hardware, only the virtual devices the hypervisor gives it.

How a hypervisor allocates CPU, memory, storage and networking

When you create a VM, you decide how much it gets: say 2 vCPUs, 4 GB of RAM, a 50 GB virtual disk and one network adapter. The hypervisor schedules the guest's instructions on the physical cores, maps its memory to real RAM, stores its disk as a file or volume on the host, and passes its network traffic through a virtual switch. One physical server with 32 cores and 128 GB of RAM can run a dozen small VMs this way, each behaving like a separate server.

Why VMs are isolated from one another

Each guest has its own kernel and memory space. If one VM crashes, gets infected or runs out of disk, the others on the host keep running. That isolation is the main reason hosting providers can sell many virtual servers on shared hardware. For the wider concept, see virtualization explained.

🧠 What Is a Hypervisor?

A hypervisor, also called a virtual machine monitor (VMM), is the software that creates and runs VMs. It decides which guest gets CPU time, keeps each guest's memory apart, and emulates or passes through devices. There are two types.

Type 1 hypervisors

Type 1, or bare-metal, hypervisors run directly on the hardware with no general-purpose OS underneath. They have less overhead, and data centers and VPS providers use them. For a complete guide to this architecture, see what is a bare metal hypervisor. Examples are KVM (built into the Linux kernel), Microsoft Hyper-V and VMware ESXi.

Type 2 hypervisors

Type 2, or hosted, hypervisors install like a normal application on Windows, macOS or Linux. Every request passes through the host OS, which adds overhead, but setup takes minutes. Oracle VirtualBox and VMware Workstation are the common examples, and they're what most people use to try Linux on a desktop.

Examples: KVM, Hyper-V, VMware, VirtualBox

Platform Type Typical use
KVM Type 1 (Linux kernel module) Linux servers, VPS hosting, OpenStack clouds
Hyper-V Type 1 Windows Server environments
VMware ESXi Type 1 Enterprise data centers
VirtualBox Type 2 Desktop testing and learning
Side-by-side diagram comparing Type 1 bare-metal and Type 2 hosted hypervisor stacks.

🧩 Key Components of a Virtual Machine

Component What it does Why it matters
vCPU A share of physical CPU time Sets how much processing the guest can do
Virtual memory (RAM) Host RAM reserved for the guest Too little and the guest swaps to disk
Virtual disk A file or volume that acts as the guest's drive Easy to copy, resize and back up
VM image A preconfigured template of OS and software Lets you launch identical VMs in minutes
Virtual network adapter Connects the guest to a virtual switch NAT mode hides the VM behind the host; bridged mode puts it on the network as its own device
Snapshot / checkpoint Saves the VM's state at a point in time Lets you roll back a bad update

Hyper-V calls snapshots "checkpoints." Either way, they aren't backups: they usually depend on the original disk, so keep real backups somewhere else.

🔄 Types of Virtualisation

  • Hardware virtualisation: virtual versions of operating systems and computers amalgamated into a single primary server.
  • Software virtualisation: a computer system with the hardware that permits more than one operating system on a physical host. KVM is the best-known example — see what is the KVM Virtualizor for a deeper look.
  • Network virtualisation: multiple sub-networks on the same physical network by merging equipment into a single virtual network resource. Good for security, speed and reliability at scale.
  • Storage virtualisation: combines physical storage devices and presents them as one. Also helps disaster recovery, since data can be duplicated and transmitted to another location.
  • Desktop virtualisation: separates the desktop environment from physical devices, keeping a desktop on a remote server for access from anywhere.

For a deeper walkthrough of each, see virtualization types.

📦 Types of Virtual Machines

Process virtual machines

A process VM runs one program and disappears when the program exits. The Java Virtual Machine (JVM) is the usual example, letting the same Java bytecode run on Windows, Linux or macOS. For the operating system itself, see what is Linux OS.

System virtual machines

A system VM emulates a full computer and runs a complete OS. In hosting, cloud and server work, this is the type people mean. If you're exploring a Linux guest, see what is a Linux virtual machine.

🎯 Common Uses of Virtual Machines

  • Development and testing: build a throwaway environment, break it, restore a snapshot.
  • Running another OS: Windows on a Mac, or Linux on a Windows PC, without dual booting. For the Windows side, see what is a Windows virtual machine — and if you need a ready-made hosted Windows VM, a Windows VPS gives you one in minutes.
  • Legacy applications: keep an old app running on the OS version it needs.
  • Server consolidation: replace several underused physical servers with VMs on one host.
  • Disaster recovery: VM disks are files, so you can replicate them to another site and boot them there.
  • Training labs and sandboxing: open suspicious files or teach networking without risking a real machine.
  • Cloud hosting: almost every VPS and cloud instance is a VM.

✅ Advantages of Virtual Machines

Isolation keeps one workload's problems away from the others, and consolidation cuts hardware, power and rack costs. VMs are files, so you can copy, clone or move them between hosts; live migration on Hyper-V and VMware moves a running VM with no planned downtime. A new server from an image takes minutes instead of a wait for hardware, and you can resize vCPU and RAM as the workload grows. For deeper platform comparisons, see KVM vs VMware and Hyper-V vs VMware.

❌ Disadvantages of Virtual Machines

Every VM runs a full OS, so it uses more RAM and disk than a container. The hypervisor adds some overhead, and a VM won't match bare metal for latency-sensitive work. On an oversold host, neighbors compete for the same CPU and disk I/O. Dozens of VMs also means patching dozens of operating systems, and some platforms and guest OSes carry licensing costs.

⚖️ Virtual Machines vs Containers

A VM virtualizes hardware and runs its own kernel. A container shares the host's kernel and packages only the app and its dependencies. For a side-by-side breakdown, see VM vs container.

  Virtual machine Container
Isolation Separate kernel per VM Shared host kernel
Size Gigabytes Often megabytes
Startup Seconds to minutes Usually seconds or less
Guest OS Any OS the hypervisor supports Same kernel family as the host

Use a VM when you need a different OS, stronger isolation between tenants, or full control of the kernel. Containers fit better when you ship many small services that share one OS and need to scale fast. Plenty of teams run containers inside VMs and get both.

☁️ Virtual Machines in Cloud Computing

A cloud instance is a VM. An AWS EC2 instance, a Google Compute Engine VM and a VPS are all guests on a provider's hypervisor, sharing hardware with other customers. Some clouds also offer confidential VMs, which encrypt guest memory while it's in use. On-premises VMs give you control of the hardware and the hypervisor, while cloud VMs take the hardware work off your hands and let you add capacity on demand. If you need dedicated resources beyond a shared VPS, a virtual dedicated server gives you isolated hardware within a virtualized environment. For a hosted Linux VM, a Linux VPS is the simplest way to get started.

Dark infographic showing the VM lifecycle from image provisioning to scaling, snapshot, clone, migration, and delete.

🛠️ How to Choose the Right Virtual Machine Platform

Start with the workload. A database or game server needs dedicated vCPU and NVMe storage, and a brochure site doesn't. Check OS support: for Windows Server you'll want Hyper-V or a host that licenses Windows guests, while KVM handles Linux and Windows well. Look for snapshots, scheduled backups and migration in the control panel, then weigh price against how easily you can upgrade. I'd pick a KVM-based VPS for most self-managed Linux projects, because each guest gets its own kernel and its allocation isn't shared with neighbors the way it is on container-based plans. For a desktop-first comparison, see best virtual machine software.

🧩 Conclusion

A virtual machine is an isolated computer made of software, running on shared physical hardware under a hypervisor. Type 1 hypervisors like KVM and Hyper-V run servers and clouds, and Type 2 tools like VirtualBox run labs on a desktop. VMs are used to test, run, back up and consolidate — and to run another OS without dual booting. They isolate strongly but use more RAM and disk than containers, and the hypervisor adds some overhead. If you want a VM without managing the host, explore Virtual Machine Hosting from 1GBits for scalable, cost-efficient, and flexible deployment of multiple VMs on a single physical server — or head straight to buy VPS hosting to launch one in minutes.