3 ms·
The idea is that your security boundary is at the VM. The VM hypervisor presents a virtual CPU; malicious code cannot jump out of the box. Many common server
by nostrademons 11y ago
The idea is that your security boundary is at the VM. The VM hypervisor presents a virtual CPU; malicious code cannot jump out of the box.
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.
- marcosdumay 11y agoDidn't containers just create a sandbox for the code to run? If they get a full VM, what is the difference between containers and old style VMs? 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.
- sp332 11y agoContainers share a kernel, but unikernels run right on the hypervisor. Basically your program is the kernel, and it's the only thing running in the VM.
- marcosdumay 11y agoOh, thanks. So unikernels are not about containers, and I've been mixing two different approaches. It makes more sense now.
- ori_b 11y agoMildly interesting historical note -- a few years ago I was reading an old paper on operating systems from the 1960s. As I recall, it seemed to refer to a process as a "virtual machine". (Sadly, I don't remember the title for a citation here.)
- agumonkey 11y agoI'm gonna stretch things a lot but it reminds me of the standalone webserver versus language embedded webservers. Before you had to rely on say apache for urlrewrite and routing. Now the data and logic has been lifted into languages.