# Xen on OpenVZ

## adrin

This question is probably stupid  :Smile: , but is it possible to run a Xen-based virtual machine on OpenVZ gentoo host?

----------

## jormartr

 *adrin wrote:*   

> This question is probably stupid , but is it possible to run a Xen-based virtual machine on OpenVZ gentoo host?

 

Maybe it is posible (but I have not even tried to do it) to run a OpenVZ under a Xen host, but not what you explain.

----------

## TigerJr

 *adrin wrote:*   

> This question is probably stupid , but is it possible to run a Xen-based virtual machine on OpenVZ gentoo host?

 

It's not possible, XEN need Intel Virtualization Technology (VT-x) or AMD Virtualization (AMD-v) based on instruction of your CPU, and you can't install XEN kernel with CPU virtualization support on OpenVZ host.

----------

## linuxtuxhellsinki

 *TigerJr wrote:*   

>  *adrin wrote:*   This question is probably stupid , but is it possible to run a Xen-based virtual machine on OpenVZ gentoo host? 
> 
> It's not possible, XEN need Intel Virtualization Technology (VT-x) or AMD Virtualization (AMD-v) based on instruction of your CPU, and you can't install XEN kernel with CPU virtualization support on OpenVZ host.

 

No, XEN needs virtual extensions only for windows-guests and "paravirtualized" linux guests are running faster than hvm guests.

But I can't see any reason to use "double" virtualization layers XEN + OpenVZ, maybe just for testing or sth.  :Rolling Eyes: 

----------

## TigerJr

 *Quote:*   

> No, XEN needs virtual extensions only for windows-guests and "paravirtualized" linux guests are running faster than hvm guests. 
> 
> But I can't see any reason to use "double" virtualization layers XEN + OpenVZ, maybe just for testing or sth.

 

You can't use modern kernel with OpenVZ patchset!

OpenVZ Mainline http://wiki.openvz.org/Download/kernel/rhel5-testing/028stab108.1 but this kernel is based on 2.6.18 LTS kernel release and xen-virtualization are not supported in this kernel.

But if you try to use newer kernel version like feoktistov kernel those based on 2.6.32 kernel release (http://wiki.openvz.org/Download/kernel/2.6.32/2.6.32-feoktistov.1) you can face with unresolved bugs with OpenVZ because this kernel are frozen and not maintained, does not support ploop and not good with cgroups, for XEN support you need extra patches for these kernel release. But if you get troubles there is no one can help you.

http://en.wikipedia.org/wiki/Xen#Xen_in_Linux_distributions_and_Linux_upstream

```
[b]Version 3.0[/b] of the Linux kernel supports dom0 and domU in the mainline kernel
```

But Version 3.0 of the Linux kernel and newer doesn't not supported by OpenVZ.

So i think that trying to use XEN with OpenVZ it's a waste of time.

----------

## amospalla

OpenVZ runs containers, which uses the same kernel as host, think on them like a chroot on steroids.

Xen is a hypervisor (which runs a linux kernel), it has to be booted.

This way, you can not load Xen (neither other kind of operative system, like Linux, BSD or Windows) under OpenVZ. OpenVZ does not virtualize a computer like most virtualization solutions.

You could combine Xen and OpenVZ, one inside the other like these:

1) OpenVZ patched Linux kernel, running inside a Xen hypervisor. Not what you want.

2) Xen hypervisor running under Qemu, and this Qemu running inside an OpenVZ container (this qemu won't be able to use KVM, and Xen hypervisor under Qemu will be capable of start only paravirtualized guests). <- this will have quite bad performance (being nice), and has not much sense.

----------

## amospalla

The original question dates from 2 years ago...

----------

## TigerJr

 *amospalla wrote:*   

> OpenVZ runs containers, which uses the same kernel as host, think on them like a chroot on steroids.
> 
> Xen is a hypervisor (which runs a linux kernel), it has to be booted.
> 
> This way, you can not load Xen (neither other kind of operative system, like Linux, BSD or Windows) under OpenVZ. OpenVZ does not virtualize a computer like most virtualization solutions.
> ...

 

Did you try to run XEN under Qemu before answer?

----------

## amospalla

 *TigerJr wrote:*   

> Did you try to run XEN under Qemu before answer?

 

Not personally, but looked for some references like http://www.artificis.hu/2006/11/25/xen-on-qemu-on-xen or http://blog.mister-muffin.de/2011/11/21/xen-hypervisor-on-qemu-kvm-and-domu-nfs-boot-with-vde/. Please remember that Xen originally only worked with para-virtualized guests, and this mode does not need cpu virtualization extensions; hardware assisted virtualization came later. 

I read again my post, and regarding to point 2 (Xen inside Qemu, Qemu inside OpenVZ), you can pass /dev/kvm to the container running this Qemu, that way you could run Qemu with KVM support. Altough I have not tried this, I don't see why shouldn't work. It still keeps being a nice experiment, and is funny to talk about it, but does not seem quite practical.

----------

## TigerJr

 *amospalla wrote:*   

>  *TigerJr wrote:*   Did you try to run XEN under Qemu before answer? 
> 
> Not personally, but looked for some references like http://www.artificis.hu/2006/11/25/xen-on-qemu-on-xen or http://blog.mister-muffin.de/2011/11/21/xen-hypervisor-on-qemu-kvm-and-domu-nfs-boot-with-vde/. Please remember that Xen originally only worked with para-virtualized guests, and this mode does not need cpu virtualization extensions; hardware assisted virtualization came later. 
> 
> I read again my post, and regarding to point 2 (Xen inside Qemu, Qemu inside OpenVZ), you can pass /dev/kvm to the container running this Qemu, that way you could run Qemu with KVM support. Altough I have not tried this, I don't see why shouldn't work. It still keeps being a nice experiment, and is funny to talk about it, but does not seem quite practical.

 

Can you prove point 2 by yourself? Qemu inside OpenVZ you can faced with kernel problems && resource managements problems. But if you solve all the kernel problems(write somme patches) you'll get: performance problems with IO schedule overhead and perfomance impact for hypervisors and VMs.

And then, after all will be done, can you say what will be runing on these system? How you can use it???

Nice experiment but do you realy need it?

So if you didn't know works it on gentoo or not why you try to give an answer to people who, like you, didn't try to use it, or didn't know how to use it? 

How you can help them? With links to reference howto for debian linux?

I don't think that is a right way %)

----------

## amospalla

You obviously misunderstood my response if you think I am justifying the use of that nested virtualization path.

I would suggest you reading again my posts.

----------

## TigerJr

 *amospalla wrote:*   

> if you think I am justifying the use of that nested virtualization path.
> 
> 

 

I'm not think that, i tried to pass /dev/kvm into OpenVZ container and start qemu in container but i get to much IOPS, so i read your post with the links you give. But you didn't try that by yourself.

So interesting think to use OpenVZ container in Xen DomU but how to use your experiments that was confused me.

----------

## amospalla

Yea, that is why some of my comments are like "this could be nice to try", or "trying this could be a funny experiment". Nested paths that I remember right now, that I've tried, are qemu (pure qemu without kvm) under openvz, and openvz under qemu (with or without kvm).

I think the only technology which can be useful nested inside others are OpenVZ containers, but again, it is not a virtualization system, so it behaves correctly.

Talking about virtualization is funny   :Surprised: 

----------

