---
title: "KubeVirt: Running Virtual Machines on Kubernetes"
description: Learn what KubeVirt is, how it works, and how to run your first virtual machine on Kubernetes - with a hands-on lab walkthrough from install to console access.
image: https://hepapi.com/hubfs/kubevirt-running-virtual-machines-on-kubernetes-4k%20(1).webp
---

[Skip to content](https://hepapi.com/blog/kubevirt-running-virtual-machines-on-kubernetes#main-content)

[![hepapi-logo](https://hepapi.com/hubfs/hepapi-logo.svg)](https://hepapi.com/)

- [About Us](https://hepapi.com/about-us)
  
  Show submenu for About Us 
  
    - [Career](https://hepapi.com/career)
- [Services](https://hepapi.com/services)
  
  Show submenu for Services 
  
    - [Cloud Services](https://hepapi.com/cloud-services)
      
      Show submenu for Cloud Services 
      
          - [AWS Lambda](https://hepapi.com/services/aws-lambda)
          - [Amazon Relational Database Service](https://hepapi.com/services/aws-rds)
          - [AWS Elastic Kubernetes Service (EKS)](https://hepapi.com/aws-elastic-kubernetes-service-eks)
          - [AWS WAF](https://hepapi.com/services/aws-waf)
    - [DevOps Services](https://hepapi.com/services/devops)
    - [Enterprise AI Solutions](https://hepapi.com/services/enterprise-ai-solutions)
      
      Show submenu for Enterprise AI Solutions 
      
          - [Sandbox](https://hepapi.com/services/enterprise-ai-solutions/sandbox)
    - [Software QA Services](https://hepapi.com/services/software-qa)
      
      Show submenu for Software QA Services 
      
          - [TMS](https://hepapi.com/partnerships/tms)
    - [Application Modernization](https://hepapi.com/services/application-modernization)
- [Partnerships](https://hepapi.com/partnerships)
  
  Show submenu for Partnerships 
  
    - [AWS](https://hepapi.com/partnerships/aws)
    - [Suse Rancher](https://hepapi.com/partnerships/suse-rancher)
    - [SonarQube](https://hepapi.com/partnerships/sonarqube)
    - [Dynatrace](https://hepapi.com/partnerships/dynatrace)
    - [Testrail](https://hepapi.com/partnerships/testrail)
- Resources
  
  Show submenu for Resources 
  
    - [Knowledge Hub](https://hepapi.github.io/knowledge-hub/)
    - [Blog](https://hepapi.com/blog)

Open main navigation

Close main navigation

- [About Us](https://hepapi.com/about-us)
  
  Show submenu for About Us 
  
    - [Career](https://hepapi.com/career)
- [Services](https://hepapi.com/services)
  
  Show submenu for Services 
  
    - [Cloud Services](https://hepapi.com/cloud-services)
      
      Show submenu for Cloud Services 
      
          - [AWS Lambda](https://hepapi.com/services/aws-lambda)
          - [Amazon Relational Database Service](https://hepapi.com/services/aws-rds)
          - [AWS Elastic Kubernetes Service (EKS)](https://hepapi.com/aws-elastic-kubernetes-service-eks)
          - [AWS WAF](https://hepapi.com/services/aws-waf)
    - [DevOps Services](https://hepapi.com/services/devops)
    - [Enterprise AI Solutions](https://hepapi.com/services/enterprise-ai-solutions)
      
      Show submenu for Enterprise AI Solutions 
      
          - [Sandbox](https://hepapi.com/services/enterprise-ai-solutions/sandbox)
    - [Software QA Services](https://hepapi.com/services/software-qa)
      
      Show submenu for Software QA Services 
      
          - [TMS](https://hepapi.com/partnerships/tms)
    - [Application Modernization](https://hepapi.com/services/application-modernization)
- [Partnerships](https://hepapi.com/partnerships)
  
  Show submenu for Partnerships 
  
    - [AWS](https://hepapi.com/partnerships/aws)
    - [Suse Rancher](https://hepapi.com/partnerships/suse-rancher)
    - [SonarQube](https://hepapi.com/partnerships/sonarqube)
    - [Dynatrace](https://hepapi.com/partnerships/dynatrace)
    - [Testrail](https://hepapi.com/partnerships/testrail)
- Resources
  
  Show submenu for Resources 
  
    - [Knowledge Hub](https://hepapi.github.io/knowledge-hub/)
    - [Blog](https://hepapi.com/blog)
- [Contact us](https://hepapi.com/contact-us)

[Contact us](https://hepapi.com/contact-us)

[All posts](https://hepapi.com/blog/all)

 November 26, 2026

# KubeVirt: Running Virtual Machines on Kubernetes

![Picture of Erdem Doğanay](https://hepapi.com/hs-fs/hubfs/751055d8-d8e1-4c24-9b24-3ee1424d734a.jpg?width=50&name=751055d8-d8e1-4c24-9b24-3ee1424d734a.jpg)    Erdem Doğanay  ·   6 minute read

When we talk about Kubernetes, resources such as Pods, Deployments, Services, and Ingress naturally come to mind. After all, we mostly use Kubernetes to run containers. But what happens when we have an application that we cannot move into a container? Or when we want to manage both containers and traditional virtual machines on the same infrastructure?

This is exactly where KubeVirt comes in. In this post, I will first look at what KubeVirt is and why it exists. Then, instead of staying on the theory side, we will install KubeVirt in a small Kubernetes environment and spin up a virtual machine. Finally, we will look at what Kubernetes actually creates behind the scenes.

 

#### What is KubeVirt?

In simple terms, KubeVirt is a virtualization layer that lets Kubernetes run virtual machines. One detail is important here: KubeVirt does not replace Kubernetes. KubeVirt works with our existing Kubernetes cluster. After installation, we can still use Kubernetes for our VMs 

So when we want to create a VM, we do not have to switch to a completely separate virtualization API. We still talk to Kubernetes. Just as we write YAML for a Pod, we define a VM in YAML, inspect it with kubectl, and use Kubernetes scheduling, networking, and storage mechanisms.

 

#### So why do we need this?

The first question that comes to mind is pretty obvious: if we already have solutions such as VMware, Proxmox, and Hyper-V, why would we want to run virtual machines inside Kubernetes?

In real environments, we cannot containerize every application overnight. Some applications have been running for years, depend heavily on the operating system, or simply require too much effort to repackage. New microservices may be running on Kubernetes while older applications still need to stay on VMs. So now we have two different things to manage at the same time.

What I like about KubeVirt is that it brings these two worlds closer to the same control plane. We can manage container workloads and VM workloads side by side in the same cluster. This becomes especially useful for gradual modernization, legacy application migrations, development/test environments, and Kubernetes-centric private cloud platforms.

 

#### How does KubeVirt work?

When we install KubeVirt, we get some new resources in Kubernetes. Here, we mostly need to know about two things: VMs and VMIs. VM is basically our virtual machine definition. Once the VM is running, we can also see its VMI. We will see this when we try it.

Behind the scenes, virt-controller watches and coordinates cluster-level operations. There is also a component called virt-handler. This component runs on the nodes. For now, just knowing that it works with our VMs is enough. When a VM starts, we also see a virt-launcher Pod for that VM. The QEMU/KVM process for the guest is managed through this environment.

![](https://hepapi.com/hs-fs/hubfs/undefined-Nov-26-2026-06-28-16-7698-AM.png?width=1475&height=203&name=undefined-Nov-26-2026-06-28-16-7698-AM.png)

This is the part I find most interesting: we are running a VM, but we are not leaving the Kubernetes model behind. We continue using concepts we already know, such as kubectl, namespaces, the scheduler, Services, and PVCs.

 

#### Let's prepare the lab environment

For this example, I'm using a simple Kubernetes environment on Ubuntu. Minikube works fine for this. If Minikube itself is running inside a VM, nested virtualization becomes important. If /dev/kvm isn't available on the host, KubeVirt can use software emulation for testing, but for an environment where performance matters, we want KVM acceleration.

```
$ kubectl get nodes
NAME       STATUS   ROLES           AGE   VERSION
minikube   Ready    control-plane   8m    v1.34.0
```

 

#### Let's install KubeVirt

First, let's get the current stable KubeVirt release. Then we will apply the operator manifest and the KubeVirt custom resource to the cluster.

```
$ export RELEASE=$(curl -s https://storage.googleapis.com/kubevirt-prow/release/kubevirt/kubevirt/stable.txt)

$ echo $RELEASE
v1.x.x

$ kubectl apply -f https://github.com/kubevirt/kubevirt/releases/download/${RELEASE}/kubevirt-operator.yaml

namespace/kubevirt created
customresourcedefinition.apiextensions.k8s.io/kubevirts.kubevirt.io created
serviceaccount/kubevirt-operator created
deployment.apps/virt-operator created
...

$ kubectl apply -f https://github.com/kubevirt/kubevirt/releases/download/${RELEASE}/kubevirt-cr.yaml

kubevirt.kubevirt.io/kubevirt created

$ kubectl -n kubevirt wait kv kubevirt --for=condition=Available --timeout=5m

kubevirt.kubevirt.io/kubevirt condition met
```

Now let's check the kubevirt namespace. Pod names and replica counts can vary depending on the release and lab setup; what matters is that the core components are in the Running state.

```
$ kubectl get pods -n kubevirt
NAME                       READY   STATUS    RESTARTS   AGE
virt-api-7b8f9c9d7-x2k4m   1/1     Running   0          2m
virt-controller-6f7c8d9f5-p9k2x   1/1   Running   0   2m
virt-handler-k7j8p         1/1     Running   0          2m
virt-operator-79c67d5d8f-qn7vz   1/1   Running   0   3m
```

 

#### Let's install virtctl as well

We can inspect VMs with kubectl, but virtctl is much more convenient for operations such as start, stop, console, and migrate. First, let's check which KubeVirt version we have. Then we can download the correct virtctl binary for this version.

```
$ VERSION=$(kubectl get kubevirt kubevirt -n kubevirt -o=jsonpath='{.status.targetKubeVirtVersion}')

$ ARCH=$(uname -s | tr A-Z a-z)-$(uname -m | sed 's/x86_64/amd64/')

$ curl -fL -o virtctl \
  "https://github.com/kubevirt/kubevirt/releases/download/${VERSION}/virtctl-${VERSION}-${ARCH}"

$ sudo install -m 0755 virtctl /usr/local/bin/virtctl

$ virtctl version --client
Client Version: version.Info{GitVersion:"v1.x.x", ...}
```

If we try to execute the binary directly from the current directory without execute permission, we may run into an error like this:

```
$ ./virtctl start testvm
bash: ./virtctl: Permission denied
```

The problem here isn't KubeVirt; the file simply doesn't have execute permission. We can run chmod +x, or install it as an executable under /usr/local/bin as shown above.

```
$ chmod +x virtctl
$ ./virtctl --help
virtctl controls virtual machine related operations on your kubernetes cluster.
```

 

#### Let's create our first virtual machine

Now let's create a small VM. A lightweight image such as CirrOS is enough for this demo. I will use containerDisk here. This is fine for our test, but for production we should use persistent storage like a PVC.

```
apiVersion: kubevirt.io/v1
kind: VirtualMachine
metadata:
  name: testvm
spec:
  runStrategy: Manual
  template:
    metadata:
      labels:
        kubevirt.io/domain: testvm
    spec:
      domain:
        devices:
          disks:
          - name: containerdisk
            disk:
              bus: virtio
          - name: cloudinitdisk
            disk:
              bus: virtio
        resources:
          requests:
            memory: 256Mi
      volumes:
      - name: containerdisk
        containerDisk:
          image: quay.io/kubevirt/cirros-container-disk-demo:latest
      - name: cloudinitdisk
        cloudInitNoCloud:
          userData: |
            #cloud-config
            password: kubevirt
            chpasswd: { expire: False }
```

```
$ kubectl apply -f vm.yaml
virtualmachine.kubevirt.io/testvm created

$ kubectl get vm
NAME     AGE   STATUS    READY
testvm   8s    Stopped   False
```

The VM object now exists, but because we deliberately used a Manual runStrategy, it is not running yet. Let's start it with virtctl.

```
$ virtctl start testvm
VM testvm was scheduled to start

$ kubectl get vm
NAME     AGE   STATUS    READY
testvm   32s   Running   True
```

 

#### What happened in Kubernetes when the VM started?

This is where things get interesting. Instead of looking only at the VM, let's also check the VMI and Pod side.

```
$ kubectl get vmi
NAME     AGE   PHASE     IP             NODENAME   READY
testvm   21s   Running   10.244.0.18   minikube   True

$ kubectl get pods
NAME                        READY   STATUS    RESTARTS   AGE
virt-launcher-testvm-x7n2k   2/2   Running   0          25s
```

The virt-launcher Pod is a little different from a normal application Pod. It is created for our VM and stays with it while the VM is running. If we check the Pods after starting the VM, this is the one we will see.

 

#### Let's connect to the VM console

```
$ virtctl console testvm
Successfully connected to testvm console. The escape sequence is ^]

login as 'cirros' user. default password: 'gocubsgo'. use 'sudo' for root.

testvm login: cirros
Password:
$ uname -a
Linux testvm 5.x.x #1 SMP x86_64 GNU/Linux
```

Now we are inside the VM, not the Kubernetes node. We created it from Kubernetes, and now we can connect to it like a normal virtual machine.

 

#### Stopping and starting the VM again

```
$ virtctl stop testvm
VM testvm was scheduled to stop

$ kubectl get vm
NAME     AGE   STATUS    READY
testvm   7m    Stopped   False

$ kubectl get vmi
No resources found in default namespace.
```

The VM is still there, but it is no longer running. When we start it again, we will see the VMI and virt-launcher Pod again.

 

#### Where can we use KubeVirt?

I do not think KubeVirt should be approached as "let's put VMs into Kubernetes because we can." It makes sense when there is a real operational need. For example, a company may be moving toward a container platform while some legacy services still have to remain as VMs. Moving part of the application stack to Kubernetes while keeping the VM side under a similar operational model can make that transition easier.

Another use case is private cloud or edge environments. If we already use Kubernetes for most of our systems, we can manage our VMs there too. This is also how OpenShift Virtualization works with VMs.

 

#### Is KubeVirt a direct replacement for VMware or Proxmox?

I would not simply answer yes here. KubeVirt takes a different approach from a traditional hypervisor management platform. If the only requirement is to manage hundreds of conventional VMs, a dedicated virtualization platform may still be the more natural choice. KubeVirt makes more sense if we are already using Kubernetes for our applications.

So it is not really about which one is better. It depends on what we need. If we already use Kubernetes and also need to run VMs, KubeVirt can be a good option.

 

#### A few things to keep in mind

It looks simple in our lab, but production is a little different. We also need to think about storage, backups, networking, resources, and high availability. KVM access and hardware virtualization support are also important for performance.

One important detail: seeing a VM represented through a Pod does not mean the VM has somehow become a container. The VM is still a real virtual machine. The virt-launcher Pod just helps KubeVirt run and manage it in Kubernetes.

 

#### Conclusion

When I first saw KubeVirt, I was also thinking, "Why do we need VMs in Kubernetes?" After trying it, I understood the idea better. We can manage our VMs from Kubernetes just like we manage our other resources.

In this small lab, we installed KubeVirt, prepared virtctl, created a VirtualMachine, started it, inspected the VMI and virt-launcher Pod created behind the scenes, and connected to the console. The next logical step would be to replace containerDisk with persistent storage, import a real image with CDI, and then move on to Services, SSH access, snapshots, and live migration.

 

#### Further Reading

[KubeVirt User Guide - Architecture](https://kubevirt.io/user-guide/architecture/)

[KubeVirt User Guide - Installation](https://kubevirt.io/user-guide/cluster_admin/installation/)

[KubeVirt Quickstart](https://kubevirt.io/get_kubevirt/)

[KubeVirt virtctl Guide](https://kubevirt.io/user-guide/user_workloads/virtctl_client_tool/)

[KubeVirt Labs - Use KubeVirt](https://kubevirt.io/labs/kubernetes/lab1)

Share: [facebook-f icon](http://www.facebook.com/share.php?u=https://hepapi.com/blog/kubevirt-running-virtual-machines-on-kubernetes) [linkedin-in icon](http://www.linkedin.com/shareArticle?mini=true&url=https://hepapi.com/blog/kubevirt-running-virtual-machines-on-kubernetes) [twitter icon](https://twitter.com/intent/tweet?url=https://hepapi.com/blog/kubevirt-running-virtual-machines-on-kubernetes) [envelope icon](mailto:?body=https://hepapi.com/blog/kubevirt-running-virtual-machines-on-kubernetes)

## Related posts

[![](https://hepapi.com/hubfs/coredns-kubernetes-dns-service-name-resolution-4k%20(1).webp)](https://hepapi.com/blog/coredns-deep-dive-how-dns-really-works-inside-kubernetes)

[devops](https://hepapi.com/blog/tag/devops)

#### [CoreDNS Deep Dive: How DNS Really Works Inside Kubernetes](https://hepapi.com/blog/coredns-deep-dive-how-dns-really-works-inside-kubernetes)

[![](https://hepapi.com/hubfs/kubernetes-application-logs-filebeat-elastic-stack-eck.png)](https://hepapi.com/blog/collecting-kubernetes-application-logs-with-filebeat-and-the-elastic-stack-eck)

[devops](https://hepapi.com/blog/tag/devops)

#### [Collecting Kubernetes Application Logs with Filebeat and the Elastic Stack (ECK)](https://hepapi.com/blog/collecting-kubernetes-application-logs-with-filebeat-and-the-elastic-stack-eck)

[![](https://hepapi.com/hubfs/kubernetes-application-logs-fluent-bit-loki-1.webp)](https://hepapi.com/blog/from-agent-to-storage-collecting-kubernetes-application-logs-with-fluent-bit-and-loki)

[devops](https://hepapi.com/blog/tag/devops)

#### [From Agent to Storage: Collecting Kubernetes Application Logs with Fluent Bit and Loki](https://hepapi.com/blog/from-agent-to-storage-collecting-kubernetes-application-logs-with-fluent-bit-and-loki)

[![hepapi-logo-light](https://hepapi.com/hubfs/hepapi-logo-light.svg "hepapi-logo-light")](https://hepapi.com/)

[![telcoset-group-company](https://hepapi.com/hs-fs/hubfs/telcoset-group-company.png?width=120&height=36&name=telcoset-group-company.png "telcoset-group-company")](https://telcoset.com.tr/)

Transforming Enterprises with Innovative DevOps, QA, and AI Solutions

[linkedin-in icon](https://www.linkedin.com/company/hepapi) [Follow us on Facebook](mailto:info@hepapi.com)

**Company**

[About](https://hepapi.com/about-us)[Career](https://hepapi.com/career)

[Services](https://hepapi.com/services)

[Partnerships](https://hepapi.com/partnerships)

[Contact Us](https://hepapi.com/contact-us)

[Privacy Policy](https://hepapi.com/privacy-policy)  
[Cookie Policy](https://hepapi.com/cookie-policy)

[Terms & Conditions](https://hepapi.com/terms-and-conditions)

**Resources**

[Blog](https://hepapi.com/blog)

[Knowledge Hub](https://hepapi.github.io/knowledge-hub/)

 

Copyright © 2026, Hepapi Software LTD.

```json
{
  "@context" : "https://schema.org",
  "@type" : "BlogPosting",
  "author" : {
    "@type" : "Person",
    "name" : "Erdem Doğanay",
    "url" : "https://hepapi.com/blog/author/erdem-doğanay"
  },
  "dateModified" : "2026-11-26T06:34:41.414Z",
  "datePublished" : "2026-11-26T06:34:41.000Z",
  "headline" : "KubeVirt: Running Virtual Machines on Kubernetes",
  "image" : [ "https://hepapi.com/hubfs/kubevirt-running-virtual-machines-on-kubernetes-4k%20(1).webp" ],
  "mainEntityOfPage" : {
    "@id" : "https://hepapi.com/blog/kubevirt-running-virtual-machines-on-kubernetes",
    "@type" : "WebPage"
  },
  "publisher" : {
    "@type" : "Organization",
    "logo" : {
      "@type" : "ImageObject",
      "url" : "https://hepapi.com/hubfs/hepapi-logo.svg"
    },
    "name" : "Hepapi Teknoloji Anonim Sirketi"
  }
}
```