Install OpenVZ on Ubuntu10.04

Source: Internet
Author: User
As a representative of system-level virtualization, OpenVZ has good performance. On Wikipedia, OpenVZ is an operating system virtualization technology based on Linux kernel and operating system. OpenVZ allows physical servers to run multiple operating systems, such as virtual private servers (VPS, VirtualPrivateServer) or virtual environments (VE, VirtualEnvironment ). Compared with VMware and Xen semi-Virtualization Technologies, OpenVZ, as a representative of system-level virtualization, has good performance. Wikipedia has the following introduction:

OpenVZ is an operating system virtualization technology based on Linux kernel and operating system. OpenVZ allows the physical Server to run multiple operating systems, such as Virtual Private Server (VPS) or Virtual Environment (VE, Virtual Environment ).
Compared with the semi-virtualization technology such as VMware and Xen, the host OS and guest OS of OpenVZ must both be Linux (although different Linux distributions can be used in different virtual environments ). However, OpenVZ claims to have a performance advantage. According to the OpenVZ website, using OpenVZ has a performance loss of 1-3% compared with using an independent server.
OpenVZ is the foundation of mongoozzo, a proprietary software developed by SWsoft and Inc. OpenVZ authorization is GPLv2.
OpenVZ consists of two parts: a modified operating system core and user tools.

However, Ubuntu has no support for OpenVZ since 8.04, so you still need to compile and install it yourself. But this is done before Xen. Therefore, we still follow the steps above 10.04.

Install necessary compilation tools

Install the required compilation tools

  1. $ Sudo apt-get install build-essential kernel-package libncurses5-dev fakeroot wget bzip2 module-assistant debhelper git-core git-buildpackage automake autoconf libtool liblockfile-simple-perl cstream liblog-agent-perl ssl-cert exim4
  2. $ Sudo apt-get build-dep linux-image-2.6.32-22-server
  3. $ Sudo m-a prepare

Modify the kernel-package to the number of CPU cores in your computer.

  1. $ Sudo kernel-packageconfig
  2. CoresNumber = $ (ArgumentsNumber () {echo $ #;}; ArgumentsNumber $ (grep "processor"/proc/cpuinfo | cut-f2-d ":"))
  3. $ Echo "CONCURRENCY_LEVEL: = $ CoresNumber" | sudo tee-a/etc/kernel-pkg.conf

Compile the kernel

Download and patch the kernel with OpenVZ

  1. $ Cd/usr/src
  2. $ Sudo wget http://archive.ubuntu.com/ubuntu/pool/main/l/linux/linux_2.6.32.orig.tar.gz
  3. $ Sudo wget http://download.openvz.org/kernel/branches/2.6.32/2.6.32-dyomin.1/patches/patch-dyomin.1-combined.gz

If you are using X86, that is, a 32-bit environment, download from here

  1. $ Sudo wget http://download.openvz.org/kernel/branches/2.6.32/2.6.32-dyomin.1/configs/kernel-2.6.32-i686.config.ovz

If you are using X86 PAE, Which is 32-bit and supports large memory, [Linux community www.Linuxidc.com] download from here

  1. $ Sudo wget http://download.openvz.org/kernel/branches/2.6.32/2.6.32-dyomin.1/configs/kernel-2.6.32-i686-PAE.config.ovz

If you are using a X86-64, that is, a 64-bit environment, then

  1. $ Sudo wget http://download.openvz.org/kernel/branches/2.6.32/2.6.32-dyomin.1/configs/kernel-2.6.32-x86_64.config.ovz

After selecting the correct official configuration, you can start preparing to compile the kernel.

  1. $ Sudo tar-xpf linux_2.6.32.orig.tar.gz
  2. $ Sudo mv linux-2.6.32 linux-2.6.32-openvz
  3. $ Sudo rm linux
  4. $ Sudo ln-s linux-2.6.32-openvz linux
  5. $ Cd linux
  6. $ Sudo gunzip-dc./patch-dyomin.1-combined.gz | sudo patch-p1
  7. $ Sudo cp-rf ../kernel-2.6.32-[your_platform]. config. ovz. config
  8. $ Sudo make oldconfig

Some problems may occur, such

Cc-m32-Wall-Wmissing-declarations-Wmissing-prototypes-O3-I .. /.. /include-I .. /.. /arch/x86/include-U_FORTIFY_SOURCE lguest. c-o lguest
Lguest. c: 21: 25: error: sys/eventfd. h: No such file or directory
Lguest. c: 37: 18: error: zlib. h: No such file or directory

If you encounter this problem, modify

  1. All: lguest
  2. Clean:

Is

  1. All:
  2. Clean:

Install the kernel package

  1. $ Cd ..
  2. $ Ls-l *. deb
  3. $ Sudo dpkg-I linux-image-2.6.32.22-ovz32_1.0_amd64.deb
  4. $ Sudo dpkg-I linux-headers-2.6.32.22-ovz32_1.0_amd64.deb

At this point, the configuration and installation of OpenVZ are basically completed. The following creates initramfs

  1. $ Sudo mkinitramfs-k 2.6.32.22-ovz32-o/boot/initrd. img-2.6.32.22-ovz32
  2. $ Sudo update-grub

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.