Show HN: Munal OS: a graphical experimental OS with WASM sandboxing

109 Gazoche 33 6/9/2025, 5:34:29 PM github.com ↗
Hello HN!

Showing off the first version of Munal OS, an experimental operating system I have been writing in Rust on and off for the past few years.

https://github.com/Askannz/munal-os

It's an unikernel design that is compiled as a single EFI binary and does not use virtual address spaces for process isolation. Instead, applications are compiled to WASM and run inside of an embedded WASM engine.

Other features:

* Fully graphical interface in HD resolution with mouse and keyboard support

* Desktop shell with window manager and contextual radial menus

* PCI and VirtIO drivers

* Ethernet and TCP stack

* Customizable UI toolkit providing various widgets, responsive layouts and flexible text rendering

* Embedded selection of applications including:

  * A web browser supporting DNS, HTTPS and very basic HTML

  * A text editor

  * A Python terminal
Checkout the README for the technical breakdown.

Demo video: https://streamable.com/5xqjcf

Comments (33)

herobird · 1h ago
> Every iteration of the loop polls the network and input drivers, draws the desktop interface, runs one step of each active WASM application, and flushes the GPU framebuffer.

This is really interesting and I was wondering how you implemented that using Wasmi. Seems like the code for that is here:

https://github.com/Askannz/munal-os/blob/2d3d361f67888cb2fe8...

It might interest you that newer versions of Wasmi (v0.45+) extended the resumable function call feature to make it possible to yield upon running out of fuel: https://docs.rs/wasmi/latest/wasmi/struct.TypedFunc.html#met...

Seeing that you are already using Wasmi's fuel metering this might be a more efficient or failure proof approach to execute Wasm apps in steps.

An example for how to do this can be found in Wasmi's own Wast runner: https://github.com/wasmi-labs/wasmi/blob/019806547aae542d148...

Gazoche · 9m ago
Thanks again for making Wasmi :)

> It might interest you that newer versions of Wasmi (v0.45+) extended the resumable function call feature to make it possible to yield upon running out of fuel:

That is really interesting! I remember looking for something like that in the Wasmi docs at some point but it must have been before that feature was implemented. I would probably have chosen a different design for the WASM apps if I had it.

9d · 1h ago
Not OP, but I'm confused how this would be helpful. You're saying for example, he can use this function to create a coroutine out of a function, begin it, and if the function fails by e.g. running out of memory, you can give the module more memory and then resume the coroutine? If so, how is that different than what naturally happens? Does wasm not have try/catch? Also, wouldn't the module then need to back up manually and retry the malloc after it failed? I'm so lost.
herobird · 1h ago
Great question!

Wasmi's fuel metering can be thought of as is there was an adjustable counter and for each instruction that Wasmi executes this counter is decreased by some amount. If it reached 0 the resumable call will yield back to the host (in this case the OS) where it can be decided how to, or if, the call shall be resumed.

For efficiency reasons fuel metering in Wasmi is not implemented as described above but I wanted to provide a simple description.

With this, one is no longer reliant on clocks or on other measures to provide each call its own time frame by providing an amount of fuel for each Wasm app that can be renewed (or not) when it runs out of fuel. So this is useful for building a Wasm scheduler.

9d · 3m ago
> Great question!

Thanks! I have lots more too. Are there directions in space? What kind of matter is fire made of? If you shine a laser into a box with one-way mirrors on the inside, will it reflect forever? Do ants feel like they're going in regular motion and we're just going in slow motion? Why do people mainly marry and make friends with people who look extraordinarily similar to themselves? How do futures work in Rust? Why is the C standard still behind a paywall? Let me know if you need any more great questions.

9d · 2h ago
> The downside of course is that each step of the loop is not allowed to hold the CPU for arbitrary amounts of time, and must explicitly yield for long-running tasks.

Seems to me that a bigger downside is that the more apps you have open, the slower each one will become. I don't remember ever having more than like 10 open, but I've definitely had 30 tabs open, so if they're each separate procs then wouldn't that slow each one down by 30x? I guess if the whole computer is fast enough that's fine, but intense processes like video renderers would slow down noticably, even if not fast, even if just going from 1sec to 30sec. But in any case this is a really, really clever shortcut for the general case to get a whole operating system working, which is no small feat, and really exciting!

jauntywundrkind · 51m ago
I can't wait to see what attempts like this might look like after wasm components start becoming real(-er).

I have huge respect for unikernel designs, and this looks amazingly festureful. & Yet… I don't know why it matters to me as much as it does, but I want so very much for wasm to be useful for more than one big precompiled app.

There's all sorts of work going into wasi preview3 right now, to allow sync and async code to co-exist. Once that happens, it feels like wasm will finally have all the necessary ingredients down to be an everything runtime (although I'd hoped the host-object bridging was going to get more love too, & it's not clear to me that there's any itnent to go beyond js-based bridges like rust web-sys, on and on).

I hope we see more interest in wasm runtimes being used to host more dynamic sub environments, to host not just one amazing process but many processes. The promise of wasm components is to give us: standard, portable, lightweight, finely sandboxed, cross-language, compositional module (according to the wonderful talk linked below), and it seems so near, but this status quo of it being used so extensively in unikernel like applications, needing everything compiled ahead of time, feels like the area I want to see wasm expanding into not as a specification (the spec seems there!) but as a practicable doable thing, like what I want wasm components to be good for. Not just a distribution format but a runtime capability.

What is a Component (and Why) https://youtu.be/y3x4-nQeXxc

simonw · 44m ago
Wow, this thing even has its own web browser! https://github.com/Askannz/munal-os/tree/master/wasm_apps/we...

You can see a snippet of it running (and rendering Hacker News) in the demo video.

9d · 2h ago
This is incredible. I wonder if this will be the future of OSes.

This readme is really, really interesting to read through.

Why did you use wasmi instead of wasmtime?

I might actually try to use this OS inside a VM.

Half of me wants to port my own reactive GUI lib to Munal.

Gazoche · 2h ago
Thanks! I tried to get wasmtime working but it was too much of a pain to compile in no_std mode, so I settled for wasmi instead.
herobird · 2h ago
Wasmi author here. Glad to see Wasmi being used in embedded contexts were it really shines. :)

I just watched the demo video of Munal OS and am still in awe of all of its features. Really impressive work!

Gazoche · 15m ago
Thank you! And thanks for making Wasmi, it's a really impressive project and it's the reason why I decided to go this whole WASM sandbox route (because I could embed it easily) :)
9d · 1h ago
Yeah it's one of those projects were I'm so impressed that I'm saying nothing because there's nothing to say, it's just really impressive. I'm not sure what will come of this project, but it has a lot of potential to at least inspire other projects or spark important discussions around its innovations.
phickey · 1h ago
Wasmtime maintainer here - curious to hear what went wrong, I and several other users of wasmtime have production embeddings under no_std, so it should do everything you need, including building out WASI preview 2 support. You can find me on the bytecode alliance zulip if you need help.
lasiotus · 3m ago
I'm not the OP, but I have a similar experience with Motor OS: wasmi compiles and works "out of the box", while wasmtime has a bunch of dependencies (e.g. target-lexicon) that won't compile on custom targets even if all features are turned off in wasmtime.
fsflover · 1h ago
> I wonder if this will be the future of OSes.

If you are talking about the app isolation through virtualization, then I've been living in this future for quite some time with Qubes OS. The isolation there is also extremely reliable.

9d · 1h ago
Mostly I meant WASM as a platform (waap?) which seems so futuristic to me. I hope one day all OSes can natively run WASM code, though I'm not sold on WASI since then we're back to square one with security it seems.
dmitrygr · 1h ago
> I wonder if this will be the future of OSes.

SPECTRE and MELTDOWN enter the chat

9d · 1h ago
What the DLL, Dmitry. Don't be a buzzkill.
pjmlp · 32m ago
/rant mode on

Every few years since Xerox PARC, we get yet another attempt to bytecode userspace.

So far only IBM i, ChromeOS and Android managed to stick around, mostly thanks for their owners having the "my way or the highway" attitude, with management willing to support the teams no matter for how long it takes.

/rant mode off

Anyway, all the best for the project, looks cool.

knowitnone · 28m ago
this is very impressive. I really like that you have a browser which is almost mandatory for a desktop OS now. You should write down your TODO list and I hope you keep working on this. I think there is room for many OSes especially ones written in Rust.
geoctl · 1h ago
Great work. I've always wondered if WASM could actually be used as a more generic alternative alternative to eBPF where you could actually do more complex logic than the average eBPF program at the kernel level and still have customized and restricted access to the kernel APIs and data structures like you're actually developing a typical kernel module.
baq · 1h ago
Fun project. The grey beards will gladly read how is it qualitatively different from early Windows or maybe even AmigaOS Workbench? The dinosaurs will probably point to bytecode interpreters mixed with OSes like Lisp machines or smalltalk environments, could be an interesting comparison, too.
Ericson2314 · 1h ago
This is a very good bucking of conventional wisdom. Good job!

Now that Redox aims to support WASI too, it would be interesting to see if the syscall interfaces of these two can grow together other time, even as the implementation strategy remains radically different.

catapart · 1h ago
This is so interesting!
bionhoward · 2h ago
Great job! Congrats on shipping, this looks like a big project
pacman1337 · 1h ago
Very cool and impressive, you probably learned a lot. BUT! Why spend so much time and effort on something that has almost zero value to humanity. I honestly think many great programmers just don't know what to work on. They don't know their worth, their value, the impact and immense need there is for their expertise. They have so much power to improve and fight against the dystopian world that is being created by all these evil corporations, if they just realized what we actually need to build.
graypegg · 56m ago
> They have so much power to improve and fight against the dystopian world that is being created by all these evil corporations, if they just realized what we actually need to build.

That is a tad dramatic. You could also say the same thing about any art form.

- Painters spend all of their time working on artwork only a few people will ever see!

- Musicians don't realize how their time is wasted composing music that won't solve any problems!

- People are starving right now, as another writer dares to write a story that simply tries to entertain the reader.

Everything is political, and we all should keep that in mind. We all have effects on society no matter what. But also, it's fine to make a cromulent thing because it's interesting. We've all only got so much time alive, but you're going to squander the experience if you try to min-max impact on those 90-odd years. People do have to live for themselves sometimes, and this person likes making a neat homebrew OS.

knowitnone · 35m ago
you already provided 3 reasons: "Very cool and impressive, you probably learned a lot". Why does everything you do have to serve humanity? what have you done to serve humanity and why are your other projects not serving humanity? And who are you to push your views and dictate what others do?
masijo · 56m ago
Jesus, can't people have fun anymore? Does everything have to be "important for humanity"?

Do you listen to music, read books, have sex etc? I bet you do. And I also bet that you would find it pretty ridiculous if someone asked you why you do those things instead of helping humanity.

simonw · 40m ago
Thinking like that is a trap. No matter what you are working on there could always be some other project that has greater "value to humanity".

I for one celebrate any time people invest their efforts in building something unique, new and interesting. This project is absolutely delightful.

9d · 1h ago
Not sure why you were downvoted. I think you're probably right about a lot of that. I do know that it's certainly the case for me. I have a lot of talent, but I can't harness it unless I find a project I truly believe in. But who's to say which projects are worthwhile, which projects genuinely help humanity? Not everything we do and breathe needs to be activism against injustice all the time. Take pico8 as an example. That has rejuvenated the joy and wonder of countless aging programmers, and probably taught many young people how to make games. Is that not inherently a good thing? And it made money doing it, should it not?
owebmaster · 1h ago
Imagine being the guy saying this to Linus Torvalds when he did the OG "Show HN":

  Hello everybody out there using minix -

  I'm doing a (free) operating system (just a hobby, won't be big and professional like gnu) for 386(486) AT clones. ...

  It is NOT portable (uses 386 task switching etc), and it probably never will support anything other than AT harddisks, as that's all I have :-(.

  I'd like any feedback on things people like/dislike in minix, as my OS resembles it somewhat (same physical layout of the file-system (due to practical reasons) among other things).

  ...

  Linus (torvalds@kruuna.helsinki.fi)