<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/dafuq-is-a-deterministic-vm--tkkdq96gu" -->

---
title: Dafuq is a deterministic VM? | daily.dev
description: Rewind VM achieves determinism by only letting the guest stop at points it chooses to ask for help, called steps. It runs the guest under KVM and patches the...
canonical: https://daily.dev/posts/dafuq-is-a-deterministic-vm--tkkdq96gu
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Dafuq is a deterministic VM? | daily.dev
og:description: Rewind VM achieves determinism by only letting the guest stop at points it chooses to ask for help, called steps. It runs the guest under KVM and patches the...
og:url: https://daily.dev/posts/dafuq-is-a-deterministic-vm--tkkdq96gu
og:image: https://api.daily.dev/og/posts/tkkdq96Gu.png
og:image:alt: Dafuq is a deterministic VM?
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Dafuq is a deterministic VM?

**[Farid Zakaria’s Blog](https://daily.dev/sources/fzakaria)** · 7 min read · 0 upvotes · 0 comments

## Summary

Rewind VM achieves determinism by only letting the guest stop at points it chooses to ask for help, called steps. It runs the guest under KVM and patches the Linux kernel so time, randomness, and idle loops come from the monitor instead of hardware. A sample run shows the same 432 steps and identical output, down to the nanosecond, across repeated executions with the same seed. A `sleep(1)` call costs no real time because the monitor just jumps its clock to the deadline, so a run that virtually takes 1.002 seconds can finish in well under a second of wall time.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://fzakaria.com/2026/10/24/dafuq-is-a-deterministic-vm>

## Questions this post answers

### How does Rewind VM make a virtual machine execution deterministic and replayable?

It runs the guest under KVM and only lets the guest stop at moments it chooses, called VM exits or steps, numbered from boot. A patched Linux guest kernel takes its clock, timer, and idle loop from the monitor instead of hardware, and the monitor hides the hardware cycle counter and random number instruction so every external input is controlled and replayable from a seed.

_Developers chasing flaky builds or hard-to-reproduce bugs can track deterministic VM techniques like this on daily.dev._

### Why does a sleep(1) call in a VM not take real wall clock time in Rewind VM?

Because the guest kernel reports when it is idle, letting the monitor jump its virtual clock straight to the next timer deadline and deliver the interrupt immediately, instead of waiting in real time. In one example run, a program that virtually ran for 1.002 seconds, including a 1 second sleep, finished in 0.394 seconds of wall clock time.

_Anyone optimizing test or CI runtimes can follow techniques like virtual time jumps on daily.dev._

### What outside-world inputs cause CPU execution to be non-deterministic, and how can they be eliminated?

Non-determinism comes from interactions with the outside world: timer interrupts landing at unpredictable instructions, disk reads completing at random times, other CPU cores racing via cache misses and pipeline stalls, and hardware random number generation. Removing these sources, replacing each with a value derived from a stored seed and a single virtual CPU, makes CPU execution fully deterministic and replayable.

_Engineers debugging multi-threaded race conditions can dig into determinism techniques like these on daily.dev._

## Similar posts on daily.dev

- [Rewind VM: a flaky build you only catch once](https://daily.dev/posts/rewind-vm-a-flaky-build-you-only-catch-once-a2u3ugkt4) · Farid Zakaria’s Blog · 0 upvotes · 0 comments
- [Always, sometimes, never](https://daily.dev/posts/always-sometimes-never-hgay17tof) · Farid Zakaria’s Blog · 4 upvotes · 0 comments
- [Orphaned VMs: Running VMs Uninterrupted While Host Kernel Is Offline For Reboots/Updates](https://daily.dev/posts/orphaned-vms-running-vms-uninterrupted-while-host-kernel-is-offline-for-reboots-updates-ke0j5nf5f) · Phoronix · 0 upvotes · 0 comments
- [GitHub - adammiribyan/zeroboot: Sub-millisecond VM sandboxes for AI agents via copy-on-write forking](https://daily.dev/posts/github---adammiribyan-zeroboot-sub-millisecond-vm-sandboxes-for-ai-agents-via-copy-on-write-forking-0kztys81s) · Hacker News · 1 upvotes · 0 comments
- [Nix wrote half of my debugger](https://daily.dev/posts/nix-wrote-half-of-my-debugger-gnc47givc) · Farid Zakaria’s Blog · 0 upvotes · 0 comments

---

Tags: [#linux](https://daily.dev/tags/linux), [#infrastructure](https://daily.dev/tags/infrastructure)

[View this post on daily.dev](https://daily.dev/posts/dafuq-is-a-deterministic-vm--tkkdq96gu)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Dafuq is a deterministic VM?","url":"https://daily.dev/posts/dafuq-is-a-deterministic-vm--tkkdq96gu","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/dafuq-is-a-deterministic-vm--tkkdq96gu"},"datePublished":"2026-10-25T04:52:21.140Z","dateModified":"2026-10-25T04:52:51.832Z","description":"Rewind VM achieves determinism by only letting the guest stop at points it chooses to ask for help, called steps. It runs the guest under KVM and patches the...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/8fbcf2f7ce367fd6a59bae57633378e9?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/8fbcf2f7ce367fd6a59bae57633378e9?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Farid Zakaria’s Blog","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Farid Zakaria’s Blog","logo":"https://media.daily.dev/image/upload/s--YqqvRt90--/f_auto/v1723789280/logos/fzakaria","url":"https://daily.dev/sources/fzakaria"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/dafuq-is-a-deterministic-vm--tkkdq96gu","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"linux,infrastructure","timeRequired":"PT7M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Farid Zakaria’s Blog","item":"https://daily.dev/sources/fzakaria"},{"@type":"ListItem","position":3,"name":"Dafuq is a deterministic VM?"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/dafuq-is-a-deterministic-vm--tkkdq96gu#faq","mainEntity":[{"@type":"Question","name":"How does Rewind VM make a virtual machine execution deterministic and replayable?","acceptedAnswer":{"@type":"Answer","text":"It runs the guest under KVM and only lets the guest stop at moments it chooses, called VM exits or steps, numbered from boot. A patched Linux guest kernel takes its clock, timer, and idle loop from the monitor instead of hardware, and the monitor hides the hardware cycle counter and random number instruction so every external input is controlled and replayable from a seed. Developers chasing flaky builds or hard-to-reproduce bugs can track deterministic VM techniques like this on daily.dev."}},{"@type":"Question","name":"Why does a sleep(1) call in a VM not take real wall clock time in Rewind VM?","acceptedAnswer":{"@type":"Answer","text":"Because the guest kernel reports when it is idle, letting the monitor jump its virtual clock straight to the next timer deadline and deliver the interrupt immediately, instead of waiting in real time. In one example run, a program that virtually ran for 1.002 seconds, including a 1 second sleep, finished in 0.394 seconds of wall clock time. Anyone optimizing test or CI runtimes can follow techniques like virtual time jumps on daily.dev."}},{"@type":"Question","name":"What outside-world inputs cause CPU execution to be non-deterministic, and how can they be eliminated?","acceptedAnswer":{"@type":"Answer","text":"Non-determinism comes from interactions with the outside world: timer interrupts landing at unpredictable instructions, disk reads completing at random times, other CPU cores racing via cache misses and pipeline stalls, and hardware random number generation. Removing these sources, replacing each with a value derived from a stored seed and a single virtual CPU, makes CPU execution fully deterministic and replayable. Engineers debugging multi-threaded race conditions can dig into determinism techniques like these on daily.dev."}}]}
```

