Skip to content
PodSubs
ShowsPeopleGuestsJobsNewsEvents
More
BlogPodCred
Menu
ShowsPeopleGuestsJobsNewsEventsBlogPodCredNetworksSign in
Join nowSign in
  • Shows
  • People
  • Jobs
  • News
  • More
    • Guests
    • Events
    • Blog
    • PodCred
    • Networks
    Join nowSign in

Software Freedom Podcast

Software Freedom Podcast artwork

SFP#25: MirageOS and OCaml with Hannes Mehnert and Matthias Kirschner

Jul 3, 202438 minAudio
ShareXLinkedInFacebookWhatsAppEmail

For our 25th episode of the Software Freedom Podcast we are happy to welcome Hannes Mehnert, one of the MirageOS core developer. Matthias Kirschner, president of the FSFE, and Hannes talk about MirageOS. This episode gives an overview of everything from the basics to the future of MirageOS. Join the FSFE community and support the podcast: https://my.fsfe.org/support?referrer=podcast

Audio and video play straight from the show's own hosting. PodSubs stores and serves no media.

Transcript

From the show. Tap a time to play from there.

Before we start with the podcast, we would like to say thank you to all of you who support the FSFE's work of money. Working for software freedom and producing podcasts costs money. Please consider supporting us with our nation and the FSFE.org/donate and in the show notes.

Welcome to the software freedom podcast. This podcast is presented to you by the Free Software Foundation Europe, where a charity that empowers users to control technology. I'm Matthias Kirschner and our guest today is Hannes Mehnert. Hannes is a free software hacker working on various projects including Mirage OS, a Unicle Operating System and the co-author of the book on functional programming in JavaScript.

Besides being a hacker, he's the co-author of another book on Injit Kucin and enjoys being a Verista and likes to travel and repair his recumbent bicycle. Hello Hannes. Hello Matthias. So you once wrote in your biography that you feel safe in a garbage collected environment. That directly reminded me of Ada from the book Ada and Sangaman who also lives in a junkyard and I can somehow think about what you might have met by that but I would like

to ask you, where does that come from? Well, so I do programming since several years and it turns out that programming isn't really hard. I have to keep so many things around in my brain that I really feel much safer if I don't have to think about memory management. If just there's a algorithm that takes care of it and I know that in history there have been garbage collectors that were really poor in performance but nowadays it's really

not an issue anymore. I can afford to pay the performance penalty of a garbage collector and just use it and be much faster and programming and much and do fewer mistakes, well, programming. So you didn't mean actually like a physical environment of where you are in which with garbage around you but a digital one. Yes. Okay. So let's get back then to how did you actually get involved in all of this and programming

free software? In free software, well, I think I started with computers were attracted or I was attracted to computers and then I joined the case computer club and there I did a lot of not programming but really, yeah, exploitation of computer programs and I looked from the side of the security so how can you take it computer and how can you get over the security means of

the computer and so that's why where I get fascinated by how do you actually develop software that is not that easy to exploit that is much nicer to do there. Then yeah, out of political reasons and so on, I was from the very beginning, very convinced that free software is what I want to do because my lifetime is also limited and I want to contribute something to society and I strongly believe that when I write code, I have so much fun

that I really want others to be able to use and modify it and that's the reason why I do mostly Open Source of, I mean 99% of my time is spending on his spend on Open Source of it. And a large part of that is going into Mirage OS, right? Yes, into Mirage OS and the greater ecosystem of OCaml. Okay, I think we have to go back to OCaml as well later.

Yeah, yeah. But first, I mean, a lot of our listeners will think, well, I mean, there's the Linux kernel and with GNU/Linux, you have an operating system there, there is several BSDs. So why did you start a new operating system? So first of all, I didn't start it, but I only joined the project back then and nowadays I'm doing a lot of work in that, I think I'm one of the main authors nowadays. And why did we start it?

Well, I think that in both Linux and BSDs and also other operating systems, you see that there's a lot of legacy from the 70s around. I mean, as in recent years, you have heard about floppy disk drivers that were broken and let to exploit in QMO, you have seen that there are so many layers on top of layers that you have millions of lines of code in the Linux kernel, also in the BSDs. Nobody is there to say, oh, we don't need that anymore, who needs a SCSI drivers anymore?

Why don't they just remove it? And so then there was at a time, there was this whole virtualization coming up. So with Xen being a hypervisor and trying to run multiple operating systems at the same time on the same computer, which was also done by some people who then started MirageOS. So they already knew quite a lot of Xen and how you intake the Xen, and they then thought,

oh, what is the minimal thing that we can put there that runs as a guest? So not as a hypervisor, to take care of the real devices, but something that is there as a guest operating system and just have virtualized interfaces like a network card, a block device, and then does one thing that is supposed to do. Okay, so maybe before we go into some of the other details, what is the main use case of Mirage

at the moment in like, if you have some practical examples, where it is used? Yes, so I think there's a large variety, some websites are using it. Then we have a calendar server, so a cloud of server that is implemented using MirageOS, and running as a MirageOS communicator. We have a firewall, especially for XeoopsOS, which is an operating system that uses a lot of isolation.

And we are currently working on a VPN service, so client and server. We have replacements for, or we will work later in this year also on a replacement for DNS mask, which is DNS and DHCP server. We have, there's a product that is in high assurance, in the high assurance sector, and is acting as a service that is just there. So it's all basically about network services.

And the interesting part for me at least is to have a really small system, so to not have as Linux, the journal purpose system where you have user management and the file and the shell and all of that, but really to have something with this down to the minimal. You also said once that like perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away. So that's from my understanding also one of the

principles for MirageOS, how do you implement that in practice? By removing code. So MirageOS is actually getting smaller and smaller over the time? Yes, yes, yes. So I mean, some measurements are, for example, the Firewall 4 chipset. We started I think with years ago, so maybe seven or eight years ago, it was maybe six megabytes

in size, and that is a full virtual machine image. So there is a full virtual machine that you can run on your, than on your cube system. And these days, the same thing. So it does basically the same thing, and even doesn't a bit better because it has more performance. It's now only three points, three megabytes in size. And the question is how did we get there? Well, we look at the

dependencies. We look at what we are actually using, and then trying to get rid of, or we try to limit the scope. So we ask ourselves, how do we actually need that code? What does it do in here? And I mean, I could imagine that this is something which is for people contributing to mirage as it might, I mean, from my feeling, it could be less difficult to attract people to write something new and to add something, than to get people to help you to reduce and maintain

it over a longer time that it's getting like less complicated and reduce the complexity there. How do you attract people to this? How in general, how do you work in your community with such a principle? Well, we are also eager to basically have more code and more functionality inside of mirage, but it is the case that every now and then we think about what the mirage tool and the

whole thing, what should it do? And what are the dependencies? And usually we attract people by having this very simple approach to operating system to engineering operating systems so that people can join or people can come around and they can understand what are the different layers and how does it work from we receive an network packet at some point two years how the HDP server

handles the request and they can get and read through that entire code base within a day or two. So it's really attractive to have just this small or this tiny code base in comparison to contemporary operating systems where it takes you very several days or months in order to understand, read and understand the code. And that also means that if you want to debug a specific

issue, you can do it within weekend. So I could imagine that that's also a big advantage then when you teach how operating systems works. Is that also something where mirage or as used sometimes or that people explain how operating systems work? So it's the case that some people are working at academia. So like at University of Cambridge where mirage was also started as part of a research

project and they at least taught some lessons on how to use mirage as it shows some principles on mirage. So yes, this is a short break for our own cause. Working for software freedom and producing podcasts costs money. Please consider supporting us with a donation on the fsf e.org /donate and then the show notes about the principles. So I mean there's also I mentioned

that in the introduction that mirage OS is a unique kernel operating system. And I mean back in the days, I also own some knu-hurt CDs and played a little bit around with that. But when we now have an expert here, can you explain like what is the difference between a unique kernel like mirage OS and like the Linux kernel, which is a monolithic kernel? Her approach is that we really want to have, for example, the firewall to only act as a firewall.

So as I briefly mentioned, there's not user management involved. There's no shell access to the firewall because why would you need it? Firewall doesn't have a file system. It doesn't even have a scheduler. So it's actually a single process. So each unit can also highly tailor its system for the service or the thing it should do. So it's a special purpose operating system in contrast to,

for example, Linux, which is a general purpose. So you can do everything with the Linux. You can start your web browser and so on. And on Mirage OS, it's basically you don't have that flexibility at runtime. But at compile time, you choose which parts and which libraries you actually need for the Unicorn. So it's a lot about, you develop a lot of libraries, which are, for example, security protocols, network protocols, and so on. Then the Unicorn itself is just stitching

together the different library. And that's then also the part where with this modular approach, OCaml comes in which you mentioned before, right? Yes. So what is OCaml? OCaml is a functional programming language. So there's a lot of theory behind it, but it's basically functional programming that you can, that everything is a value. So you can program with higher order of entrance and so on. And a lot of it is also that you have a lot

of immutable state. So you don't mutate your whatever, but you just continue to use a very pure approach to programming. So we will also have some, some listeners who are not programmers. And I also the time that I program also a long time ago. What I know that you are very, very careful on what languages, what programming languages you choose. How would you explain that to non-programmers,

why this matters and why you choose this approach? So the question is what do you want to get from a program language? And there's on the one side, you can get a lot of dynamism like in JavaScript. You can just write and it works or you get a runtime in initial. JavaScript also you can do functional programming with. What you can do quite a lot where there are a lot of checks at compile time already where you verify that certain things are passed.

So where you have so-called types, so information about the program at the compile time. And if you have a type system and the compiler checks that the types Feed, then you don't run into certain issues at runtime because the compiler already verified or the compiler already validated that this is good to go. Because if you have the mathematical operation plus and you just say, oh, that is defined for

numbers and you add two numbers to get, then that's fine. But if the compiler finds out, oh, here you have a string and a number. I don't know what to do with it. Then in a statically type language, you will get that compile time and error. And for example in JavaScript, the compiler is not really a compiler. So what you will get is something that the JavaScript implementation figured out on what to do with a string plus a number. And that is different from what it does

when it gets a number plus a string. So I try to simplify that by like with the operating with the program in language you choose from your ratio as the there will be less guessing how you could have meant it. And it would rather say, well, no, that's the way how it is meant. And I will not try to guess. Thereby you will have to take more care about the state of when you program it.

But on the other hand, there will be less security problems or other problems when the program actually runs. Yes. Okay. Good. Thank you. So I'm one one thing I also wanted to to understand with now working on on Mirage OS. I mean, a lot of free software projects, they also have this issue on

how do you maintain and develop that sustainably? And one component and this is often how is the software financed? So how is that with Mirage OS? How do you find this to work on this? I mean, how many people in general are working on this at the moment? It's hard to tell how many people are actually working on that. I can tell you that I six years ago I started collecting with nowadays,

we are three people and we work full time on Mirage OS. And we are financed on various pillars, one is donations so that we can accept donations. So we have we have something that we don't run ourselves, which is this nonprofit thingy that was run by other people and they just host us. So donations is something we get every now and then? Is that donations? Is that mainly individuals or are those more corporate donations that are? It depends. It depends.

Then we apply for funding at the public sector. So in Germany, you have, for example, prototype fund where we received some money from then on the European level, you have since quite some years this NGI, this next generation internet initiative where we are pretty regularly applying for funding and also receiving funding from them. And then we also do commercial contracts. So sometimes some company or someone reaches out to us and asks us whether we can work for them.

And we then basically agree on a daily rate and say, okay, well, we can work within the next half year, so on so many days. And we put all of that into our budget and then we take a look on how to do that. So obviously, commercial contracts are giving us more money. Yeah, yeah, yeah, yeah, daily rate. So sometimes it is that we do commercial project for two months and then the next three months we don't need to work for for money. So then we have three months

basically of time that we can spend on maintaining. So do you also have this this issue then that the grants and the finances financing is mainly from the two pillars like the the grants and the commercial projects mainly for adding new features and less for maintenance work or are there also some that are actually saying like, please take time, reduce complexity, bring it

back to your principles or how is that working? Usually it is about new features. But also when we work on new features, we take time on thinking about what do we actually need and how do we integrate it into the current ecosystem or into the current library system. And for example, for the VPN client, we got a grant from NGI, we are an Lnet and there was one of the milestones was then also performance work.

And performance work is definitely something where we read through a lot of libraries and we also worked a lot of a lot on various different libraries doing basically maintenance because we needed to get rid of some indirections and yeah, in order to meet basically the performance goals. So we try to to also in these grants and so on to embed milestones like writing documentation and performance work and so on and also refactoring work to get to get

yeah, to get the dots funded. For transparency reasons, the FSV is also involved in those NGI grants. We are part of the consortium to then provide support to those who get those grants in our case with legal and licensing topics when there are questions about that. But having said that, my impression is also that in the NGI program, it's there people understand that this is part of software development and a lot of other grants, it's often not something people like

I don't pay for them to clean up their code. I want to have this feature. So I mean, that's a good really good part there with the with the NGI programs and to other people out there when you want to like to to get funding the NGI programs are definitely something to look into and see if you can also get funding through that. About the last pillar with this commercial contract, is it then something where a lot of them are also using Mirage in commercial products

or commercial services? And that depends. So for one customer we did design and implementation of a broad type of this site sharing system. Other companies who reach out to us, they are more interested in our skills to develop OCaml code and network and security code in OCam. Usually it's also the case that we do it all Open Source. So we agree with the contractors that are with our contractors that we will publish the source code also on the open in the open

source. So when you're looking into the future, what are your plans? What is your vision that you want to accomplish with Mirage OS? That's a great question. So I'm involved with Mirage OS since roughly 10 years. And back then when I started to work on that, I really wanted to get into network services and onion routing with Mirage OS that hasn't happened yet. But over the years, I also

changed basically what I want to achieve. And currently my goal, my goal is really that I want to enable more people to run their own digital communication infrastructure. So like email, photo sharing, taking notes, whatever one not. And my goal there is, or the problem I see at the moment in the world is that a lot of the communication is centralized that very few multinational

companies like hotlook from Microsoft, like Facebook, also with WhatsApp, and then also Google at Apple. And they are basically three or four or five big players who have a lot of data from all of the users. And similar to the FSFE campaign of there's no cloud, there's only other people's computers. It is really my goal to make it easier to deploy and run the services on your own.

Because also I, I, yeah, I'm involved with computer security since more than 20 years. And there I also figured that running your own mail server on Linux or previously machine is really complicated because you have to know so many things. You have to know about file systems permissions. You don't want to expose your private key material via some web server and so on. So it's really, really, really hard to get there. I mean, a lot of people have taken a lot of trainings and in doing

that. But I think that all of that could be easier. And with Miratwares having this program, programming language, OK, we have a lot of safety, basically built in similar, similar language would be rust, but actually Miratwares predates rust a bit. So we are in Okamel. And yeah, I really want to get that hot off the door so that more people use it. And in, and a few years ago,

we caught a rather large NGI grant to work on reputable binary builds. And that was a big achievement because previously we only had source code basically and said to the people, oh, compile your own Unicronon. And nowadays we have infrastructure and we actually do on a daily basis, compilations of Unicronons. And since each Unicronon uses a lot of libraries, like easily 100 200 different libraries. And these libraries are developed independently. And they are pushed and

released sometimes on weekly basis, sometimes on monthly basis. But we use this reproduce a building facility to build our Unicronons every day with the latest versions to see whether we have failures and also to see what actually affects our output. So now that you mentioned reputable builds, we need to quickly go into this. I think we explained it in one of the podcasts before, but so the idea with reproducible builds is that if you compiled a program that every time you

compile it, that you can achieve the same binaries afterwards. So if you then publish the binaries that can run on on another platform, that you can say, this is actually coming from this source code and without any other additions from there, right? Yes. And the idea would then be for Mirage, I mean, what you can already do is you can run Mirage on another operating system to then provide

like this calendar sharing with others. And the idea would then be that you add other services there like the thing you're working on with with websites to provide website or then with an email server that it's very easy for people to at home or with a small rented server without a lot of resources, they can run a lot of the infrastructure they need for daily life without depending on some large infrastructure provider or service providers. Yes. And also they can easily upgrade the

single services very independently because this is basically just a aesthetically compiled virtual machine image. So you can just update it and try it out and if it doesn't work, you can just revert to the previous version. And I think what you what you briefly mentioned about this few resources, that is really the crucial bit. It is not only about security, but also about resource usage. So if you have a very small system, you have less attack surface, but at the same time,

you have less code that is running, which means you actually use fewer resources. That's also one of the topics we also touched before about like sustainability in software development. And I mean, with running such a, yeah, minimalistic by design operating system, that also means that you need way less powerful machines to run this on. And I mean, can you,

what hardware can you use to use Mirage on dislike with this calendar server? Well, obviously you're left up, but you can also do it on a Raspberry Pi. You can, I mean, even years ago, there was a person who ported Mirage was on an ESP32. So that's a small microcontroller that you can get for five years or so. And yet the variety is large. And the research user is really, really small. Also, that is also what the cubes community appreciates a lot about

firewall, because it uses 10 times less memory than Linux with having the same, the same behavior or having the same thing that was actually doing. Actually, also the first time I heard about Mirage was that a cubes user told me about it and showed me like how cool this is that you can run this this firewall and it doesn't need a lot of resources, because I mean, usually when you use cubes where you have different, a lot of

compartmentalization for your operating system, it takes a lot of resources for you. So you're very happy if one of those components is using less resources there. So and so by this design, it's also from your perspective, that's also the approach how you can achieve a decentralization without explosion of resources needed for this decentralization, right? Yeah. Okay. Then is there anything else you wanted to talk about from the technical perspectives

with Mirage OS? I think maybe, yeah. So we talk quite a bit about cubes and Xen, and that was basically the initial days, but nowadays that also computers are getting a bit more modern and having these virtualization support in hardware and Linux having, for example, this KVM subsist. That is also something we support since seven or eight years. So we are not stuck with Xen

We were using Xen in the beginning, but nowadays we moved a bit further and also support KVM and previously it's called VIVE and OpenBC. It's called VMM. So all these hardware features. So it's more like we try to be open for any operating system. And it is not a complete operating system. So I don't use it on my desktop, I don't use it for development, but I run it in order to have some network services. So I think that's something to make clear that it's not

something you don't install Mirage OS on your mobile phone or on your laptop as the first operating system, but you started from within another operating system. Yes. While at the same time, for example, for the Raspberry Pi, we have a native port. So that means you can just run it directly on your Raspberry Pi. You don't have another operating system below it. Didn't know about that. Good that we clarified that. Before we go to our last question, then I have

one other question because I wanted to know like how did you end up after you do all this programming and those technical things? How did you end up writing a book about Indian cuisine? It's actually a book about Indian cuisine and functional program. So there's a book. It's called Curry Book in German published by Oreli. We had, obviously, this idea that in functional programming,

you have this mechanism called currying and curry and Indian cuisine and Indian curry that was just such a nice match that we had this idea to write a book about it. The Curry book have some recipes for Indian cuisine in there, but also teach people how to do functional programming in that book using JavaScript. That's okay. Now I get it. We actually did the

analogy with recipes and programming. We also used that for a long time and I think that was first time I was on television at the results of us recording. I did some Pesto where I absolutely failed to do that and explained software while doing that. And with some of the readings, recently we did, we had one of our volunteers who came to those readings with an ice cream machine

and then printed out recipes in programming, language programming style to show the children what is actually used to do the ice cream there. Good. Well, Hannes, I at least learned a lot during our conversation here again. The last question we always have is, as we are running the I love software day now for ages and on this day on the 14th of February, we encourage everyone to thank

other people in our community for things they do for a software freedom. On the other hand, we also think about 14th of February that's one day of the year. So in this podcast, we do that every time. So now you have the chance to thank whoever you want for the things they do. Oh, that is a good question. So I'm really grateful, for example, for my development environment. So for all the people who work on EMAX, I'm really happy about that because that gives me a lot of

productivity. Then I'm really happy about, yeah, the people doing freebies TV because I use free BST on both my laptop and my service. And it's just such a simplistic, nice way to go around. And apart from that, I mean, there are so many applications that I rely on on a daily basis. And it's just so amazing, like Firefox, like a mail client and all of that. And that's just

impressive that it's available for free. For all the people who do work on compilers and so on, and on debuggers because without the user, I wouldn't be here. Then thank you very much, Hunters, for being with us today and all the best for your future development with Mirage and your other projects. Thank you very much. Thanks for having me here. This was the Software Freedom Podcast. If you liked this episode, please

recommend it to your friends or colleagues. And also subscribe so you will not miss the next episode. This podcast is presented to you by the Free Software Foundation Europe. We are a charity that works on promoting Software Freedom. If you like our work, please support us with a donation. You find more information on the FSFE.org/donate. Thank you very much. Bye-bye.

Open the transcript file

Hosts and Guests

Nobody is credited on this episode yet.

Credit the people on this episode

Be the first to rate this episode

More episodes

All episodes
  1. SFP#58: Policy and EU: The city of Dortmund, a digital sovereignty model!

    Nov 19, 202644 minAudio

    In our newest episode of the Software Freedom Podcast, Bonnie Mehring talks with Christian Nähle, Managing Director of Do-FOSS, an initiative promoting software freedom in the city of Dortmund, Germany. They discuss how...

    Credit the people on this episode

  2. SFP#57: Policy and EU: Why everyone should care about procurement!

    Oct 15, 202656 minAudio

    It is Podcast Friday! For our regular episode of the Software Freedom Podcast, Bonnie sat down with Alexander Sander, FSFE's policy consultant to talk about procurement as its rules for the public sector is currently...

    Credit the people on this episode

  3. SFP#56: Policy and EU: All about the DNA

    Oct 9, 202631 minAudio

    Fall is finally here, and so is our next episode for the Software Freedom Podcast! In this episode Bonnie Mehring meets with Dario Presutti, FSFE's project manager working on different policy and legal topics. Together,...

    Credit the people on this episode

  4. SFP#55: Policy and EU: Meet our Danish local group from Aarhus!

    Sep 17, 202644 minAudio

    The Software Freedom Podcast for September is out! In this episode Bonnie Mehring meets with Carsten Agger, the FSFE’s Danish Coordinator. Together, they talk about the Free Software community in Denmark, digital...

    Credit the people on this episode

  5. SFP#54: Policy and EU: Keep Android Open, what is the FSFE doing?

    Aug 13, 202635 minAudio

    The Software Freedom Podcast is not going on holiday this summer! In our 54th Bonnie Mehring meets with Jithendra Palepu to learn about the Android Developer verification and how it may affect the Android operating...

    Credit the people on this episode