i heared that both modules are used to create virtual environment for linux, but what are the comparisons between them which differentiate them could you please explain them in brief .
Xen is a thin hypervisor that takes control before the OS are loaded. On top of it runs your main Host OS, and possibly several Guest OS. The Host and Guest have to use a kernel specially built for Xen, and they can communicate using optimized techniques proper to Xen and run close to native speed.
Qemu is a full emulator, meaning the Guest sees "classical" virtual hardware (Qemu can also emulate other architectures than the one of the host), so the Guest does not have to be aware that it is being virtualized. On the other hand, it can be slower by a couple orders of magnitude than a native system.
KVM is an accelerator that allows Qemu-kvm to match speeds with Xen. It cannot run on any CPU, however; the CPU has to be "virtualisable". For x86-64, it means support for either Intel or AMD virtualization extensions (look at the contents of
/proc/cpuinfo and check for one of the flags,
svm for AMD or
vmx for intel)
KVM is probably easier to deploy (it does not require touching the Host system) if you have a compatible CPU.
- Xen: fast, runs anywhere, but requires custom OS kernel
- Qemu without kvm: runs anything anywhere, but slow
- Qemu-kvm: fast, doesn't require custom kernel, but runs only on specific CPUs