![[personal profile]](https://www.dreamwidth.org/img/silk/identity/user.png)
Idle thought... I was writing about MicroVMs the other day:
https://www.theregister.com/2023/08/29/freebsd_boots_in_25ms/
It made me wonder... if you can have a Linux VM that starts in milliseconds, could you create one for a vaguely Unix-like but non-Unix OS, such as Plan 9, so that it could run Linux binaries on this non-Linux-like OS?
ISTM you'd need two or three things, all of which either exist or are doable.
1. A very small Linux distro, tailored to talk to VirtIO devices and to net-mount all its filesystems over 9P. No `initrd`, because we know exactly what the virtual hardware will be in advance. Maybe some tiny simple init like tini:
https://github.com/krallin/tini
Boot, run the binary supplied on the command line, when it exits quit.
2. Plan 9's VM, vmx, cut down even further to make a microVM.
https://9lab.org/plan9/virtualisation/
3. Some tool that lets you start a Linux binary and spawns a microVM to run it, with the current working directory your current dir in the Plan9 FS.
`lxrun strings foo`
MicroVM starts, loads `strings`, supplies it with `foo` as input, outputs to your `rc` session -- just like starting a VM with Vagrant on Linux: disk chugs, and suddenly you're SSHed into some totally different distro _in the same terminal session_.
If the app is graphical it could attach to X11 or Equis:
https://9p.io/wiki/plan9/x11_installation/index.html
The root idea: provide something much simpler and easier than the existing Linux-emulation tools out there -- which are very much a Thing, but are _hard_ and don't work terribly well -- but with much the same end result.
Examples:
• the FreeBSD Linuxulator: https://wiki.freebsd.org/Linuxulator
• the SCO `lxrun` tool: http://download.nust.na/pub3/solaris/intel/7/lxrun/lxrun.html
• Solaris lx zones: https://docs.huihoo.com/opensolaris/solaris-containers-resource-management-and-solaris-zones/html/p99.html
I just found out that there _is_ a Linux emulator for Plan 9 -- Linuxemu: http://9p.io/wiki/plan9/Linux_emulation/index.html
So, a Plan 9 "Linuxulator" exists, but this might still be easier, more current, and need less work. In other words, make a Plan 9 setup that you can use like a Linux distro, to encourage Linux folks to try it and maybe move over. TBH if I could run Waterfox and Chrome or Epiphany, plus a Markdown editor, I could do most of my job right there.
Is this absurd, or is it fairly doable?
I daresay the Plan 9 fans would regard this as heresy or simply incomprehensible, but they're not the target audience. People who like minimal terminal-driven Linux distros are.
As for _why_... well, my impression is that in many ways Plan 9 is a better Unix than Unix... but it's not better _enough_ to have driven adoption. As a result, it still has a _lot_ of rough edges, and in that, it reminds me of mid-1990s Linux: weird, cryptic, and _hard_.
Qubes OS is a thing: keep your system safe by running everything in a different VM. It's hard and it's complicated and most people are not that worried. But what if you put a better OS underneath?
https://www.theregister.com/2023/08/29/freebsd_boots_in_25ms/
It made me wonder... if you can have a Linux VM that starts in milliseconds, could you create one for a vaguely Unix-like but non-Unix OS, such as Plan 9, so that it could run Linux binaries on this non-Linux-like OS?
ISTM you'd need two or three things, all of which either exist or are doable.
1. A very small Linux distro, tailored to talk to VirtIO devices and to net-mount all its filesystems over 9P. No `initrd`, because we know exactly what the virtual hardware will be in advance. Maybe some tiny simple init like tini:
https://github.com/krallin/tini
Boot, run the binary supplied on the command line, when it exits quit.
2. Plan 9's VM, vmx, cut down even further to make a microVM.
https://9lab.org/plan9/virtualisation/
3. Some tool that lets you start a Linux binary and spawns a microVM to run it, with the current working directory your current dir in the Plan9 FS.
`lxrun strings foo`
MicroVM starts, loads `strings`, supplies it with `foo` as input, outputs to your `rc` session -- just like starting a VM with Vagrant on Linux: disk chugs, and suddenly you're SSHed into some totally different distro _in the same terminal session_.
If the app is graphical it could attach to X11 or Equis:
https://9p.io/wiki/plan9/x11_installation/index.html
The root idea: provide something much simpler and easier than the existing Linux-emulation tools out there -- which are very much a Thing, but are _hard_ and don't work terribly well -- but with much the same end result.
Examples:
• the FreeBSD Linuxulator: https://wiki.freebsd.org/Linuxulator
• the SCO `lxrun` tool: http://download.nust.na/pub3/solaris/intel/7/lxrun/lxrun.html
• Solaris lx zones: https://docs.huihoo.com/opensolaris/solaris-containers-resource-management-and-solaris-zones/html/p99.html
I just found out that there _is_ a Linux emulator for Plan 9 -- Linuxemu: http://9p.io/wiki/plan9/Linux_emulation/index.html
So, a Plan 9 "Linuxulator" exists, but this might still be easier, more current, and need less work. In other words, make a Plan 9 setup that you can use like a Linux distro, to encourage Linux folks to try it and maybe move over. TBH if I could run Waterfox and Chrome or Epiphany, plus a Markdown editor, I could do most of my job right there.
Is this absurd, or is it fairly doable?
I daresay the Plan 9 fans would regard this as heresy or simply incomprehensible, but they're not the target audience. People who like minimal terminal-driven Linux distros are.
As for _why_... well, my impression is that in many ways Plan 9 is a better Unix than Unix... but it's not better _enough_ to have driven adoption. As a result, it still has a _lot_ of rough edges, and in that, it reminds me of mid-1990s Linux: weird, cryptic, and _hard_.
Qubes OS is a thing: keep your system safe by running everything in a different VM. It's hard and it's complicated and most people are not that worried. But what if you put a better OS underneath?