Installing OpenVZ on Linux Ubuntu 8.04

March 4th, 2010 by Tweet Leave a reply »

 Installing OpenVZ on Linux Ubuntu 8.04At this opportunity I would like to share with you how to install OpenVZ on linux ubuntu 8.04 LTS (Hardy Heron) Server Edition 64bit. Incidentally yesterday given the task of installing this software on IBM X3250 M2 server with support by quad-core Xeon processors and 8GB memory. Obviously this will be an excellent test of fun is not it?.

Because I am familiar with Centos 5.x environment so I had to slightly adjust the debian environment. If the CentOS before we make our OpenVZ installation should disable SELinux right, then in ubuntu we have to stop Apparmor. But from some references, not all features in apparmor off, quite a few have and I will explain later.

Preparation

Make sure you have an Internet connection pretty good and stable, because it will install some openvz package – support package with a fairly large size. Second, prepare a guide book, openvyz guide, ubuntu guide and a cup of cold drink.

Now, please follow the instructions below and good-virtualization.

Update …. Update!!

If you’ve just installed Ubuntu OS, is a good idea to update the kernel and the package is needed. Simply type the following command:

# apt-get update

Let until you finish the Ubuntu updates.

Disable Apparmor

As I said earlier, is a security apparmor extension (like SELinux) which provides additional security. Of several references I read, some say if apparmor is still in running status, it will cause some problems on openvz service. But when trying to stop the service apparmor, I do not experience problems associated with OpenVZ. Just as a precaution, you can turn off or even remove apparmor from the system. How, see the command below:

# /etc/init.d/apparmor stop <- to stop apparmor

or you can also remove apparmor with the command:

# Apt-get remove-purge-auto-remove apparmor <- this command will remove all the packages – packages automatically turned off apparmor and apparmor function

For this article, I just stopped apparmor for a while.
OpenVZ Packages Instalation

Next is the installation process and some openvz user toolnya.

# Apt-get install linux-openvz vzctl

Editing GRUB (Boot Loader)

At the time of the download and installation process is complete, then you will be required to confirm whether to continue or not. Before you continue, please look at the package linux-image, note the version of the kernel. because it is very useful to edit the grub (boot loader file) later on.

After the download and installation is complete, if there is no problem, then you will be asked how you will update the files GRUB (Boot Loader) you. This should be done automatically on during the installation process, if not first you have to do is look at the difference between the original files with new files.


Copy the contents of the new GRUB files in notepad to watch – watch if at the GRUB installation is not updated with the openvz kernel.

Now the option to update the GRUB, I suggest you choose option 3 way merge, because yesterday when trying to select the Install The Maintainer’s Version and Keep the local version, the GRUB was not changed at all. If you are experiencing the same thing, do not panic, there are 2 ways to update the grub. First by typing the following command:

# Update-grub

After the update process is complete, check back your GRUB files by:

# Vim/boot/grub/menu.lst

Should be on file already exists Additional OpenVZ kernel from the example below:

title Ubuntu 8.04, kernel 2.6.24-16-server
uuid a384f789-7b8b-4464-8340-f5fcc73ecc5b
kernel /boot/vmlinuz-2.6.24-16-server root=UUID=a384f789-7b8b-4464-8340-f5fcc73ecc5b ro quiet splash
initrd /boot/initrd.img-2.6.24-16-server
quiet

title Ubuntu 8.04, kernel 2.6.24-16-server (recovery mode)
uuid a384f789-7b8b-4464-8340-f5fcc73ecc5b
kernel /boot/vmlinuz-2.6.24-16-server root=UUID=a384f789-7b8b-4464-8340-f5fcc73ecc5b ro single
initrd /boot/initrd.img-2.6.24-16-server

title Ubuntu 8.04, linux-image-2.6.24-27-openvz
uuid a3f4f989-7b8b-4874-8220-f5fcc73efec00
kernel /boot/vmlinuz-2.6.24-27-openvz root=UUID=a3f4f989-7b8b-4874-8220-f5fcc73efec00 ro quiet splash
initrd /boot/initrd.img-2.6.24-27-openvz
quiet

title Ubuntu 8.04, memtest86+
uuid a384f789-7b8b-4464-8340-f5fcc73ecc5b
kernel /boot/memtest86+.bin
quiet

If in menu.lst you already have the openvz kernel, then you just change the default value to 2 (default 0 to default 2). Why 2? 2 is the index (starting from 0) of the title in the menu.lst, where the index into the two is the kernel with version 2.6.24-27-openvz and to openvz running, then we have to boot the kernel.

The second way is to do a copy from notepad (which is our previous contents) and then Paste it into menu.lst. Enough just to loadernya information only, not to all. Then close and save the GRUB file.

Reboot!

After editing and updating process is complete, reboot your server in order to get into the new kernel

# Reboot

If there are no problems with GRUB, then you can see the version of your new kernel.

# Uname-r
2.6.24-27-openvz

To verify whether the OpenVZ is running, you live to see their status

# /Etc/init.d/vz status

If the status is running, it has been successfully installed OpenVZ on Ubuntu 8.04 LTS you.

Configuring Kernel Parameters

Open the sysctl.conf file and look for the word – the word below and adjust the value

# Vim/etc/sysctl.conf

net.ipv4.conf.default.forwarding = 1
net.ipv4.conf.default.proxy_arp = 0
net.ipv4.ip_forward = 1
net.ipv4.conf.all.rp_filter = 1
kernel.sysrq = 1
net.ipv4.conf.default.send_redirects = 1
net.ipv4.conf.all.send_redirects = 0

Save and close, then you can reboot again. The next step is to edit the configuration file OpenVZ. The goal is, if your VPS is different subnet / group of IP addresses the host server networking on your VPS will remain the road.

# Vim/etc/vz/vz.conf

Then change the value to all NEIGHBOUR_DEVS

NEIGHBOUR_DEVS = all

This is the final process if you do not experience problems during the installation process, and you should reboot your server again. For the next article I will discuss how to create packages – VPS packages with Ubuntu 8.04 LTS and OpenVZ.

Releated Post

Sign up for Twitteling news sent to your inbox

Comments are closed.