running different versions of a kernel - virtualization

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).

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.

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

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.

Are emulation and hardware-assisted virtualization synonyms?

What is the distinction between emulation and Full Virtualization, also called Hardware-assisted virtualizion (HVM)?
From this source, it is not clear what the relationship is.
Full Virtualization or Hardware-assisted virtualizion (HVM) uses
virtualization extensions from the host CPU to virtualize guests. HVM
requires Intel VT or AMD-V hardware extensions. The Xen Project
software uses Qemu to emulate PC hardware, including BIOS, IDE disk
controller, VGA graphic adapter, USB controller, network adapter etc.
Virtualization hardware extensions are used to boost performance of
the emulation. Fully virtualized guests do not require any kernel
support. This means that Windows operating systems can be used as a
Xen Project HVM guest. Fully virtualized guests are usually slower
than paravirtualized guests, because of the required emulation.
Source: Xen Project Wiki
In the following book these terms are considered synonymous.
At one extreme you have full virtualization, or emulation, in which
the virtual machine is a software simulation of hardware, real or
fictional — as long as there’s a driver, it doesn’t matter much.
Products in this category include VMware and QEMU.
Source: The book of Xen
Following are the excerpts from an article describing the actual difference between emulation and HWM. However, the only distinction I can see is, that virtualization enables to create more than one computing environment.
If emulation takes such a toll, why bother? Because we might want to
do one of the following:
Run an OS on a hardware platform for which it was not designed.
Run an application on a device other than the one it was developed for (e.g., run a Windows program on a Mac).
Read data that was written onto storage media by a device we no longer have or that no longer works.
Source: Russell Kay
Virtual machines offer the following advantages:
They're compatible with all Intel x86 computers.
They're isolated from one another, just as if they were physically separate.
Each is a complete, encapsulated computing environment.
They're essentially independent of the underlying hardware.
They're created using existing hardware.
Source: Russell Kay
There is another article, which only supports my hypothesis.
Emulation, in short, involves making one system imitate another. For
example, if a piece of software runs on system A and not on system B,
we make system B “emulate” the working of system A. The software then
runs on an emulation of system A.
In this same example, virtualization would involve taking system A and
splitting it into two servers, B and C.
So lets consider B=C and we have emulation, dont we?
Please note that virtualization is achieved by emulating the hardware components network adapters, USB, hard disk, CD drives etc in software. Thus emulation actually helps achieving virtualization.
Full virtualization is the technique of virtualization in which the guest OS runs unmodified, that is, the guest is not aware of whether it is running in a virtual machine environment or on a physical machine. Initially binary translation of the guest code was done in order to achieve full virtualization, but it wasn't good from performance perspective.
Para virtualization is a technique which requires modifications in the guest Operating System in order to gain better performance.
Hardware assisted virtualization is full virtualization technique as the guest Operating System runs unmodified. It is called hardware assisted because this type of virtualization utilizes virutalization specific extensions in host hardware like Intel-vtx, AMD-V etc. This technique not only offers full virtualization (guest OS does not require modification) but also has performance benefits and major vendors like Intel and AMD are providing extensions in hardware to support virtualization.

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.