by torne » Fri Aug 13, 2004 11:55 am
Xen is a free-standing virtual machine monitor for x86 boxes, similar to the server-side version of VMWare (GSX and ESX) in that the 'host' OS is not a full operating system. It's pretty much the 'minimum required' kernel to run in ring 0 - it can do virtualisation, memory management and access control, and that's about it. It's not based on Linux, though some of the code was sourced from the Linux kernel (Xen is under the GPL). The 'host' OS is just the Xen kernel, and has no interface to the outside world except the serial console for debugging. A guest OS that wants to run on Xen has to be ported to run in ring 1 - a halfway-house between the UML and VMWare approaches. Most system-level access (managing user-level processess..etc) can be done without making Xen calls, and there is a fast-path system call handler that allows userspace apps to make calls into their guest OS's kernel (with the ring 1 transition) without having to transition through ring 0 to Xen. Linux has been ported as XenoLinux, a patch to the Linux kernel much like the UML one, except using Xen's hypercall interface instead of running in userspace and using Linux's system call interface. One of the BSDs is being ported too, though I'm not involved in that effort. I worked on porting the Windows NT kernel a while back and we made good progress, but currently that port is only available to MS Shared Source licencees and is still experimental in any case. You can run any number or combination of guest OSes, as long as they are all ported.
There is no 'master Linux machine' - the first guest OS started (which currently has to be Linux, but this restriction should vanish eventually) is considered privileged in that it has the ability to start and stop other guests, but those permissions can be given away or restricted; only Xen is special. In the latest CVS of Xen, hardware drivers can run in isolated guest OSes (using native Linux drivers, for example) without ring-0 privileges, only the inter-OS communication being handled by Xen. This makes Xen much smaller and simpler, and means it's possible for your system to survive a device driver crash.
Xen's paravirtualisation is much more efficient than UML (with or without skas3, because of tricks like direct system calls to the guest OS kernels) and beats the pants off VMWare (which has to do binary rewriting in exchange for the ability to run unmodified operating systems). It also does a better job of performance isolation than UML, making it extremely hard for one guest to deprive the others of resources.
This has wandered a bit off-topic, but, ah well. GRSec would still apply to XenoLinux (though the merging would still cause problems, especially as guest OSes can't write directly to their page tables for security reasons and must buffer updates through Xen), as the tricks it uses like VM mirroring and such would still work through paravirtualisation. Xen itself shouldnt need security help, though, as it doesn't communicate with the outside world directly and keeps itself and each guest OS strictly isolated.