From there, you can start stripping out other things. You don't need a huge init system because all you're doing is running a single application. Your libc can be made tiny, or removed completely, because you can strip it of all the calls your app doesn't need. You don't need to run an sshd, because there is no shell to get into. You can get rid of PAM because there's no accounts to access or authenticate against.
On real machines and VMs, these things are necessary so you can run tests, do cleanup, etc. Unikernels are centered entirely around the idea that those things are someone else's job, and if needed, can be shouted for across the network.
Because you've stripped out everything that could supply you with any other option.
Many common server frameworks build in multiprocessing to the language runtime: Node.js mandates an event-driven callback style, Go has goroutines, etc. So it already exists in userland. Unikernels avoid duplicating that functionality at the kernel level, so the two systems don't fight each other.
The hypervisor proxies device drivers through from the host operating system (running in Dom0) to the guest operating systems.
The idea is to run eg. Node, or Postgres, or memcached on bare metal. So instead of write() trapping into the operating system, it becomes a library function that directly talks to the underlying device driver. The only process the VM runs would be that one application, and you'd rely on the hypervisor to schedule multiple applications on one physical box.
(Sadly, I don't remember the title for a citation here.)
Anyway, I don't have experience on Go or V8 Javascript, but C pthreads, Haskell threads and Python threads all just encapsulate the OS functionality to add some conveniences. Java does come with a complete threading implementation, and gets no lack on criticism because of that. You may get away running Node on a single task kernel, but Postgres will simply refuse to load if it can not fork some processes and talk to them by shared memory. Apache's behavior is similar.
So unikernels are not about containers, and I've been mixing two different approaches. It makes more sense now.
Before you had to rely on say apache for urlrewrite and routing. Now the data and logic has been lifted into languages.
Xen provides very basic (but safe) message/event channels between VMs. Basically this becomes your IPC, and the VMs become user processes.
With a new enough CPU with the correct memory virtualization features, xen can scale to many thousands of domUs. And with each domU only taking up slightly more resources than a typical user process, this is a completely reasonable approach.
Again, your Hypervisor becomes the OS which has to worry about the baremetal, and the VMs replace user processes.
I intend to playing with MirageOS seriously myself next year.
Edit: some dependencies in an example MirageOS app: https://mirage.io/wiki/technical-background#ModularOSLibrari...
I agree with you 100%, but it does make me think. Every Linux installation I've done in the last five or so years has been either under ESXi, or on AWS.
I'm sure I'm not alone in that, and that's a trend that's going to continue to grow.
How much of the kernel is drivers that are absolutely never going to useful in that scenario?
How much room is there for distributions to start supplying a kernel configuration with half of it never built?
Yep, unikernels can get away without the security boundary between user and kernel modes... except if you want any security at all in your installation, because at kernel mode people can break out of the container.
They can also get away without process scheduling and IPC, but if you want any multiprocessing on the application, you'll need to bring it either on the kernel or the userland. Ditto for user management.
They can't really get away without device drivers. Ok, except for devices that you won't use, just like any other kernel.
What is that kernel feature that people take away? Or are they just talking about a stripped down Linux without the device drivers (that fit a floppy disk)?
The same applies to the services. What are those services that people gain so much from removing from containers, and why don't people remove them from VMs and real machines too?