A virtual machine is a virtual representation, or emulation, of a physical computer. They are often referred to as a guest while the physical machine they run on is referred to as the host.
Virtualization makes it possible to create multiple virtual machines, each with their own operating system (OS) and applications, on a single physical machine. A VM cannot interact directly with a physical computer. Instead, it needs a lightweight software layer called a hypervisor to coordinate between it and the underlying physical hardware. The hypervisor allocates physical computing resources—such as processors, memory, and storage—to each VM. It keeps each VM separate from others so they don’t interfere with each other.
While this technology can go by many names, including virtual server, virtual server instance (VSI) and virtual private server (VPS), this article will simply refer to them as virtual machines.
When a hypervisor is used on a physical computer or server, (also known as bare metal server), it allows the physical computer to separate its operating system and applications from its hardware. Then, it can divide itself into several independent “virtual machines.”
Each of these new virtual machines can then run their own operating systems and applications independently while still sharing the original resources from the bare metal server, which the hypervisor manages. Those resources include memory, RAM, storage, etc.
The hypervisor acts like a traffic cop of sorts, directing and allocating the bare metal’s resources to each of the various new virtual machines, ensuring they don’t disrupt each other.
There are two primary types of hypervisors.
Type 1 hypervisors run directly on the physical hardware (usually a server), taking the place of 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 OS to install in the VM.
You can use one VM as a template for others, duplicating it to create new ones. Depending on your needs, you might create multiple VM templates for different purposes, such as software testing, production databases, and development environments.
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 then install a guest OS in it. You can use the hypervisor to allocate physical resources to your VM, manually setting the amount of processor cores and memory it can use. Depending on the hypervisor’s capabilities, you can also set options like 3D acceleration for graphics.
The following video explains the basics of virtualization. Also check out the article, "5 Benefits of Virtualization."
VMs offer several benefits over traditional physical hardware:
VMs have several uses, both for enterprise IT administrators and users.
Cloud computing: For the last 10+ years, VMs have been the fundamental unit of compute in cloud, enabling dozens of different types of applications and workloads to run and scale successfully.
Supporting DevOps: VMs are a great way to support enterprise developers, who can configure VM templates with the settings for their software development and testing processes. They can create VMs for specific tasks such as static software tests, including these steps in an automated development workflow. This all helps streamline the DevOps toolchain.
Testing a new operating system: A VM lets you test-drive a new operating system on your desktop without affecting your primary OS.
Investigate malware: VMs are useful for malware researchers that frequently need fresh machines on which to test malicious programs.
Running incompatible software: Some users may prefer one OS while still needing a program that is only available in another. One good example is the Dragon range of voice dictation software. Its vendor, Nuance, has discontinued the macOS version of its product. However, running a desktop-focused hypervisor—such as VMware Fusion or Parallels—enables you to run Windows in a VM, giving you access to that version of the software.
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. This is something that a user could set up themselves, using a Type 2 desktop hypervisor. Alternatively, an admin could provide a temporary virtual desktop located on the server.
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 containing both itself and the primary Windows OS, each of which gets privileged access to the hardware. Other operating systems, including Windows guests, run in child partitions that communicate with the hardware via the parent partition.
Google’s open-source Android OS is common on mobile devices and connected home devices such as home entertainment devices. The Android OS runs only on the ARM processor architecture that is common to these devices, but enthusiasts, Android gamers, or software developers might want to run it on PCs.
This is 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 different instruction sets. There are various projects to address this problem.
Some projects, such as Shashlik or Genymotion, use 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 using the VirtualBox type 2 hypervisor. Another alternative, Anbox, runs the Android operating system on the kernel of a host Linux OS.
Apple only allows its macOS system to run on Apple hardware, prohibiting people from running it on non-Apple hardware as a VM or otherwise under its end user license agreement. You can use Type 2 hypervisors on Mac hardware to create VMs with a macOS guest.
It is not possible to run iOS in a VM today because Apple strictly controls its iOS OS and doesn’t allow it to run on anything other than 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.
The Java platform is an execution environment for programs written in the Java software development language. Java’s promise was “write once, run anywhere” functionality. This meant that any Java program could run on any hardware running the Java platform. To achieve that, the Java platform includes a Java virtual machine (JVM).
Java programs contain bytecode, which are instructions intended for the JVM. The JVM compiles this bytecode to machine code, which is the lowest-level language used by the host computer. The JVM in one computing platform’s Java platform will create a different set of machine code instructions to the JVM in another’s, based on the machine code that the processor expects.
The JVM, therefore, 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.
For more information on Java, check out “Java: A Complete Guide.”
Like the JVM, the Python VM doesn’t run on a hypervisor, and it doesn’t contain a guest OS. It is a tool that enables programs written in the Python programming language to run on a variety of CPUs.
Similar to Java, Python translates its programs into an intermediate format called bytecode, storing it in a file ready for execution. When the program runs, the Python VM translates the bytecode into machine code for fast execution.
Linux is a common guest OS used in many VMs. It is also a common host OS used to run VMs and even has its own hypervisor called the kernel-based virtual machine (KVM). The mainstream Linux kernel has included the KVM since 2007. Although it is an open source project, Red Hat now owns the original company that developed the KVM.
VMware was an early virtualization software vendor and is now a popular provider of both Type 1 and Type 2 hypervisor and VM software to enterprise customers.
“VMware: A Complete Guide” provides a comprehensive overview of all things VMware.
Ubuntu is a Linux distribution produced by Canonical. It is available in desktop and server versions, either of which you can install as a VM. Ubuntu can be deployed 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.
In cloud computing, virtual machines are typically offered in both single-tenant and multi-tenant variations.
Public, or multi-tenant, virtual machines are virtual machines in which multiple users are sharing common physical infrastructure. This is most cost effective and scalable approach to provisioning virtual machines, but lacks some of 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.
A dedicated host involves renting an entire physical machine and maintaining sustained access to and control over that machine, its hardware, and whatever software is installed on it. This model provides the maximum amount of hardware flexibility and transparency, workload control and placement, and also offers some advantages for certain bring-your-own license software.
A 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 nonetheless a new machine, potentially in a different physical location.
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.
Choosing a virtual machine over a physical one, also known as 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 that highly prioritize 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 of time.
E-commerce, ERP, CRM, SCM, and financial services applications are just a few workloads ideal for bare metal servers.
So when would you place a hypervisor on top of the bare metal hardware to make a virtual machine? When your workloads demand maximum flexibility and scalability.
Virtual machines effortlessly drive up server capacity and increase utilization – ideal for moving data from one virtual machine to another, resizing data sets, and dividing dynamic workloads.
The easiest way to understand a container is to understand how it differs from a traditional virtual machine (VM). In traditional virtualization—whether it be on-premises or in the cloud—a hypervisor is leveraged to virtualize physical hardware. Each VM then contains a guest OS, a virtual copy of the hardware that the OS requires to run, along with an application and its associated libraries and dependencies.
Instead of virtualizing the underlying hardware, containers virtualize the operating system (typically Linux) so each individual container contains only the application and its libraries and dependencies. The absence of the guest OS is why containers are so lightweight and, thus, fast and portable.
Containers, and the orchestration engine that manages them, Kubernetes, are well-suited for modern, cloud-native and microservices architectures. And while containers are most commonly associated with stateless services, they can be sued for stateful services as well.
Containers are also becoming more common in hybrid cloud scenarios because they can run in a consistent fashion across laptops, cloud and traditional, on-premises IT.
The blog post "Containers vs. VMs: What's the difference?" explains more.
The following video breaks down the basics of containerization and how it compares to using VMs:
Selecting a virtual machine and cloud provider doesn’t have to be challenging, as long as you know what to look for. The virtual machine needs to fit your workload needs and business budget, of course, but other factors play key roles between you and your virtualization environment. Below are ten things to consider when selecting a virtual machine service provider.
Reliable support. Ensure there’s 24/7 customer support by phone, email and chat 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.
Managed options. Does the cloud provider offer both unmanaged and managed solutions? If you don’t know virtualization technology in and out, consider a provider that’ll be responsible for setup, maintenance and ongoing performance monitoring.
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 both support for and strong partnerships with the industry’s most-used software suppliers. Note: Stay away from vendor lock-ins.
High-quality network and infrastructure. How up-to-date is the infrastructure your new virtual machine will run on? This 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.
Location, location, location. The closer the data is to your users, the less hassles you’ll run into with latency, security, and timely service delivery. A good global network of scattered data centers and POP locations is central to having data where and when you need it most.
Backup and recovery. What plan does your cloud provider have in place 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 you should take seriously.
Scalability 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 when it comes to virtual machine scalability is “on-demand.”
Varied CPU configurations. The more configurations, the better. 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 both single and multi-tenant requirements.
Security layers. Ask your provider about them, then ask about them again. Your business data is currency in the highest form, especially when dealing with sensitive client information. Private network lines, federal data center options, built-in encryption features, and meeting regulatory compliance standards are essential to protecting your most valuable asset.
Seamless migration support. Your IT priorities will always evolve. This we all know. Any virtual machine provider should be able to help you lift and shift between hybrid, on-premise and off-prem environments. Look for full data ingest, over-the-network and application-led migration options.
IBM Cloud with Red Hat offers market-leading security, enterprise scalability and open innovation to unlock the full potential of cloud and AI.
IBM Cloud for VMware Solutions is designed to help you move VMware workloads from on premises to the IBM Cloud.
IBM Cloud Virtual Servers are public and dedicated virtual servers that provision and scale on demand, with monthly and hourly billing options.
Cloud computing transforms IT infrastructure into a utility, letting you ‘plug in' to computing resources and applications over the internet, without installing and maintaining them on-premises.
Hybrid cloud integrates public cloud services, private cloud services and on-premises infrastructure into a single distributed computing environment.
DevOps speeds delivery of higher quality software by combining and automating the work of software development and IT operations teams.
IBM Cloud® Virtual Server for VPC offers fast-provisioning compute capacity with the highest network speeds and most secure, software-defined networking resources available on the IBM Cloud. Built on IBM Cloud Virtual Private Cloud (VPC) and featuring powerful, 2nd Generation Intel® Xeon® processors, this developer-friendly infrastructure helps drive modern workloads faster and easier with pre-set instance profiles, rapid deployment and private network control in an agile public cloud environment. Choose multi-tenant or dedicated, add GPUs, and pay-as-you-use by the hour.