{"id":35197848,"url":"https://github.com/nalajala4naresh/ch-vmm","last_synced_at":"2026-05-24T21:01:31.883Z","repository":{"id":290968331,"uuid":"976169759","full_name":"nalajala4naresh/ch-vmm","owner":"nalajala4naresh","description":"Run Cloud Hypervisor VM's in Kubernetes","archived":false,"fork":false,"pushed_at":"2026-05-24T14:17:53.000Z","size":12962,"stargazers_count":70,"open_issues_count":0,"forks_count":6,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-05-24T14:23:18.106Z","etag":null,"topics":["cloud-hypervisor","golang","kubernetes","microvm","virtualization"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nalajala4naresh.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-05-01T16:14:15.000Z","updated_at":"2026-05-24T14:14:56.000Z","dependencies_parsed_at":"2025-05-24T03:35:46.840Z","dependency_job_id":null,"html_url":"https://github.com/nalajala4naresh/ch-vmm","commit_stats":null,"previous_names":["nalajala4naresh/ch-vmm"],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/nalajala4naresh/ch-vmm","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nalajala4naresh%2Fch-vmm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nalajala4naresh%2Fch-vmm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nalajala4naresh%2Fch-vmm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nalajala4naresh%2Fch-vmm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nalajala4naresh","download_url":"https://codeload.github.com/nalajala4naresh/ch-vmm/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nalajala4naresh%2Fch-vmm/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33450402,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-24T19:21:36.376Z","status":"ssl_error","status_checked_at":"2026-05-24T19:21:10.562Z","response_time":57,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cloud-hypervisor","golang","kubernetes","microvm","virtualization"],"created_at":"2025-12-29T08:15:49.483Z","updated_at":"2026-05-24T21:01:31.858Z","avatar_url":"https://github.com/nalajala4naresh.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ch-vmm: Lightweight Virtualization Add-on for Kubernetes\n\n[![build](https://github.com/nalajala4naresh/ch-vmm/actions/workflows/build.yml/badge.svg)](https://github.com/nalajala4naresh/ch-vmm/actions/workflows/build.yml)\n[![Go Report Card](https://goreportcard.com/badge/github.com/nalajala4naresh/ch-vmm)](https://goreportcard.com/report/github.com/nalajala4naresh/ch-vmm)\n[![codecov](https://codecov.io/gh/nalajala4naresh/ch-vmm/branch/main/graph/badge.svg?token=6GXYM2BFLT)](https://codecov.io/gh/nalajala4naresh/ch-vmm)\n\nch-vmm is a [Kubernetes](https://github.com/kubernetes/kubernetes) add-on for running [Cloud Hypervisor](https://github.com/cloud-hypervisor/cloud-hypervisor) virtual machines. By using Cloud Hypervisor as the underlying hypervisor, ch-vmm enables a lightweight and secure way to run fully virtualized workloads in a canonical Kubernetes cluster.\n\nCompared to [KubeVirt](https://github.com/kubevirt/kubevirt), ch-vmm:\n\n- does not use libvirt or QEMU. By leveraging Cloud Hypervisor, VMs has lower memory (≈30MB) footprints, higher performance and smaller attack surface.\n- does not require a long-running per-Pod launcher process, which further reduces runtime memory overhead (≈80MB).\n\nCompared to [VirtInk](https://github.com/smartxworks/virtink), ch-vmm:\n- does support snapshot and restore features\n- Supports newer version k8s controller-runtime and k8s versions \u0026  cloud-hypervisor v52.0\n- `VMPool` and `VMSet` to manage fleet of VM's, checkout docs folder for examples. \n\nch-vmm consists of 3 components:\n\n- `ch-vmm-controller` is the cluster-wide controller, responsible for creating Pods to run Cloud Hypervisor VMs.\n- `ch-daemon` is the per-Node daemon, responsible for further controlling Cloud Hypervisor VMs on Node bases.\n- `virt-prerunner` is the per-Pod pre-runner, responsible for preparing VM networks and building Cloud Hypervisor VM configuration.\n\n**NOTE**: ch-vmm is still a work in progress, its API may change without prior notice.\n\n## Installation\n\n### Requirements\n\nA few requirements need to be met before you can begin:\n\n- Kubernetes Version v1.35+ (In-place vertical scaling of VM with release v1.2.0)\n- Kubernetes Version \u003c v1.35 , please use release v1.1.0\n- Kubernetes apiserver must have `--allow-privileged=true` in order to run ch-vmm's privileged DaemonSet. It's usually set by default.\n- [cert-manager](https://cert-manager.io/)  v1.16 installed in Kubernetes cluster. You can install it with `kubectl apply -f https://github.com/cert-manager/cert-manager/releases/download/v1.16.1/cert-manager.yaml`.\n- Deploy ch-vmm onto k8s cluster with ``` kubectl apply -f https://github.com/nalajala4naresh/ch-vmm/releases/latest/download/ch-vmm.yaml```\n- Deploy CDI operator to manage DataVolume objects as disks to the VM's \n\n  ```bash\n  $ export VERSION=$(curl -s https://api.github.com/repos/kubevirt/containerized-data-importer/releases/latest | grep '\"tag_name\":' | sed -E 's/.*\"([^\"]+)\".*/\\1/')\n  $ kubectl create -f https://github.com/kubevirt/containerized-data-importer/releases/download/$VERSION/cdi-operator.yaml\n  $ kubectl create -f https://github.com/kubevirt/containerized-data-importer/releases/download/$VERSION/cdi-cr.yaml\n  ```\n\n- Deploy external snapshotter for disk management features\n``` bash\n\n$ kubectl -n kube-system kustomize deploy/kubernetes/snapshot-controller | kubectl create -f -\n```\n#### Container Runtime Support\n\nch-vmm currently supports the following container runtimes:\n\n- Docker\n- containerd\n- cloud-hypervisor v52.0 is supported.\n\nOther container runtimes, which do not use virtualization features, should work too. However, they are not tested officially.\n\n#### Hardware Virtualization Support\n\nHardware with virtualization support is required. You should check if `/dev/kvm` exists on each Kubernetes nodes.\n\n#### Host Kernel Version\n\n- Minimum: v4.11 \n\n## Getting Started\n\n### Create a VM\n\nApply the following manifest to Kubernetes. Note it uses a [container rootfs](samples/Dockerfile.container-rootfs-ubuntu) and as such doesn’t persist data.\n\n```bash\ncat \u003c\u003cEOF | kubectl apply -f -\napiVersion: cloudhypervisor.quill.today/v1beta1\nkind: VirtualMachine\nmetadata:\n  name: ubuntu-container-rootfs\nspec:\n  instance:\n    memory:\n      size: 1Gi\n    kernel:\n      image: nalajalanaresh/ch-vmm-kernel:5.15\n      cmdline: \"console=ttyS0 root=/dev/vda rw\"\n    disks:\n      - name: ubuntu\n      - name: cloud-init\n    interfaces:\n      - name: pod\n  volumes:\n    - name: ubuntu\n      containerRootfs:\n        image: nalajalanaresh/virtmanager-container-rootfs-ubuntu\n        size: 4Gi\n    - name: cloud-init\n      cloudInit:\n        userData: |-\n          #cloud-config\n          password: password\n          chpasswd: { expire: False }\n          ssh_pwauth: True\n  networks:\n    - name: pod\n      pod: {}\nEOF\n```\n\n\nLike starting pods, it will take some time to pull the image and start running the VM. You can wait for the VM become running as follows:\n\n```bash\nkubectl wait vm ubuntu-container-rootfs --for jsonpath='{.status.phase}'=Running --timeout -1s\n```\n\n### Access the VM (via SSH)\n\nThe easiest way to access the VM is via a SSH client inside the cluster. You can access the VM created above as follows:\n\n```bash\nexport VM_NAME=ubuntu-container-rootfs\nexport VM_POD_NAME=$(kubectl get vm $VM_NAME -o jsonpath='{.status.vmPodName}')\nexport VM_IP=$(kubectl get pod $VM_POD_NAME -o jsonpath='{.status.podIP}')\nkubectl run ssh-$VM_NAME --rm --image=alpine --restart=Never -it -- /bin/sh -c \"apk add openssh-client \u0026\u0026 ssh ubuntu@$VM_IP\"\n```\n\nEnter `password` when you are prompted to enter password, which is set by the cloud-init data in the VM manifest.\n\n\n### Take Snapshot of the VM \nch-vmm supports taking snapshot of the VM's with VMSnapshot CRD, All the Datavolume or Persistent volume based disks use Default storage class VolumeSnapshot class. The memory snapshot is stored in Object storage on both S3 or GCP.\n```\napiVersion: cloudhypervisor.quill.today/v1beta1\nkind: VMSnapShot \nmetadata:\n  name: jammy-snapshot\n  namespace: default\nspec:\n  skipMemorySnapshot: false\n  vm: ubuntu-ch\n  bucket: gcs://ch-snapshots\n\n\n```\n\n### Restroing from VM Rollback\nch-vmm supports VM rollback from a VMSnapshot, this will create a new VM but and keep the Original VM untouched.\n\n```\n\napiVersion: cloudhypervisor.quill.today/v1beta1\nkind: VMRollback\nmetadata:\n  labels:\n    app.kubernetes.io/name: ch-vmm\n    app.kubernetes.io/managed-by: kustomize\n  name: jammy-ch-rollback3 \nspec:\n  snapshot: jammy-snapshot\n\n\n```\n### Manage the VM\n\nch-vmm supports various VM power actions. For example, you can power off the VM created above as follows:\n\n```bash\nexport VM_NAME=ubuntu-container-rootfs\nexport POWER_ACTION=PowerOff\nkubectl patch vm $VM_NAME --subresource=status --type=merge -p \"{\\\"status\\\":{\\\"powerAction\\\":\\\"$POWER_ACTION\\\"}}\"\n```\nYou can also `Shutdown`, `Reset`, `Reboot` or `Pause` a running VM, or `Resume` a paused one. To start a powered-off VM, you can `PowerOn` it.\n\n### VFIO GPU Passthrough\n\nch-vmm supports GPU passthrough to VMs using VFIO (Virtual Function I/O). This allows VMs to directly access physical GPU devices for high-performance workloads such as machine learning, graphics rendering, or GPU-accelerated computing.\n\n#### Prerequisites\n\n\n- GPU device plugin installed in the cluster (e.g., [NVIDIA Kubevirt Device Plugin](https://github.com/NVIDIA/kubevirt-gpu-device-plugin) or custom device plugin)\n- IOMMU enabled on the host system (add `intel_iommu=on` or `amd_iommu=on` to kernel boot parameters)\n- GPU devices must be bound to `vfio-pci` driver on the host nodes\n- The GPU must be exposed as a Kubernetes extended resource (e.g., `nvidia.com/GP104_GEFORCE_GTX_1080`)\n\n#### Creating a VM with GPU Passthrough\n\nTo create a VM with GPU passthrough, specify the GPU in the VM spec:\n\n```yaml\napiVersion: cloudhypervisor.quill.today/v1beta1\nkind: VirtualMachine\nmetadata:\n  name: ubuntu-ch\n  namespace: default\nspec:\n  instance:\n    kernel:\n      image: nalajalanaresh/ch-vmm-kernel:5.15\n      cmdline: \"console=ttyS0 root=/dev/vda1 rw ds=nocloud\"\n    memory:\n      size: 4Gi\n    gpus:\n      - name: geforce\n        resourceName: nvidia.com/GP104_GEFORCE_GTX_1080  # Change to your GPU resource name\n    disks:\n      - name: ubuntu\n    interfaces:\n      - name: pod\n  volumes:\n    - name: ubuntu\n      dataVolume:\n        volumeName: ubuntu-ch-jammy\n  networks:\n    - name: pod\n      pod: {}\n```\n\nThe `resourceName` should match the extended resource name exposed by your GPU device plugin. For NVIDIA GPUs, the webhook automatically sets the `resourceEnvName` if it's not specified. The GPU device will be passed through to the VM using VFIO, allowing the guest OS to directly access the physical GPU hardware.\n\n**Note**: Ensure that the GPU device plugin is properly configured and the GPU resources are available on the target node before creating the VM.\n\n### Relation to Virtink Project\n\nThis is a fork of Virtink Project with Custom changes to include additional features\n\nInstead of implementing the ch-vmm controllers from scratch, ch-vmm is importing and sharing code and architecture together with (VirtInk)[https://github.com/smartxworks/virtink/tree/main]\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnalajala4naresh%2Fch-vmm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnalajala4naresh%2Fch-vmm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnalajala4naresh%2Fch-vmm/lists"}