Unikernels

I proposed the concept of "unikernels" -- single-purpose appliances that are compile-time specialised into standalone bootable kernels, and sealed against modification when deployed to a cloud platform. In return they offer significant reduction in image sizes, improved efficiency and security, and reduce operational costs. I also co-founded the MirageOS project which is one of the first complete unikernel frameworks, and also integrated them to create the Docker for Desktop apps that are used by hundreds of millions of users daily.

While working on Personal Containers in late 2008, I had a need to run lots of distributed edge nodes holding personal data. The state of computer security is generally a disaster when it comes to leaving software unupgraded for even a few months, so building robust infrastructure that normal people could use was proving quite difficult. Meanwhile, my PhD research in building Functional Internet Services had constructed really viable prototypes of network protocols written in pure OCaml, and I'd previously used OCaml industrially in the Xen Hypervisor hypervisor to write lots of system management code.

1 The Early Days

All of these ideas came crashing together in late 2009 and I decided to have a go at putting together a complete OCaml-based operating system. The adventure began with grabbing the Xen mini-os and the C lwIP stack to provide networking and sqlite for persistent storage, and hacking for a few months until everything booted and was reasonably stable. I then convinced Thomas Gazagnaire (then at Inria) to help me with storage integration with OCaml in Statically-typed value persistence for ML and we had a remarkably good prototype that we presented in Turning Down the LAMP: Software Specialisation for the Cloud.

I wrote up my early thoughts on Multiscale not multicore: efficient heterogeneous cloud computing to describe this emerging idea of heterogenous cloud and edge computing combined into a single programming model. After realising that the prototype worked well, I started steadily removing C bindings (like lwIP) and replacing them with pure OCaml code all the way down to the VM Xen interface (e.g. like mirage-tcpip). These early heady days saw lots of prototypes and experimentation:

2 Building MirageOS and figuring out unikernels

One of the earliest decisions I made in MirageOS was to self-host as soon as possible. I registered openmirage.org in late 2009, and (joined by @mort and @djs55) we had a Xen-based website running in short order in 2010 (now mirage-www). A big boost to the project was winning a grant from the Verisign Infrastructure Awards, which was the first external validation that this thing might be of interest to other people. As my OCaml Labs group grew in the University, more intrepid hackers joined the group and started making MirageOS work properly.

A year of intense work in 2012 turned the prototype into a fully-fleshed out paper which got soundly rejected by the OSDI review committee as we hadn't identified what the core systems research contribution was (as opposed to the impressive programming work, which they acknowledged in the rejection). I'd just gone to visit Timothy Roscoe's group in ETH where they had been working on the Barrelfish multikernel OS, and the answer came right to me while in the pub with Jon Crowcroft. What MirageOS represented was a revival of the concept of library operating systems, but with the additional twist that it specialised the compilation into single-user mode. Thus, I settled on the term "unikernels" to describe this idea and rewrote the paper and duly published it in Unikernels: library operating systems for the cloud.

Publishing a major research paper in ASPLOS led to further momentum and interest:

MirageOS also gave us ideas for other top systems research, such as the filesystem verification idas in SibylFS: formal specification and oracle-based testing for POSIX and real-world file systems (which I still intend to use for a proper POSIX compatibility layer on top of Irmin at some point), and FLICK: Developing and Running Application-Specific Network Services (to build domain-specific data processing platforms, something that I'm now working on in 2021 in Trusted Carbon Credits).

3 To Unikernel Systems and Docker

By this point, MirageOS was also a thriving open source community with regular IRC meetings and the beginning of hack retreats. There were several organisations using it, and the overall OCaml community started using some of our protocol implementations independently of the unikernel ideas. For example, the cohttp was something I rapidly hacked together for the ASPLOS deadline, but the Unix/Lwt/Async backends are now used in quite a few major systems (including within Jane Street, no less).

We had to deal with all this growth, as a university isn't the easiest place to have a very large group. In 2015, Balraj Singh (who had made huge contributions to the Mirage TCP/IP stack) Thomas Gazagnaire and myself founded Unikernel Systems along with Jeremy Yallop, Thomas Leonard, Magnus Skjegstad, Mindy Preston, Justin Cormack, David Sheets, Amir Chaudhry, and Dave Scott. After a fun few months pitching to west coast VCs in California (including fun chats with the likes of Jerry Yang), Peter Fenton from Benchmark convinced us to meet Solomon Hykes over at Docker. This conversation changed the course of our careers, as he shared his vision for the future of containerisation and how unikernels could fit in there.

A short set of negotiations later, and Unikernel Systems was acquired by Docker in 2016. We spent a very fun couple of years commercialising the technology and incorporating it into Docker for Desktop. Our work ended up shipping as Docker for Desktop which remains one of the most popular developer tools in the world, and I describe its architecture in this talk.

4 Unikernels in 2021 and beyond

Our startup aside, the core development of MirageOS continued to be nicely distributed in several spinouts:

The wider industry also saw a number of interesting spinouts, as many other communities also latched on to the ideas of unikernels and began their own language-specific and domain-specific versions. I joined the advisory boards of IncludeOS (now sadly defunct) and Zededa (now thankfully going from strength to strength in edge computing) to help guide strategy and adoption outside of just MirageOS. Dr Pierre Oliver maintains a great list of unikernel papers where you can see the diversity and interest in unikernels. One of the most exciting implementations of a C-based unikernel can be found in Unikraft.

As for my interest in unikernels moving forward? My heart always remains in finding the intersection of safety and performance, which means I mostly pay attention to language-based approaches. MirageOS continues to thrive (particularly with the effect system being integrated into OCaml in 2022, which will really change the way we develop OCaml code for embedded systems). Since 2020, I've been investigating the application of DIFC to embedded infrastructure, for example via Snape: The Dark Art of Handling Heterogeneous Enclaves.

The unikernel approach has also found new applications in ultra-low-power computing and edge AI deployment, where the security and efficiency benefits align well with the constraints of energy-harvesting and intermittent operation scenarios explored in our Interspatial OS work.

In 2025, we were also honoured to receive a most influential paper award from ASPLOS for the original paper, validating the long-term impact of the unikernel approach on systems research.

Activity

Building httpz, a high-performance HTTP/1.1 parser with zero heap allocation using OxCaml's unboxed types, local allocations, and mutable local variables.
Josh Millar, Yushan Huang et al. — Proceedings of the 31st Annual International Conference on Mobile Computing and Networking
Anil Madhavapeddy, David J. Scott et al. — Proceedings of ACM Programming Languages
Paper exploring biological ecosystem models as inspiration for Internet architecture evolution towards trillion-node scale at Aarhus 2025.
Josh Millar, Hamed Haddadi et al.
Survey of WebAssembly implementations on non-traditional targets including native Linux port, kernel-mode runtime, POSIX browser support and FPGA ports.
2013 MirageOS unikernels paper wins ASPLOS influential paper award with reflections on the journey from rejection to recognition.
AboutFeb 2025
Professor Anil Madhavapeddy's research combines computer science and conservation at the University of Cambridge
Learn about my sixth generation oxidised website built with a bleeding-edge OCaml variant.
Part 1 of my distinguished lecture series at St Andrews.
Part 2 of my distinguished lecture series at St Andrews.
Part 3 of my distinguished lecture series at St Andrews.
Zahra Tarkhani, Anil Madhavapeddy et al. — Proceedings of the 2nd International Workshop on Edge Systems, Analytics and Networking
At DockerCon, speaking to the audience about the integration of unikernels with library hypervisor in order to deliver Docker for Desktop
In this episode of The New Stack Makers, I speak to Alex Williams abot unikernels and Docker.
Abdul Alim, Richard G. Clegg et al. — 2016 USENIX Annual Technical Conference
Announcing the acquisition of Unikernel Systems by Docker to the world.
Docker acquires Unikernel Systems to bring unikernel tech to developers and IT pros.
Tom Ridge, David Sheets et al. — Proceedings of the 25th ACM Symposium on Operating Systems Principles (SOSP)
Invited talk at NetPL 2015 on immutable infrastructure
David Kaloper-Mersinjak, Hannes Mehnert et al. — 24th USENIX Security Symposium (USENIX Security 15)
At Esper's OCaml Meetup in California speaking about MirageOS and unikernels to a packed room.
Anil Madhavapeddy, Thomas Leonard et al. — 12th USENIX Symposium on Networked Systems Design and Implementation (NSDI 15)
Magnus Skjegstad, Anil Madhavapeddy et al. — Proceedings of the 2015 Workshop on Do-it-yourself Networking: an Interdisciplinary Approach
Opening speaker at BOB 2015 on functional operating systems
Benjamin Farinier, Thomas Gazagnaire et al. — Vingt-sixiemes Journees Francophones des Langages Applicatifs (JFLA 2015)
Talking in London at New Directions in Operating Systems
At the Xen Summit explaining how Irmin+MirageOS can build stub domains for Xen hosts
Me slightly nervously talking to a bunch of Haskellers about OCaml modules.
Thomas Gazagnaire, Amir Chaudhry et al. — the 4th ACM OCaml Users and Developers Workshop
Randal Schwartz and Simon Phipps interview Anil Madhavapeddy about MirageOS on the FLOSS Weekly podcast (Episode 302)
I talk to Robert Blumen about OCaml and MirageOS on the Software Engineering Radio podcast
Announcing the MirageOS 1.0 release at the Xen Summit 2013
Anil Madhavapeddy, Dave Scott — ACM Queue
George Parisis, Toby Moncaster et al. — Proceedings of the Twelfth ACM Workshop on Hot Topics in Networks
The MirageOS Developer Preview 1 screencast, showing how to initialise and build Unix and Xen kernels.
Anil Madhavapeddy, Richard Mortier et al. — Proceedings of the 18th international conference on architectural support for programming languages and operating systems (ASPLOS)
Dave Scott, Richard Sharp et al. — the 1st ACM OCaml Users and Developers Workshop
Charalampos Rotsos, Richard Mortier et al. — 2012 IEEE International Conference on Communications (ICC)
Steven Smith, Anil Madhavapeddy et al. — RESoLVE workshop at ASPLOS
OCaml LabsJan 2012
The OCaml Meeting 2011 talk on MirageOS in France, with full notes in
DataCaml brings distributed dataflow programming to OCaml using the CIEL engine.
Anil Madhavapeddy, Satnam Singh — 2011 IEEE 19th Annual International Symposium on Field-Programmable Custom Computing Machines
Thomas Gazagnaire, Anil Madhavapeddy — Workshop on Generative Technologies
Derek G Murray, Malte Schwarzkopf et al. — 8th USENIX Symposium on Networked Systems Design and Implementation (NSDI 11)
Jon Crowcroft, Anil Madhavapeddy et al. — Proceedings of the 12th International Conference on Distributed Computing and Networking
An early tech talk at LinkedIn on MirageOS
The first outing for MirageOS at USENIX HotCloud 2010
Anil Madhavapeddy, Richard Mortier et al. — 2nd USENIX Workshop on Hot Topics in Cloud Computing (HotCloud 10)
Anil Madhavapeddy, Richard Mortier et al. — Proceedings of the 2010 ACM-BCS Visions of Computer Science Conference
Richard Mortier, Anil Madhavapeddy et al. — Security Protocols XVIII