Why Xen requires an OS though it is a Type I Hypervisor? - virtualization

Xen is a Type I hypervisor that means it can run directly on hardware so why do we need to install Ubuntu or CentOS or any OS to run Xen? It should run directly on the hardware as it's a Type I hypervisor.

The reason that an OS is needed is because Xen itself does not directly provide any mechanism for creating/managing virtual machines. Because these tasks require things like creating disk images, editing configuration files, setting up networking etc. It would be wasteful for the Xen project to reimplement all of this functionality when it is already included in widely-used OSes like Linux.
The only way to interact with Xen is by making hypercalls, some of which can only be made from the dom0 (Domain 0) VM. As noted in the Xen wiki this means that the hypervisor can be left to just the tasks which only it can perform - checking page tables, allocating resources for new domains, and scheduling domains.
I'm not aware of any type 1 hypervisor which does not need an OS in one way or another - many of them use Xen under the hood, with a custom OS. Things like VMWare ESXi (which does not use Xen) bundle their own OS as part of the distribution so still have an OS running on top of the hypervisor to provide needed functionality.

Related

hypervisor and what does it do?

I understand servers are set up to run virtual machines with user applications in cloud settings and will have a hypervisor instead of a host operating system, I was curious why is the hypervisor use in place of the host operating system?
The hypervisor is used to do the abstraction between the physical and the virtual resources. In other words, it is responsible to create a virtualized layer and share the hardware components (CPU, RAM, NIC, storage) to the virtual machines that will be used. Therefore, it is a lot simpler to centralize and manage multiple sources of heterogeneous elements. It is possible to deploy two types of hypervisors:
Type 1 Hypervisor:
There is no actual operating system installed on the bare metal server except the software used to deploy the hypervisor. It is especially used in an enterprise context considering that you maximize the resources to share (you do not have the limitation of running an underlying operating system), but it also possible to deploy one in a home lab if you have the required hardware. A classic example is a VMWare ESXi host.
Type 2 Hypervisor:
It consists of installing the hypervisor on top of the actual operating system (Windows, Linux, MacOS). It is used especially for testing, deploying simple services and to extend your software capabilities (you can run multiple different operating systems simultaneously). A classic example is Oracle’s Virtual Box.

hypervisors and java virtual machine

The questions I would like to ask are:
1) What exactly does hypervisor do? Why is it needed?
2) What is the difference between hypervisor and Java Virtual mMchine?
3) Does JVM use a hypervisor?
4) When a host operating system like linux can handle multiple guest operating system,why use hypervisor?
Would be great help if someone shed light on this
A Hypervisor also known as hardware virtualization are a virtualization layer that allows running one or more native operating system on top of it, as if they run on a physical machine. It is similar to emulation but only runs operating systems that would be able to run without the Hyperviser, which are much faster.
Both are virtualization layers. However Java are optimized for performance and portability. While Java are technicaly an emulator, it are much faster than an hyperviser. This can be achieved because the emulated platform are designed for fast emulation. Java do not run x86 or x86_64/amd64 code, it runs something called Bytecode. The technical term for Bytecode are Intermediate Language (IL). It are compiled to code that are native to your processor when you run it, by the Just In Time compiler (JIT). As the JIT do a compilation process it can make sure that the program follows Java:s security constraints, by simply not generating code that violates such constraints. The Hyperviser enforce security constraints by intercepting so called privileged instructions and by emulating devices such as disk drives. This are done because native x86 or x86_64/amd64 code are very hard for a program to understand, and changing it so that it self-enforce security constraints are next to impossible. Java on the other hand runs Bytecode which are easy for a program to understand and chance so that it self-enforce security rules.
The short answer: An hyperviser are slower than Java but allows you to run a multitude of complete operating systems, and all the software available for them. This while Java are faster, but you can only run Java software on it. If you want to run Windows and Office in your virtual machine, you can't do that in Java.
I think I answered this above but no, it use code inspection and modifies the program so that it self-enforce security rules. This can be done because runnable Java application are in a intermediate state called Bytecode, which are easy for Java to understand, inspect, find code that may violate the rules and modify it in order to obey them. This are a rather complex process that have several advantage over hypervisor. The first advantage are "compile once run everywhere", as Java are compiled and distributed as bytecode. The second advantage are speed, JIT:ed code have the same speed as non-virtualized code even when strict security are enforced. The disadvantage are that only Bytecode programs can run, so you for example cannot run Windows or Linux inside the virtual machine.
If you are running another operating system like Windows or another Linux distribution - you are running an Hyperviser. KVM, Xen and VirtualBox are examples of Hypervisors. You can also run multiple instances of Linux with one shared kernel, known as OS-based virtualization or "Container". But a Container share the kernel and therefor you can only virtual machines with the OS you are running. The advantage with Containers it are more lightweight as you do not need to run multiple kernels on top of each other...
Hypervisor or virtual machine manager, is a program that allows multiple operating systems to share a single hardware host.
JVM or Java Virtual Machine interprets bytecode for a computers processor so that it can perform Java program instructions.
No JVM does not use hypervisor as it is not an virtual machine that runs an OS rather it is just a interpreter.
A host operating system manages different VMs using Hypervisor or virtual machine manager
Before answering your questions, I would recommend you search related entries in wikipedia. A hypervisor is used to run multiple guest OSes while JVM is used to interpret java byte code. JVM runs on top of OS and it doesn't care whether the OS runs on top of bare metal or on a hypervisor. Actually, linux can handle multiple guest operating systems with KVM which is part of the linux kernel. So the description of the last question is totally wrong.

Xen for office use and network boot

I'm trying to understand if Xen can fit my needs:
I need to have a Windows 7 image that I can copy to different machines (with different hardware) to have kind of default installation for every new entry in the office and faster replacement.
Is that possible to use the hypervisor for this?
Is that possible to use network boot as well of the hypervisor not to install Xen on every machine?
Edit: Will I be able tu use multiple displays?
Thanks.
It is possible if and only if you have installed Xen on every machine on your network that is not a good idea. Xen and other type-1 hypervisors are usually used to multiplex a high-end server into a set of virtual machines. Xen is also known for its para-virtualization technique which is not applicable for Windows.
Have you ever thought of VDI (Virtual Desktop Infrastructure) solutions? It enables you to have all your operating systems on a single machine and transfer the desktop to the clients.

Newbie Hypervisor Questions

If I install a bare-metal hypervisor (say, ESXi), would it allow me to run Windows 7 concurrently with Linux?
Would it allow me to run multiple instances of Windows 7?
When I'm sitting at the PC that's running Win7 and Linux on a hypervisor, which OS do I see when I look at the screen? (I'm suspecting that the only way to access either OS is to do a remote login.)
Assuming the answer to #2 is yes, how do you manage multiple installs of Win7 on the same hard drive?
Thanks in advance!
If you simply want to run Linux and Windows in parallel you may of course do this on e.g. ESXi. Still, the OSes would run with virtualized (or emulated) hardware available to them, i.e. you would not be able to easily access all the hardware directly and the hypervisor itself not only introduces an overhead but this overhead is not deterministic.
If you want to run an RTOS (like Real-Time Linux) or any other RTOS, then you need a "real-time hypervisor".
You can google for such hypervisors - there are a few out there.
(I dont want to recommend one here as we are a vendor of such a solution our selves)
Regards
GFL

running different versions of a kernel

Now the biggest disadvantage in running operating system virtualization is that the user is only able to run the same operating system on all virtualized instances. At least is it possible to run different versions of the same kernel ?
The kernel is in charge of managing and abstracting real resources (CPU, devices). So you cannot have several kernels at once on a machine.
What you might have is an hypervisor (which is a sort-of kernel), providing multiple virtual machines. On each of them, you would run a different kernel. You could for example use Xen as an hypervisor (and you could nest them).