Running VMs Like Containers: How KubeVirt Powers Hybrid Workloads

Written By:
Founder & CTO
June 23, 2025

In a cloud-native era where Kubernetes dominates orchestration, one challenge consistently remains: how do you manage legacy virtual machines (VMs) while continuing to adopt containers and microservices? This friction between traditional and modern workloads can create silos in infrastructure, separate CI/CD workflows, and increased complexity in monitoring and operations.

Enter KubeVirt, a Kubernetes extension designed specifically to integrate virtual machines (VMs) into the Kubernetes ecosystem. With KubeVirt, organizations no longer have to choose between VMs and containers. Instead, they gain the ability to run both side by side on the same Kubernetes cluster, using the same Kubernetes primitives, tooling, policies, and management approaches.

This blog is a deep-dive guide for developers, DevOps engineers, and platform teams, exploring how KubeVirt runs VMs like containers, enabling hybrid workloads, increasing efficiency, simplifying operations, and unlocking modernization strategies without painful migrations. It is tailored for hands-on professionals looking to implement real solutions in the real world.

The Modern Hybrid Challenge
Why containers aren't enough

Containers have taken over the development and deployment landscape because of their portability, speed, and scalability. They’re lightweight, easy to distribute, and make microservice-based architectures extremely agile. However, many enterprises still rely heavily on legacy applications that are packaged as virtual machines due to operating system dependencies, monolithic architecture, or lack of container compatibility.

Why virtual machines are still critical

Virtual machines provide full OS-level abstraction. They are widely used in organizations to run mission-critical applications that depend on specific OS versions, Windows environments, or highly regulated and certified setups that cannot be easily re-platformed. Many of these workloads are not easily containerized, if at all.

Why managing them separately is painful

Running VMs and containers in two separate infrastructures typically means:

  • Two deployment pipelines

  • Two sets of monitoring tools

  • Fragmented security policies

  • Isolated disaster recovery strategies

This separation creates inefficiencies, slows innovation, and introduces operational debt. That’s where KubeVirt shines.

Introducing KubeVirt: Bridging the VM and Container Divide
What is KubeVirt?

KubeVirt is an open-source virtualization add-on for Kubernetes that allows developers and operations teams to run virtual machines as Kubernetes resources. Instead of replacing Kubernetes or traditional virtualization platforms like VMware, KubeVirt extends Kubernetes to support VMs in the same way it manages container workloads.

KubeVirt gives your virtual machines native Kubernetes treatment, complete with scheduling, health checks, networking, storage, and declarative configurations.

What problems does KubeVirt solve?
  • Allows legacy workloads to run in Kubernetes without refactoring.

  • Supports coexistence of VMs and containers in a single cluster.

  • Enables uniform management of all workloads, using kubectl, Helm, and GitOps.

  • Bridges DevOps pipelines to treat VMs and containers equally.

Why is it a game-changer?

Because developers can define and manage VMs using YAML, just like they do with Pods or Deployments. Because CI/CD workflows can spin up test environments in either format. Because infrastructure teams can monitor all workloads with the same Prometheus + Grafana stack. This convergence creates operational simplicity with immense strategic benefits.

How KubeVirt Works: Deep Dive into Architecture
VMs as First-Class Kubernetes Resources

KubeVirt introduces a few Custom Resource Definitions (CRDs) into the Kubernetes API:

  • VirtualMachine – a declarative definition for a VM’s desired state.

  • VirtualMachineInstance (VMI) – the actual running instance of a VM.

  • VirtualMachineReplicaSet – allows scaling VM instances similarly to Deployments.

These resources enable VMs to be treated just like Pods: schedulable, scalable, and restartable based on cluster conditions.

The Virt-Stack: Key Components

KubeVirt introduces multiple controller components that manage virtualization inside Kubernetes:

  • virt-operator: Installs and manages all KubeVirt components inside the cluster, ensuring consistency and upgrades.

  • virt-controller: Watches VM and VMI objects and ensures they exist as expected, similar to how Kubernetes ensures Pods exist as defined.

  • virt-handler: A daemon running on each node that interacts with the hypervisor (KVM) and manages VMs.

  • virt-launcher: A pod that wraps QEMU/KVM and is launched when a VM is started. This makes the VM behave like a pod.

Built on KVM and QEMU

KubeVirt uses KVM (Kernel-based Virtual Machine) and QEMU (Quick Emulator) under the hood for hypervisor functionality. Because most modern CPUs support virtualization natively (Intel VT-x/AMD-V), performance is near-native.

Tightly integrated with Kubernetes primitives

All standard Kubernetes features can be applied to virtual machines:

  • RBAC for access control

  • Labels/selectors for discovery

  • Persistent Volumes (PVCs) for storage

  • CNI plugins for networking

  • Namespaces and quotas for multi-tenancy

Real Developer Benefits of Using KubeVirt
Simplified Infrastructure

With KubeVirt, there’s no need to maintain a separate OpenStack, vSphere, or other virtualization platform alongside Kubernetes. Everything is unified under one control plane, making infrastructure simpler and less costly.

Seamless Hybrid Workflows

Developers and SREs can now:

  • Run Linux containers and Windows VMs in the same cluster.

  • Connect container-based microservices to VM-based monoliths via Kubernetes networking.

  • Roll out testing environments with real OS images that are otherwise un-containerizable.

GitOps and CI/CD for VMs

By defining VMs declaratively in YAML, they become part of your version-controlled codebase. CI/CD tools like ArgoCD, Flux, Jenkins, or GitHub Actions can be used to:

  • Deploy VMs

  • Roll back VMs

  • Test upgrades

  • Validate compliance

This was previously impossible without custom scripts and manual VM provisioning systems.

Uniform Security and Policies

RBAC, network policies, and audit logs can now include VM workloads. You can restrict who creates or modifies VM definitions, control their network access, and log changes centrally.

Key Features That Power Hybrid Workloads
Live Migration

VMs can be migrated from one node to another without any downtime, allowing infrastructure upgrades, scaling, or hardware failures to occur without affecting application availability.

Pause/Resume and State Management

Virtual Machines can be paused during idle periods to save compute costs and resumed instantly when needed. This dynamic lifecycle is crucial for test/dev or event-driven workloads.

GPU and Hardware Passthrough

With PCI passthrough and SR-IOV, KubeVirt supports hardware-accelerated applications, enabling powerful AI/ML, media processing, or telco edge workloads.

Advanced Networking

KubeVirt integrates seamlessly with Kubernetes networking, but also supports multi-networking, VLAN, bridge, and SR-IOV for performance-intensive applications.

Storage Flexibility

Attach block, file, or cloud-native storage to VMs via Persistent Volumes. VMs can use the same CSI plugins as containers do, enabling consistent backups, snapshots, and data mobility.

Use Cases Where KubeVirt Shines
Modernizing Legacy Apps

Run monolithic or uncontainerizable applications in VMs, surrounded by a mesh of microservices, all orchestrated by Kubernetes.

CI Environments with Full OS

Use KubeVirt to spin up full-blown Ubuntu, CentOS, or Windows test environments, enabling regression tests, driver testing, or compatibility validation with real OS kernels.

Telecom and Edge Computing

Deploy latency-sensitive workloads on edge nodes using SR-IOV and real-time VMs with KubeVirt. Handle millions of packets per second with custom VMs sitting right next to sidecar containers.

Disaster Recovery

Leverage Kubernetes native tools like Velero and volume snapshots to back up both container and VM workloads uniformly.

KubeVirt vs. Traditional Virtualization
Traditional VM Platforms

Traditional hypervisors like VMware ESXi or Hyper-V require their own:

  • APIs

  • Dashboards

  • Licensing

  • Separate storage/networking abstraction layers

And are not designed for cloud-native workflows.

KubeVirt Advantages
  • Open source, community-driven

  • Built into Kubernetes using native CRDs and tools

  • Works with existing cluster management tools

  • Scales horizontally with your Kubernetes cluster

  • Supports GitOps workflows

  • Unifies container and VM deployments

Developer-Focused Workflow with KubeVirt
Step 1: Install KubeVirt

Use kubectl apply or Helm to deploy the virt-operator and CRDs.

Step 2: Define a Virtual Machine

Create a YAML like this (simplified):

apiVersion: kubevirt.io/v1

kind: VirtualMachine

metadata:

  name: ubuntu-vm

spec:

  running: true

  template:

    spec:

      domain:

        devices:

          disks:

          - disk:

              bus: virtio

            name: rootdisk

        resources:

          requests:

            memory: 2Gi

      volumes:

      - name: rootdisk

        containerDisk:

          image: kubevirt/cirros-container-disk-demo

Step 3: Launch and Monitor

kubectl apply -f ubuntu-vm.yaml

kubectl get vmis

Step 4: Integrate with CI/CD

Add to Git repo, trigger deploys via webhook or pull requests. Deploy alongside container services, perfect for hybrid cloud-native delivery.

Final Thoughts: The Future of Hybrid Workloads

KubeVirt is not a replacement for containers, it’s an enabler for legacy and hybrid applications to live in the same Kubernetes-native world. For developers, DevOps teams, and SREs, it unlocks:

  • Agility: No more siloed environments or fragmented tools.

  • Consistency: One way to deploy, manage, monitor, and secure all workloads.

  • Scalability: Run traditional VMs at cloud-native scale.

As the lines between virtual machines and containers blur, KubeVirt is the bridge to a truly unified platform, accelerating modernization, reducing operational overhead, and giving developers the power to build, test, and run applications without compromise.