Compared to a "traditional OS":
- hypervisor is much smaller, and as a result reduces security risk
- hypervisor is younger and has less compatibility burden, so typically carries less technical debt, can improve faster.
- hypervisor exposes lower-level interface, so more work is left to the app developer (or the build toolchain, which is where unikernels come in).
- hypervisor has no support for legacy APIs such as posix or win32. As a result almost no applications target it, which makes it a hidden piece of plumbing and makes it harder to replace the traditional OS, even when it's redundant from a strictly technical point of view.
Think Burroughs, Lisp Machines, Mesa/Cedar, Lillith, Spin OS, Oberon,...
Basically the language runtime is the OS and access to lower layers is done via the type system.
~ Daniel Ingalls, co-creator of Smalltalk http://web.archive.org/web/20070213165045/users.ipa.net/%7Ed...
C and C++ are the outliers here.
Although C++ is moving into a richer runtime, thus increasing the likelihood to write OS independent code without relying on third party libraries.
Even C, if POSIX had been part of ANSI C, would fall into this scenario.
In a way, UNIX can be seen as C's original runtime.
Younger than what? VM dates to the first half of the 1960s.
The concept of the OS is older, but most OSes in active use now aren't.
By "younger" I mean the source code was written, and the interfaces defined, much more recently.
OS: sprawling interface, tighter integration with what's running on it, provides a lot of shared interfaces for the things running inside.
Hypervisor advantages: much more secure, tenants unlikely to experience resource starvation (because scheduling is probably simple round-robin or similar)
OS advantages: potentially better scheduling (it can prioritize, it knows which processes are doing I/O and which are using CPU), lots of easy ways to do ad-hoc cooperation between tenants (e.g. filesystem, pipes, signals)
In a traditional OS, the OS is in charge of managing all the hardware directly.
In a hypervisor environment, the hypervisor manages the hardware, but provides abstractions for this hardware that other OS can use. There are a couple of different ways this is managed, but to simplify either the guest OS needs to be designed to use the hypervisor environment, or the guest OS can run unmodified on top of the hypervisor. The option to run unmodified guest OS relies on the hypervisor providing virtual representations of the real hardware, which the guest OS manages as if the virtual hardware is real hardware.
Hypervisors could be used to run OSes and application software designed to run alone on the hardware, which was more common, of course: VM/CMS was a classic design, with VM being the hypervisor and CMS being an OS about as complicated as MS-DOS. CMS provided all of the abstractions and absolutely no security, not even being able to run multiple applications at once, and VM allowed multiple CMS guests to run at the same time.
It's secure because the VM is invisible. Ideally, there's no attack surface whatsoever, because guests can't attack what they can't see. You might as well punch the air.
How true any of that is today I don't know.