What is a virtual machine (VM)?

3 March 2024

Authors

Stephanie Susnjara

IBM Think Content Contributor

Ian Smalley

Senior Editorial Strategist

What is a virtual machine?

A virtual machine (VM) is a virtual representation or emulation of a physical computer that uses software instead of hardware to run programs and deploy applications.

By using the resources of a single physical machine, such as memory, CPU, network interface and storage, VMs enable businesses to run multiple machines virtually with different operating systems on a single device.

VMs are typically referred to as guests, with one or more “guest” machines running on a physical machine called the “host” machine. VM technology includes virtual servers, virtual server instances (VSIs) and virtual private servers (VPSs).

In a Global Market Insights (GMI) report (link resides outside ibm.com), the virtual machine market size exceeded USD 9.5 billion in 2023. GMI projects this market to expand at a compound annual growth rate (CAGR) of around 12% between 2024 and 2032, driven by the steady adoption of cloud computing. As businesses move to the cloud for its scalability, flexibility and cost efficiency, cloud providers continue integrating virtual machines and other critical technologies (for example, containers) to provide consistent IT infrastructure.

Aerial view of highways

Keep your head in the cloud 


Get the weekly Think Newsletter for expert guidance on optimizing multicloud settings in the AI era.

Background on virtualization and VMs

VMs work by using virtualization, a process of creating software-based or virtual versions of resources (compute, storage, networking, servers) or applications.

Virtualization allows for more efficient use of physical computer hardware and is foundational to cloud computing.

Virtualization is made possible with a hypervisor, also known as a virtual machine monitor (VMM). This lightweight software layer manages virtual machines as they run alongside each other.

The birth of virtualization goes back to 1964, when IBM designed and introduced CP-40, an experimental time-sharing research project for the IBM System/360. The CP-40, which later evolved into the CP-67 and then Unix, provided computer hardware capable of supporting multiple simultaneous users and laid the groundwork for virtual machines.

On August 2, 1972, IBM rolled out what many regard as the first virtual machine, the VM/370, and the first System/370 mainframes that supported virtual memory.

In 1998, VMware (link resides outside ibm.com) developed the x86 operating system, which enabled a single machine to be segmented into several virtual machines, each with its own operating system. In 1999, the company launched VM Workstation 1.0, the first commercial product that allowed users to run multiple operating systems as virtual machines on a single PC.

Today, virtualization is a standard practice for enterprise-grade IT infrastructure and a driving force in cloud computing economics, enabling businesses to drive higher capacity utilization and reduce costs. All IT infrastructure can be virtualized, including desktop environments, operating systems, storage hardware, data centers and more.

AI Academy

Achieving AI-readiness with hybrid cloud

Led by top IBM thought leaders, the curriculum is designed to help business leaders gain the knowledge needed to prioritize the AI investments that can drive growth.

How do virtual machines work?

Virtualization relies on hypervisor technology. This software layer placed on a physical computer or server (also known as a bare metal server) allows the physical computer to separate its operating system and applications from its hardware. These virtual machines can run their operating systems and applications independently while still sharing the original resources (memory, RAM, storage and so on) from the server, which the hypervisor manages. In essence, the hypervisor acts like a traffic cop, allocating resources to virtual machines and ensuring they don’t disrupt each other.

Two primary types of hypervisors exist:

  • Type 1 hypervisors run directly on the physical hardware (usually a server), replacing the OS. Typically, you use a separate software product to create and manipulate VMs on the hypervisor. Some management tools, like VMware’s vSphere, let you select a guest operating system to install in the VM. You can use one VM as a template for others and duplicate it to create new ones. Depending on your needs, you might create multiple VM templates for different purposes, like software testing, production databases or development environments. A kernel-based virtual machine (KV) is an example of a type I hypervisor.
  • Type 2 hypervisors run as an application within a host OS and usually target single-user desktop or notebook platforms. With a Type 2 hypervisor, you manually create a VM and install a guest OS inside it. You can use the hypervisor to allocate physical resources to your VM, manually setting the number of processor cores and memory it can use. Depending on the hypervisor’s capabilities, you can set options like 3D acceleration for graphics. Type 2 hypervisors include VMware Workstation and Oracle VirtualBox.

System virtual machines vs. process virtual machines

In addition to classification according to hypervisor management, virtual machines fall into two main categories: system virtual machines (also called full virtualization machines) and process virtual machines.

System VMs allow for the sharing of underlying physical machine resources between different virtual machines, each running its own operating system. In contrast, process virtual machines (also called application virtual machines) run an application inside an OS and support a single process. Java virtual machines, which run programs that are compiled in Java, are examples of process VMs.

Advantages of virtual machines

VMs offer numerous advantages over traditional physical hardware.

Resource utilization and improved ROI

Because multiple VMs run on a single physical computer, customers don’t have to buy a new server every time they want to run another OS. Therefore, they can get more return from each piece of hardware they already own, significantly reducing IT costs related to capital and operating expenses.

Agility and speed

Since VMs are software-based, it’s easy to spin up new ones, making it faster to scale up to meet new workload demands compared to provisioning new hardware-based environments.

Portability

Businesses can relocate VMs as needed among the physical computers in a network. This capability makes it possible to allocate workloads to servers with spare computing power. VMs can even move between on-premises and cloud environments, making them useful for hybrid cloud scenarios where you share computing resources between your data center and a cloud service provider.

Flexibility

Creating a VM is faster and easier than installing an OS on a physical server because you can clone a VM with the OS already installed. Developers and software testers can create new environments on demand to handle new tasks as they arise.

Security

VMs improve security in several ways compared to operating systems, which run directly on hardware. Using an external program, you can scan a VM file for malicious software. You can create a snapshot of the VM at any point and restore it to that state if it becomes infected with malware, effectively taking the VM back in time. The fast, easy creation of VMs also makes it possible to delete and recreate a compromised VM quickly, hastening recovery from malware infections.

Sustainability

With fewer physical servers needed to run workloads and applications, you can dramatically reduce energy consumption to improve your environmental impact.

Disadvantages of virtual machines

While VMs have many benefits, they do have a few disadvantages to consider.

Performance issues

VMs depend on the hardware resources made available to them on the host computer. Limited resources can lead to reduced performance and inefficiencies.

Increased complexity

Virtual machines can be complex to configure and manage, requiring teams with technical knowledge and expertise to set up and maintain them.

Single point of failure (SPOF)

VMs pose the risk of single point of failure by relying on one physical computer.

Top virtual machine use cases

VMs have a wide range of uses for both enterprise IT administrators and users, including the following:

  • Enabling cloud-based computing: VMs are the fundamental unit of cloud computing, enabling dozens of applications and workloads to run and scale successfully.
  • Speeding workload migration: Because of their portability, VMs help speed the migration of workloads from on-premises to cloud-based settings.
  • Accelerating hybrid cloud journeys: VMs provide the infrastructure for creating hybrid cloud environments that blend on-premises, private cloud and public cloud environments into a single, flexible IT infrastructure.
  • Supporting DevOps: VMs are a great way to support DevOps teams and other enterprise developers, allowing them to configure VM templates with the settings for their software development and testing processes. They can create VMs for tasks like static software tests, including these steps in an automated development workflow. These functions help streamline the DevOps toolchain.
  • Testing a new operating system: A VM lets you test-drive a new system on your desktop without affecting your primary OS.
  • Investigating malware: VMs are helpful for malware researchers who frequently need fresh machines to test malicious programs.
  • Running incompatible software: Some users need to use one OS while still needing a program that is only available in another.
  • Browsing securely: Using a virtual machine for browsing enables you to visit sites without worrying about infection. You can take a snapshot of your machine and then roll back to it after each browsing session. Users could set up this browsing scenario using a Type 2 desktop hypervisor. Alternatively, an admin could provide a temporary virtual desktop on the server.
  • Supporting disaster recovery (DR): With a virtualized environment, it’s easy to provision and deploy resources, allowing you to replicate or clone the virtual machine when needed. This process happens in minutes, as opposed to the many hours it takes to provision and set up a new physical server, which is crucial for disaster recovery (DR).

Common types of virtual machines

VMware virtual machines

The first company to successfully commercialize the virtualization of the x86 microprocessor architecture, VMware is a leader in the virtualization market (link resides outside ibm.com). VMware provides Type 1 and Type 2 hypervisor and VM software to enterprise customers.

Windows virtual machines

Most hypervisors support VMs running the Windows OS as a guest. Microsoft’s Hyper-V hypervisor comes as part of the Windows operating system. When installed, it creates a parent partition that contains itself and the primary Windows OS, each getting privileged access to the hardware. Other operating systems, including Windows guests, run in child partitions and communicate with the hardware through the parent partition.

Android virtual machines

Google’s open-source Android OS is common on mobile and connected home devices.

The Android OS runs only on the ARM processor architecture typical to these devices, but enthusiasts, Android gamers or software developers might want to run it on PCs. This situation can be problematic because PCs run on an entirely different x86 processor architecture and a hardware virtualization hypervisor only passes instructions between the VM and the CPU. It doesn’t translate them for processors with varying sets of instructions.

Various projects, like Shashlik or Genymotion, can address this problem by using an emulator that re-creates the ARM architecture in software. One alternative, the Android-x86 project, ports Android to the x86 architecture instead. To run it, you must install the Android-x86 program as a virtual machine that uses the VirtualBox type 2 hypervisor. Another alternative, Anbox, runs the Android operating system on the kernel of a host Linux OS.

Mac virtual machines

Apple allows its macOS system to only run on Apple hardware. This means you can’t run it on non-Apple hardware as a VM or under its end-user license agreement. However, you can use Type 2 hypervisors on Mac hardware to create VMs with a macOS guest.

iOS virtual machines

It is impossible to run iOS in a VM today because Apple strictly controls its iOS OS and only allows it to run on iOS devices.

The closest thing to an iOS VM is the iPhone simulator that ships with the Xcode integrated development environment, which simulates the entire iPhone system in software.

Java virtual machines

The Java platform is an execution environment for programs that are written in the Java software development language. Java’s promise—“write once, run anywhere”—means that any Java program could run on any Java platform, which is why the Java platform included a Java virtual machine (JVM).

Java programs contain bytecode, which is a form of instruction that is intended for the JVM. The JVM compiles this bytecode to machine code, which is the lowest-level language that is used by the host computer. The JVM in one computing platform’s Java platform creates a different set of machine code instructions to the JVM in another’s, based on the machine code that the processor expects.

Therefore, the JVM doesn’t run an entire OS and doesn’t use a hypervisor as other VMs do. Instead, it translates application-level software programs to run on particular hardware.

Python virtual machines

Like the JVM, the Python VM doesn’t run on a hypervisor or contain a guest OS. It is a tool that enables programs that are written in Python to run on various CPUs.

Similar to Java, Python translates its programs into an intermediate format that is called bytecode and stores them in a file ready for execution. When the program runs, the Python VM translates the bytecode into machine code for fast execution.

Linux virtual machines

Linux is a typical guest OS used in many VMs. It is also a typical host OS used to run VMs and even has its own hypervisor, the kernel-based virtual machine (KVM). Although it is an open-source project, Red Hat® owns KVM.

Ubuntu virtual machines

Ubuntu is a Linux distribution that is produced by Canonical. It is available in desktop and server versions, which you can install as a VM. Users can deploy Ubuntu as a guest OS on Microsoft Hyper-V. It provides an optimized version of Ubuntu Desktop that works well in Hyper-V’s Enhanced Session Mode, providing tight integration between the Windows host and Ubuntu VM. It includes support for clipboard integration, dynamic desktop resizing, shared folders and moving the mouse between the host and guest desktops.

Multi-tenant vs. single-tenant

In cloud computing environments, virtual machines come in both single-tenant and multi-tenant variations.

Public or multi-tenant virtual machines are virtual machines with multiple users sharing a common physical infrastructure. This model is the most cost-effective and scalable approach to provisioning virtual machines. However, multi-tenant environments lack some isolation characteristics that organizations with strict security or compliance mandates might prefer.

Two models for single-tenant virtual machines are dedicated hosts and dedicated instances.

  • dedicated host involves renting an entire physical machine and maintaining sustained access and control over that machine. This model provides maximum hardware flexibility and transparency, workload control and placement and offers some advantages for specific bring-your-own license software.
  • dedicated instance offers the same single-tenant isolation and the same control over workload placement, but it is not coupled with a specific physical machine. So, for example, if a dedicated instance is re-booted, it could wind up on a new physical machine—a machine dedicated to the individual account, but a new machine, potentially in a different physical location.

Pricing models for VMs

The most common pricing models for virtual machines in the cloud are pay-as-you-go (by the hour or second), transient/spot instances, reserved instances and dedicated hosts.

Pay-as-you-go

A pay-as-you-go model has no upfront costs for the virtual machine, and users simply pay for what they use. Customers pay by the hour or second, depending on the provider and instance type.

Transient/spot instances

The lowest-cost model of VMs, transient or spot instances take advantage of a provider’s excess capacity but can be reclaimed by the provider at any time. Transient/spot instances are useful for applications that don’t always need to be on or are prohibitively expensive in any other model.

Reserved instances

Unlike pay-as-you-go models, reserved cases come with an explicit term commitment, usually between one and three years, but are also coupled with steep discounts.

Dedicated hosts

A user typically pays the total cost of the physical server and is billed in whatever increments the provider offers dedicated servers, typically hourly or monthly.

Virtual machines vs bare metal servers

Choosing a virtual machine over a bare metal server is less about competing capabilities and more about knowing what you need and when you need it.

Bare metal servers are all about raw hardware, power and isolation. They’re single-tenant, physical servers completely void of hypervisor cycles (virtualization software) and entirely dedicated to a single customer—you.

Workloads prioritizing performance and seclusion, like data-intensive applications and regulatory compliance mandates, are typically best suited for bare metal servers, especially when deployed over sustained periods.

Enterprise resource programs (ERP), customer relationship management (CRM), supply chain management (SCM), e-commerce and financial services applications are just a few workloads ideal for bare metal servers.

In contrast, when your workloads demand maximum flexibility and scalability, you are better off placing a hypervisor on the bare metal hardware to make a virtual machine. Virtual machines increase server capacity and utilization. They are ideal for moving data from one VM to another, resizing data sets and dividing dynamic workloads.

Virtual machines vs containers

The easiest way to understand a container is to know how it differs from a traditional virtual machine (VM). In traditional virtualization, whether on-premises or in the cloud, a hypervisor helps to virtualize physical hardware. Each VM then contains a guest OS, a virtual copy of the hardware the OS requires to run and an application and its associated libraries and dependencies.

Instead of virtualizing the underlying hardware, containers virtualize the operating system (typically Linux). Each container contains only the application and its libraries and dependencies. The absence of the guest OS is why containers are so lightweight, fast and portable.

Containers and Kubernetes, the open source container orchestration platform that manages them, have become the de facto units of modern cloud-native and microservices architectures. While containers are most commonly associated with stateless services, organizations can also use them for stateful services. Containers are standard in hybrid cloud scenarios because they can run consistently across public cloud, private cloud and traditional, on-premises settings. Today, an organization might run the application on its private cloud, but tomorrow, it might need to deploy it on a public cloud from a different provider. Containerizing applications provides teams the flexibility they need to handle the many software environments of modern IT.

It’s important to note that businesses can coexist with containers and virtual machines. For instance, it is commonplace to run containers in VMs since many enterprises have VM-based infrastructure.

A company may choose a container to run an application and have a virtual machine provide the underlying infrastructure. This method combines the portability and speed of containers with the security of virtual machines. In another scenario, a financial institution may use VMs for its database systems, ensuring tighter security with resource isolation and use containers for front-end applications like customer-facing mobile apps.

The blog post "Containers versus VMs: What's the difference?" explains more.

The following video breaks down the basics of containerization and how it compares to using VMs:

Choosing a virtual machine provider

Selecting a virtual machine and cloud provider starts with reviewing your workload needs and budget requirements, along with other critical factors. Below are 10 things to consider when selecting a virtual machine service provider.

  1. Reliable support: Ensure 24 x 7 customer support by phone, email, chat and so on—or walk away. You want a real person on the other end of the line to help you through critical IT situations. It’s also important to note which cloud providers offer additional services for more hands-on backing.
  2. Managed options: Does the cloud provider offer both unmanaged and managed solutions? If you are unfamiliar with virtualization technology, consider a provider who will be responsible for setup, maintenance and ongoing performance monitoring.
  3. Software integration: Will your virtual machine environment play well with others? Operating systems, third-party software, open source technology and applications help you deliver more solutions across your business. You’ll want a virtual machine provider with support and strong partnerships with the industry’s most-used software suppliers.
  4. High-quality network and infrastructure: How up to date is the infrastructure that your new virtual machine will run on? This infrastructure includes dependable bare metal servers, modern data centers and the network backbone. A cloud provider should be able to deliver its part of the deal with state-of-the-art hardware and high-speed networking technology.
  5. Location: The closer the data is to your users, the fewer hassles you’ll encounter with latency, security and timely service delivery. An excellent global network of scattered data centers and POP locations is central to having data where and when you need it most.
  6. Backup and recovery: What plan does your cloud provider have for keeping your virtual machines up and running in the face of unexpected events? Do they also provide add-on backup and redundancy options for your virtualized environment? Continuous operation is something that you should take seriously.
  7. Scalability and ease: How fast and easy will it be for you to spin up, spin down, reserve, pause and update your virtual machine? The word you want to hear most about virtual machine scalability is “on-demand.”
  8. Varied CPU configurations: The more configurations, the more options you’ll have. Not every virtual machine configuration fits every workload during every season of usage. Be sure to look for a virtual machine provider that delivers varied configuration packages for single and multi-tenant requirements.
  9. Security layers: Your business data is currency in the highest form, especially when dealing with sensitive client information. Be sure to ask the provider about private network lines, federal data center options, built-in encryption features and meeting regulatory compliance standards, which are all essential to protecting your most valuable asset.
  10. Seamless migration support: As your IT priorities evolve, your virtual machine provider should be able to help you seamlessly transition between on-premises and off-premises. Look for complete data ingest, over-the-network and application-led migration options.
Related solutions Cloud Consulting Services

Use our cloud services, powered by our IBM Consulting Advantage platform, to speed your journey to hybrid cloud, driving cost efficiency, increased productivity, sustainability and faster time to market.

Explore cloud services
Dedicated servers hosting solutions

Dedicated server hosting from IBM provides total isolation, control, and security for mission-critical workloads with customizable options.

Explore dedicated servers solutions
IBM Cloud Virtual Server for VPC

IBM Cloud Virtual Server for VPC is family of Intel x86, IBM Z, and IBM LinuxONE virtual servers built on IBM Cloud Virtual Private Cloud.

Explore Cloud Virtual Server
Take the next step

Power your web presence with IBM Cloud's reliable and secure web hosting solutions. From high-traffic websites to enterprise applications, IBM Cloud’s Bare Metal Servers deliver flexibility, unlimited data transfer, and global reach tailored to your hosting needs.

Explore Cloud web hosting Create your free IBM Cloud account