# Dafuq is a deterministic VM?

DevFeed: [Dafuq is a deterministic VM?](<https://devfeed.tech/articles/dafuq-is-a-deterministic-vm-99007.md>)

Original publisher: [Read original article](<https://fzakaria.com/2026/10/24/dafuq-is-a-deterministic-vm>)

Published: 2026-10-24T17:00:00Z

Content type: article

Language: en

Sources: [Farid Zakaria's Blog](<https://devfeed.tech/sources/farid-zakaria-s-blog.md>)

Topics: [virtual machines](<https://devfeed.tech/topics/virtual-machines.md>), [Kernel](<https://devfeed.tech/topics/kernel.md>), [scheduling](<https://devfeed.tech/topics/scheduling.md>)

Tags: [algorithm](<https://devfeed.tech/tags/algorithm.md>), [boot](<https://devfeed.tech/tags/boot.md>), [c](<https://devfeed.tech/tags/c.md>), [clock](<https://devfeed.tech/tags/clock.md>), [cpu](<https://devfeed.tech/tags/cpu.md>), [cpus](<https://devfeed.tech/tags/cpus.md>), [device](<https://devfeed.tech/tags/device.md>), [exit](<https://devfeed.tech/tags/exit.md>), [exits](<https://devfeed.tech/tags/exits.md>), [external](<https://devfeed.tech/tags/external.md>), [features](<https://devfeed.tech/tags/features.md>), [hardware](<https://devfeed.tech/tags/hardware.md>), [image](<https://devfeed.tech/tags/image.md>), [influence](<https://devfeed.tech/tags/influence.md>), [init](<https://devfeed.tech/tags/init.md>), [rewind](<https://devfeed.tech/tags/rewind.md>), [system](<https://devfeed.tech/tags/system.md>), [virtual](<https://devfeed.tech/tags/virtual.md>), [virtual-machine](<https://devfeed.tech/tags/virtual-machine.md>), [vm](<https://devfeed.tech/tags/vm.md>)

## AI overview

Rewind VM aims to make runs repeatable by controlling the guest's contact with the outside world. It runs a patched Linux guest under KVM and uses cooperative VM exits as numbered steps: the guest asks the monitor for time, timers, idle handling, or event reporting, and the monitor controls when interrupts arrive. Rewind hides hardware counters and random-number instructions, uses a seeded guest random generator, and schedules threads on one virtual CPU. Its input image is mapped into guest memory to avoid variable disk-read timing. The article's C example prints identical time, random value, and stack address across runs with the same seed; changing the seed changes the output. Because the monitor advances virtual time directly to a sleep deadline, a one-second sleep need not take one second of wall time. These guarantees rely on the guest being deterministic between steps and the described kernel and monitor controls.

## Source excerpt

The life of a system call inside Rewind VM. Since I started writing about Rewind VM, the question I get most from friends is not "does it work?" but "how does it actually work?" 🤔 D'uh! It is a virtual machine that only gets interrupted when it asks to be.