Thomas Gazagnaire

Thomas Gazagnaire

Building Functional Systems from Cloud to Orbit. thomas@gazagnaire.org

Unikernels in 2026: a conversation with Justin Cormack

2026-12-02

Justin Cormack invited me for his series Unikernels in 2026, after Geoffrey Huntley and Felipe Huici of Unikraft. I met Justin when we were building Unikernel Systems. After Docker acquired us we built Docker Desktop together, and he later became Docker's CTO. We had not caught up for a while and could have talked much longer :-) The full transcript is on his newsletter; here are the bits I wanted to write down properly.

Git, container images and satellite updates are the same thing

The idea for Irmin came from XenStore, the small control database every Xen domain uses. At Citrix, Vincent Hanquez and I rewrote the XenStore daemon in OCaml as OXenstored, and scaling it to hundreds of VMs meant an immutable state, where every transaction commits on its own branch and then merges, as in Git. Irmin keeps two kinds of storage. One is a key-value store where the keys are the hashes of the values: if two people write the same value it gets the same key, which removes the concurrency problem and scales well. The other maps names (main, someone's branch) to a hash. There the transaction is harder, but localised: a large update in the store, then one swap of the pointer.

let store : (string, string) Hashtbl.t = Hashtbl.create 16

let put v =
  let k = Digest.BLAKE256.(to_hex (string v)) in
  Hashtbl.replace store k v;
  k

let head = Atomic.make (put "image v1")

let update ~check v =
  let current = Atomic.get head in
  let next = put v in
  check ~current ~next && Atomic.compare_and_set head current next

Everyone implements this, at every level. Git does it, the OCI image format does it, secure update systems like TUF or the IETF SUIT architecture do it. Even blockchains do it, with complex synchronisation behaviour to let untrusted actors decide what the next head of the ledger is, which explains why Tezos decided to use Irmin to store its ledger.

First you negotiate. Which hashes do I have, and which ones does the remote have? How do I send the diff efficiently? Then comes the check, which decides whether next may replace current. Is it signed by the right key? Does it descend from current, as in Git, or carry a higher version number, as in TUF and SUIT, so that nobody can roll the device back to an old, vulnerable version? Then the head moves, ideally with one compare-and-swap that fails if someone else moved it in the meantime. Justin added that OCI and Git look the same if you squint, and that immutability is what made containers different from VM images.

Two versions of an image in an immutable store. Each points to a root directory, then to directories and files, all stored under their hashes. Version 2 changes one file, so it adds a new file, bin directory and root, and shares the etc directory with version 1. Two mutable cells, a 1.0 tag and the head, point to version 1, and a dashed arrow moves the head to version 2 after a check and a compare-and-swap.
Changing one file writes the dashed objects and shares the rest; then the head moves, while the tag stays on v1. This is the Git and Irmin layout; an OCI image points to a list of layers instead. Secure boot techniques such as dm-verity use a similar scheme to check the filesystem, with the root hash trusted at startup and each block checked as it is read.

Running containers in space

A satellite has a flight computer, carefully written, that you do not want to change often. Then there is the payload computer, where people put the mission: a Raspberry Pi CM5 on cheap missions, something like an NVIDIA Jetson on expensive ones. Operators that host scientific or commercial missions are realising that this computer is used for a few months and then sits idle when the mission finishes. They are also starting to realise that they could get a higher density by running several applications on it, perhaps for several users, and reuse existing satellites instead of sending new ones all the time. That raises two questions: how do you do secure updates, and can you trust sharing it with other tenants? The cloud and containers have been answering both for twenty years. The difference in space is that the check has to work offline, since a satellite can be out of contact for hours and cannot phone home to ask whether a signature is still good. It also has to be ridiculously secure, because you cannot easily reboot a satellite or SSH in to patch its software.

At Parsimoni we are building a secure runtime for that, as part of SpaceOS (a first version went to orbit in 2025). We try to keep it as compatible as possible with Docker, and it also runs Unikraft and MirageOS applications. The runtime itself reuses unikernel technology (a small PID 1, a small firewall, a small storage system); for now it runs on a minimal Linux, like everyone else, with a user space written only in OCaml. Updates follow the same idea as Git and OCI above, with a signature as part of the check.

Proofs are easier now, the oracle is the hard part

I did my PhD in formal methods and was a little depressed at the end: a few papers that nobody really read, on generic results. What has changed is that the models now write proofs well, and you can write a proof just for your system. You do not need to read the proof; you trust the kernel of the prover. But you need an oracle, something outside the model's control, to test against (I wrote more about this after the first Thought Experiment evening in Paris), and the proof is only as good as the specification. People who have done verified cryptography for years told me that even this year they fixed many issues in their proofs thanks to LLMs. Sometimes the specification itself is wrong, and the bindings you write to use the proof in a real system are usually buggy.

The MirageOS TLS stack, written by Hannes Mehnert and David Kaloper-Meršinjak, was built as a pure state machine: a state and a message in, a new state and messages out. You can replay it, write tests for it, and use it as an oracle against other implementations. I have been doing the same kind of differential testing for the space protocol stack, and for Tailwind, where the oracle is headless Chrome comparing pixels. It is easy when there is an existing implementation to compare against, and easier still when the system is deterministic, as Justin pointed out. I also ask the models to write Lean models of my code and compare them with the OCaml version. When they differ, the bug can be in either, but I know where to look.

AI and software engineering

It is an understatement to say that AI is changing a lot of things in our industry right now. It puts real pressure on open-source maintainers in every community, who now receive far more generated patches and bug reports than they can review. Many people also ask why we are building all these data centres to write more crappy code, and I share that feeling. But I also find it an incredible tool to write better quality code. It has so much impact on my companies that I need to understand it, and not using it would be a fault. I use it a lot, to experiment and to build proofs of complicated things, and it has helped me find bugs in libraries I maintain. The question becomes a different one: writing a new library is now easy, but what does it mean for it to be correct? What is the spec? I think the industry is changing in an interesting way, where we may need to think more about what we are building instead of just building.

What I have not found yet is how to use it to improve collaboration instead of creating more silos. I do not know how to solve that, and Justin does not think anyone has. His answer was to look at the ecosystems that worked, like OCaml or the cloud native stack, where many people share a model of what they are building. I still wonder whether the friction of collaboration, people arguing about things, is also what made the software good, although, as Justin said, slowly emailing patches around also let through a lot of security issues.

I really enjoyed speaking with Justin, and you should subscribe to his newsletter.

References

Related posts

Related code