OpenVZ ~ Ubuntu kernel

I am fairly new to OpenVZ although I have played with it on Centos. I really like OpenVZ, it seems fairly straight forward and "containers" or guests are light weight and easy to deploy. Backups are much smaller the saving a 5 Gb VMWare disk ....

I have been waiting for OpenVZ to be ported to Ubuntu (I seem to spend a lot of time on Ubuntu).

Well, it is here and they have ported OpenVZ to current kernels


Previous kernels are broken :(

Bug report:

To use OpenVZ install linux-image-2.6.24-19-openvz from proposed:

I did not install more then the OpenVZ kernel + restricted modules (linux-restricted-modules) + headers (linux-headers) from proposed...

There is a nice wiki page specific to Ubuntu here:

The wiki page demonstrates how to make an Ubuntu template & covers host configuration as well as upstart in the guests.

So far I am running OpenVZ on a 64 bit host with no problems. I have not tested 32 bit hosts, but they are reported as working on Launchpad.

Next stop -> learning a little more about managing containers (back up, setting limits on memory / size, etc).


Management tip:

Either set an alias vzctl='sudo vzctl' or start a root shell with sudo -i


Networking Tip : No need for making a bridge on the host, just set an IP address with

vzctl set --ipaddress 192.168.1.xx -save

vzctl set --nameserver --save

viola, container now has private ip address and internet access.


Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
bodhi.zazen's picture

Thank you

As always Scott, thank you for the information.

Scott Dowdle's picture

OpenVZ and the 2.6.24 kernel?

Just wanted to mention, although I'm sure you are already aware bodhi, Proxmox VE is also shipping with a 2.6.24-based OpenVZ kernel. Proxmox VE supports both KVM and OpenVZ in the same kernel. kapt2k's blog posting on it got me interested so I decided to give it a try.

I have two machines in a cluster configuration and have been using the Proxmox VE web interface. You can monitor all machines in the cluster using the web interface provided by any of the cluster members. I've created a KVM-based Windows XP machine and an OpenVZ-based CentOS 5 container. So far as migration goes, I've only been able to migrate the OpenVZ container in offline mode (rather than the online mode that has almost no noticable downtime). I emailed the Proxmox VE mailing list and it appears there are some problems with live migration in their kernel.

The OpenVZ project currently has three kernel branches they have marked as stable: RHEL4-based 2.6.9, RHEL5-based 2.6.18, and vanilla 2.6.18. There have been a number of other kernels versions that were devel trees, several of which have died on the vine and been abandoned as newer kernel versions have come out. 2.6.24 is one such devel branch and it remains to be seen if it will ever be elevated to the status of stable. I'm glad to see Ubuntu adopting an OpenVZ kernel option but I'm not sure how much kernel work they are contributing to it.

The Parallels / OpenVZ folks are quite busy... maintaining three stable kernel branches, maintaining the Virtuozzo product, and working with the cgroup stake holders to get containers into the mainline kernel... and a devel branch or two. I'm not sure how much development work is going into 2.6.24. Given the fact that 2.6.25 has been released and 2.6.26 is around the corner (with rc6 having been released recently), my guess would be that the 2.6.24 OpenVZ kernel will be put to rest in the not too distant future unless the Ubuntu folks really want to maintain it. That is just a guess on my part though as I haven't connected to the OpenVZ git repo not even once.

That begs the question, what distro and kernel should one use for a stable OpenVZ deployment? My preference has been Red Hat Enterprise Linux (RHEL) or CentOS... specifically version 5 with the RHEL5-based OpenVZ kernel. That's kind of funny since it doesn't even appear that Red Hat knows what containers are and is so focused on Xen and KVM.

I can understand Proxmox VE being based on something greater than 2.6.20 (the first kernel with KVM support) but I think everyone else should use a 2.6.18-based kernel.

I know there are a number of distributions that have adopted an OpenVZ kernel flavor as an option. Gentoo, ALT Linux, Mandriva Corporate Server (I think) as well as a few others. I wonder what kernels they use?

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.