A while ago, I needed a local environment to test Harvester on my laptop. Harvester is an open-source hyperconverged infrastructure (HCI) solution built on Kubernetes and KubeVirt. It is intended to run on bare-metal servers. Even so, running it in a local virtual machine is convenient when you want to test workflows or experiment without dedicated lab hardware.

I wrote a personal guide with the exact steps to get it running inside a QEMU virtual machine.

My goal is to share a straightforward, tested setup so other engineers can run Harvester locally for development and testing.

A few quick disclaimers before starting:

  • This setup is strictly for local testing and development. Production concerns like storage redundancy, high availability, and hardened security are deliberately out of scope here.
  • I ran and tested these steps on openSUSE Tumbleweed x86_64. If you run another Linux distribution, the core QEMU parameters and logic remain the same. Package names, service names, and file paths (like OVMF firmware files) might differ slightly.
  • Some choices (like directory names or disk sizes) reflect my personal workflow. Adjust them to your own taste and available disk space.

Host requirements and network setup

Harvester runs a Kubernetes cluster that spins up virtual machines using KubeVirt. That means your host processor needs nested virtualization enabled so KVM can pass hardware virtualization extensions through to the guest VM.

First, install QEMU and the UEFI firmware packages. On openSUSE Tumbleweed:

sudo zypper in qemu qemu-kvm qemu-ovmf-x86_64 

Next, verify that nested virtualization is enabled in your host kernel.

For AMD CPUs:

cat /sys/module/kvm_amd/parameters/nested 

For Intel CPUs:

cat /sys/module/kvm_intel/parameters/nested 

If the command prints 1 or Y, nested virtualization is active. If it prints 0 or N, enable it for your current session:

For AMD CPUs:

sudo modprobe -r kvm_amd sudo modprobe kvm_amd nested=1 

For Intel CPUs:

sudo modprobe -r kvm_intel sudo modprobe kvm_intel nested=1 

If everything works well, consider adding this option to your modprobe configuration so you do not have to enable it manually after every reboot.

Bridged TAP networking vs user mode

QEMU supports several network modes. The simplest option is user mode networking (SLIRP). It requires no root privileges and maps ports from the host to the guest (for example, mapping port 8443 to Harvester's web UI).

However, SLIRP creates an isolated network behind NAT. That works for opening Harvester's web interface, but it fails once you create virtual machines inside Harvester. Those nested guest VMs get IP addresses from QEMU's internal DHCP server on that isolated network, making them unreachable from your laptop.

To avoid that limitation, we use a TAP interface connected to a virtual bridge on the host. The most reliable way on Linux is through libvirt's default bridge (virbr0). It handles DHCP, DNS, and outbound NAT to the internet.

Install libvirt:

sudo zypper install libvirt 

Enable socket activation for the network daemon:

sudo systemctl enable --now virtnetworkd.socket 

I prefer socket activation (virtnetworkd.socket) over enabling the service directly (virtnetworkd.service). With socket activation, the service stays idle until a client requests the network, saving resources when you are not running VMs.

Start the default network and set it to start automatically:

sudo virsh net-start default sudo virsh net-autostart default 

To let your regular user account create and attach TAP interfaces without running QEMU as root, configure the QEMU bridge helper:

sudo mkdir -p /etc/qemu echo "allow virbr0" | sudo tee -a /etc/qemu/bridge.conf sudo chmod 0644 /etc/qemu/bridge.conf sudo chmod u+s /usr/libexec/qemu-bridge-helper sudo usermod -aG kvm,libvirt $USER 

Note that adding your user to the kvm and libvirt groups requires logging out and logging back in for the changes to take effect.

Preparing VM files and UEFI firmware

Harvester requires UEFI boot. In QEMU, UEFI support comes from OVMF (Open Virtual Machine Firmware).

OVMF splits UEFI into two distinct files:

  • code.bin: The read-only firmware execution engine. It contains the UEFI code that initializes virtual hardware and presents the standard UEFI boot environment. Because this executable code never changes during operation, all QEMU VMs on your system can share this single read-only file.
  • vars.bin: The read-write NVRAM storage. This file simulates the CMOS memory on a physical motherboard. It stores non-volatile settings changed by the guest OS, including custom bootloader entries and boot order.

Each VM needs its own dedicated, writable copy of the vars.bin file. If multiple VMs wrote to the same file simultaneously, their boot settings would corrupt each other.

Start by creating directories for disk images and process PID files:

mkdir disks instances 

Copy the OVMF vars template for your VM:

cp /usr/share/qemu/ovmf-x86_64-4m-vars.bin cmos-nvram.bin 

Next, create a virtual disk image using the qcow2 format. This format grows dynamically as data is written, so allocating 250 GB will only take as much physical disk space as Harvester writes:

qemu-img create -f qcow2 disks/0000-harvester.qcow2 250G 

Finally, download the AMD64 ISO image of the Harvester version you want to install from the Harvester releases page. At the time of writing, I used v1.8.2.

The installation script

To keep the QEMU command reproducible and easy to manage, I put the launch command in a script named installation.sh:

#!/usr/bin/env bash set -eu -o pipefail declare -r TIMESTAMP=$(date +%s) # 1. Start the 'default' network if it is not already active if ! virsh -c qemu:///system net-list --name | grep -q "^default$"; then virsh -c qemu:///system net-start default fi # 2. Launch Harvester QEMU VM installation qemu-system-x86_64 \ -enable-kvm \ -cpu host \ -smp 8,sockets=1,cores=4,threads=2 \ -m 32G \ -drive if=pflash,format=raw,readonly=on,file=/usr/share/qemu/ovmf-x86_64-4m-code.bin \ -drive if=pflash,format=raw,file=./cmos-nvram.bin \ -drive file=disks/0000-harvester.qcow2,if=virtio,format=qcow2,id=disk-system \ -cdrom ./harvester-v1.8.2-amd64.iso \ -netdev bridge,id=tap-harv0,br=virbr0,helper=/usr/libexec/qemu-bridge-helper \ -device virtio-net-pci,netdev=tap-harv0,mac=52:54:00:12:34:56 \ -pidfile "./instances/${TIMESTAMP}.pid" \ -vga virtio \ -display default,show-cursor=on 

A few details about these flags:

  • CPU topology: On AMD processors, replace -cpu host with -cpu host,+topoext. The -smp flag sets two threads per core. While Intel calls this Hyper-Threading, AMD calls its equivalent technology Simultaneous Multi-Threading (SMT). QEMU disables SMT topology extensions by default unless you explicitly pass +topoext.
  • Memory and vCPUs: Harvester runs a full Kubernetes control plane, Longhorn storage, and KubeVirt. Allocating 8 vCPUs and 32 GB of RAM gives the installer enough headroom to complete without stalling.
  • Fixed MAC address: A fixed MAC address (52:54:00:12:34:56) makes sure libvirt's DHCP server gives the VM the same IP address on every boot. The prefix 52:54:00 is the standard OUI convention for QEMU and KVM locally administered addresses.

Make the script executable and run it:

chmod +x installation.sh ./installation.sh 

A display window will open showing the Harvester installer.

Harvester installation options

The first installer screen checks your system resources. It might warn you that your resources are suitable for testing rather than production. Accept the warning and continue.

Go through the installer prompts with these options:

  • Installation mode: Select Create a new Harvester cluster.
  • Default login password: Enter a simple password for the console and SSH (for example, admin).
  • Installation target and data disk:
    • Installation disk: Select vda 250G (the qcow2 disk attached to the VM).
    • Data disk: Select Use the installation disk (vda 250G).
    • Persistent size: Keep the default value (for example, 150Gi).
  • Network configuration:
    • Management NIC: Select ens3 (the MAC address matches what you set in -device virtio-net-pci).
    • VLAN ID: Leave blank.
    • Bond Mode: Keep the default (active-backup).
    • IPv4 Method: Keep Automatic (DHCP).
  • Cluster network: Leave the fields blank to use default settings.
  • Hostname: Set an instance hostname (for example, harvester0).
  • DNS servers: Leave blank to use DNS from DHCP.
  • Virtual IP (VIP):
    • VIP Mode: Keep Automatic (DHCP).
    • MAC Address and VIP: Leave blank. When you press Enter on the last field, the installer fills the defaults automatically.
  • Cluster token: Set a cluster join token (for example, join).
  • NTP servers: Accept the default value (typically 0.suse.pool.ntp.org).
  • Proxy, SSH, and remote config: Leave all three blank.
  • Confirm installation: Review the summary and choose yes to begin.

The installer will write Harvester to the virtual disk and reboot. Once it boots, you will see a status screen showing two boxes:

  • Harvester cluster
  • Node

Both display their status and IP address. Wait until both boxes show Ready.

Open your browser and navigate to https://<ip-shown-on-screen>. Your browser will warn you that the TLS certificate is self-signed; proceed past the warning. You should see the Harvester login screen.

Stop here for a moment. Before configuring anything in the web UI, shut down the VM cleanly and take a baseline snapshot. Having a clean checkpoint right after installation saves you from reinstalling from scratch if an experiment fails later.

Graceful shutdown

Avoid killing the QEMU window or pressing Ctrl+C in your terminal. Harvester relies on etcd to store cluster state. Cutting power abruptly can cause pending disk writes to be lost, leaving the cluster in a degraded or corrupted state.

You have two clean ways to shut down the VM:

  • From a shell inside Harvester (via SSH or the console), run poweroff.
  • Open the QEMU monitor by pressing Ctrl+Alt+2 in the VM display window, then type system_powerdown. You can switch back to the guest display with Ctrl+Alt+1 to watch the system shut down cleanly.

Operating the VM

Once the initial installation is complete, create a run.sh script to boot the VM for daily use.

This script is almost identical to installation.sh, but we remove the -cdrom flag and point the disk image to our working disk or snapshot:

#!/usr/bin/env bash set -eu -o pipefail declare -r TIMESTAMP=$(date +%s) # 1. Start the 'default' network if it is not already active if ! virsh -c qemu:///system net-list --name | grep -q "^default$"; then virsh -c qemu:///system net-start default fi # 2. Launch Harvester QEMU VM qemu-system-x86_64 \ -enable-kvm \ -cpu host \ -smp 8,sockets=1,cores=4,threads=2 \ -m 32G \ -drive if=pflash,format=raw,readonly=on,file=/usr/share/qemu/ovmf-x86_64-4m-code.bin \ -drive if=pflash,format=raw,file=./cmos-nvram.bin \ -drive file=disks/0001-harvester.qcow2,if=virtio,format=qcow2,id=disk-system \ -netdev bridge,id=tap-harv0,br=virbr0,helper=/usr/libexec/qemu-bridge-helper \ -device virtio-net-pci,netdev=tap-harv0,mac=52:54:00:12:34:56 \ -pidfile "./instances/${TIMESTAMP}.pid" \ -vga virtio \ -display default,show-cursor=on 

Make it executable:

chmod +x run.sh 

I keep installation.sh around rather than deleting it. Having the original installer script on hand makes it easy to recreate the environment from scratch whenever a new Harvester version comes out.

First boot and shell access

Start the VM with ./run.sh and wait until both the cluster and the node report Ready.

Open https://<ip> in your browser. Because this is the first boot, Harvester will ask you to set a permanent password for the admin account. For a local testing setup, pick something straightforward that meets the minimum length requirement of 12 characters (for example, local-harvester).

When you need shell access to the host node, you have two options:

  1. Via the QEMU display: Press F12 on the Harvester status screen. Log in with user root and the password you set during installation.
  2. Via SSH: Connect from your host terminal using ssh rancher@<ip> and enter the installer password. You can run root commands with sudo, or switch to root using sudo -i without needing an extra password.

Working with snapshots

QEMU's qcow2 format supports both internal and external snapshots.

Internal snapshots

Internal snapshots store checkpoints inside the existing qcow2 file. This is the simplest approach because your disk file name never changes and you do not need to update run.sh.

  • Create a snapshot:
 qemu-img snapshot -c baseline disks/0000-harvester.qcow2 
  • List existing snapshots:
 qemu-img snapshot -l disks/0000-harvester.qcow2 
  • Revert to a snapshot:
 qemu-img snapshot -a baseline disks/0000-harvester.qcow2 
  • Delete a snapshot:
 qemu-img snapshot -d baseline disks/0000-harvester.qcow2 

Always make sure the VM is completely powered off before reverting an internal snapshot. Running qemu-img snapshot -a while the VM is active will corrupt the filesystem.

External snapshots

External snapshots create a chain of linked files:

[0000-harvester.qcow2] <-- [0001-harvester.qcow2] (Base / Clean Install) (Active Snapshot - Writable) STATUS: Read-Only STATUS: Read-Write 

The original base image becomes read-only, and all new modifications are written to the active overlay file.

To create an external snapshot from your base disk:

qemu-img create -f qcow2 -b 0000-harvester.qcow2 -F qcow2 disks/0001-harvester.qcow2 

Notice that the -b flag takes just the base file name, while the target path is passed as the final argument. qemu-img expects the relative backing file to sit in the same directory. Once created, update run.sh to point -drive file=disks/0001-harvester.qcow2.

If you want to merge your changes back into the base file, run:

qemu-img commit disks/0001-harvester.qcow2 

This commits all changes into 0000-harvester.qcow2. Afterwards, you can remove the snapshot file and point run.sh back to the base image.

If you ever need an online snapshot while the VM is running, open the QEMU monitor (Ctrl+Alt+2) and run:

snapshot_blkdev disk-system disks/0001-harvester.qcow2 qcow2 

QEMU will freeze the base file in the background and immediately redirect all ongoing writes to the new file without interrupting the guest OS.

Accessing Kubernetes and kubeconfig

You can get the cluster's kubeconfig in two ways:

  • From the web UI: Open the Support page from the bottom-left corner of the Harvester interface and download the configuration file.
  • From the VM directly: Log in via SSH or the console. The cluster configuration is located at /etc/rancher/rke2/rke2.yaml.

There is a difference to keep in mind between these two files:

  • The internal /etc/rancher/rke2/rke2.yaml file authenticates directly against the raw kube-apiserver on port 6443. When you log into the VM shell as root, your KUBECONFIG environment variable is already set to this file, so kubectl works without extra flags.
  • However, the internal file does not have the tokens required to speak to Harvester's Steve API router on port 443. For automation or scripts interacting with Harvester custom resources from your laptop, download the kubeconfig from the web UI.

A local Harvester install generates its own internal certificate authority (CA). Because it does not use certificates from a public vendor, your local kubectl will reject the connection unless you configure it.

You can either pass --insecure-skip-tls-verify=true in your kubeconfig:

clusters: - cluster: insecure-skip-tls-verify: true server: https://192.168.122.X:6443 name: default 

Or copy the server CA certificate from /var/lib/rancher/rke2/server/tls/server-ca.crt on the VM to your host, and point your kubeconfig to it:

clusters: - cluster: certificate-authority: /path/to/server-ca.crt server: https://192.168.122.X:6443 name: default 

Adding a secondary cluster network

If your testing requires multiple cluster networks (like separating management and workload traffic), create them in the Harvester web UI under Networks -> Cluster Networks.

However, when you try to configure the new network, you will notice that the network interface controller (NIC) dropdown list is empty. That happens because Harvester hides the primary network interface (mgmt) from the selector.

To fix this, you need to add a second virtual network card to your QEMU VM. In your run.sh script, add a second netdev and PCI device:

 -netdev bridge,id=tap-net1,br=virbr0,helper=/usr/libexec/qemu-bridge-helper \ -device virtio-net-pci,netdev=tap-net1,mac=52:54:00:12:34:57 \ 

Make sure to assign a unique MAC address to prevent network collisions. When you boot the VM, Harvester will detect the second network interface, and it will show up in the web UI dropdown.

Troubleshooting a login 404 error

During my testing, I hit an annoying issue where submitting the correct username and password on the web UI login screen failed with an error.

The first couple of times it happened, I assumed something had corrupted during my testing, so I reverted the VM to my baseline snapshot. Reverting worked, but the third time it happened, I had uncommitted changes that I did not want to lose.

I opened the browser developer tools and checked the network tab. Submitting the login form produced a 404 Not Found response on this endpoint:

POST https://<ip>/v1/ext.cattle.io.selfuser 

I logged into the VM via SSH and checked for failing pods:

kubectl get pods -A --field-selector=status.phase!=Running 

A few pods showed up, but all of them were in Completed status. Everything looked healthy.

Next, I checked whether the API extension service was registered:

kubectl get apiservice v1.ext.cattle.io 

The service existed and reported available. Because the underlying services were running but the API router was returning 404, I decided to do a clean, graceful reboot of the VM:

sudo reboot 

After the node finished rebooting and both services returned to Ready, the web UI login worked as expected. If you hit this error after an initial boot or configuration change, try a clean reboot before assuming your cluster is broken.

Conclusion

Running Harvester in QEMU requires plenty of memory and CPU. Still, having a full HCI testing ground directly on your laptop is very practical. It lets you test cluster configurations, network setups, and virtual machine workloads locally without touching shared hardware or waiting for cloud instances.

As usual, there are trade-offs between local virtualization and physical hardware. You will not get bare-metal disk throughput or multi-node redundancy, but for day-to-day development and experimentation, this setup gets the job done cleanly.

I hope that you've got something from here. If you run into issues or have questions about the setup, drop me a comment.