Tools
Tools: KVM Acceleration in a Rootless Podman Container: Before and After (2026)
KVM Acceleration in a Rootless Podman Container: Before and After
Why This Matters
Prerequisites
Step 1: Get the Alpine ISO
Step 2: Boot WITHOUT KVM (baseline)
Step 3: Verify KVM is Available on Your Host
Step 4: Boot WITH KVM
Step 5: What the Flags Do
What You've Built
What's Next? Quick one-liner: Pass /dev/kvm into your Podman container, boot Alpine Linux with -nographic, and time the difference between software emulation and hardware acceleration. In Post #1, we built a custom qemu:base container image with QEMU fully installed. I mentioned that if you tried to boot a VM without KVM it would be crawling slow. Let's test that theory. Without KVM, QEMU runs in pure software emulation mode. Every single CPU instruction your VM executes gets translated and re-executed by QEMU on the host. Your modern multi-GHz processor spends most of its time pretending to be a slower, imaginary processor. An OS that boots in 10 seconds on bare metal can take 5–10 minutes in software emulation. KVM changes everything. KVM (Kernel-based Virtual Machine) is a Linux kernel module that exposes your CPU's hardware virtualization extensions — Intel VT-x or AMD-V — to user-space software like QEMU. Instead of translating instructions, QEMU hands them directly to the CPU. The VM runs at near-native speed. This post makes that difference measurable. You'll boot Alpine Linux twice — once without KVM, once with — and time both. The gap is dramatic. Alpine Linux is the perfect test ISO: it's tiny, boots fast, and drops you to a login prompt with minimal fanfare. That makes boot time easy to measure. Download the standard x86_64 ISO: The download is ~347 MB. Once it's on disk, you'll mount ~/Downloads into the container as /vms. Let's establish the baseline. This is pure software emulation — no KVM, no hardware acceleration. Watch the output. QEMU will print boot messages, then Alpine's init system will work through its startup sequence. You'll eventually see: When you see the login prompt, press Ctrl+A then X to exit QEMU. The time command will print how long it took. On my machine this came in at ~22 seconds. Alpine is small enough that even software emulation is bearable. Write your number down — the comparison with KVM is still telling. Before adding --device /dev/kvm, check that KVM is actually available: You should see something like: If /dev/kvm doesn't exist, either: Also check that your user can access the device: Rootless Podman passes device permissions through automatically, but your user needs read-write access to /dev/kvm on the host. If you're in the kvm group, you're set: If not: sudo usermod -aG kvm $USER, then log out and back in. Same command, two additions: --device /dev/kvm for Podman, and -enable-kvm -cpu host for QEMU. The difference is immediate. Boot messages scroll by quickly. Alpine's init sequence runs in seconds. Press Ctrl+A then X to exit and check the time output. On my machine: 3x faster — and that's on a lightweight OS that was already tolerable in software emulation. On a heavier OS the gap is far wider. Why -cpu host and not -cpu qemu64? The default QEMU CPU model (qemu64) is a minimal baseline that works everywhere but exposes no modern CPU extensions. With -cpu host, QEMU passes through all of your CPU's features — AVX, AES-NI, etc. — which is both faster and more realistic for testing. Why does rootless Podman allow /dev/kvm? Podman uses the --device flag to grant access to specific devices without requiring --privileged. The container gets read-write access to /dev/kvm only, nothing else. This is much safer than running the whole container as root. Right now, every time you stop the container, the VM state disappears. Alpine loses any changes you made. The ISO is read-only. The VM has no persistent disk. Post #3: We'll create a persistent disk image with qemu-img, attach it to the VM, and install Alpine properly — so the VM survives container restarts. This guide is Part 2 of the KVM Virtual Machines on Podman series. Part 1: Build a KVM-Ready Container Image from Scratch
Coming up in Part 3: Persistent Disk Images — Keep Your VM Between Runs Published: 30 Mar 2026Author: David TioTags: KVM, QEMU, Podman, Virtualization, Containers, Alpine Linux, Linux, TutorialSeries: KVM Virtual Machines on Podman
Word Count: ~900 Templates let you quickly answer FAQs or store snippets for re-use. Hide child comments as well For further actions, you may consider blocking this person and/or reporting abuse