Install an OpenVZ Server on CentOS

Install an OpenVZ Server on CentOS

Category : How-to

Get Social!

openvz-logo-150px_new_3OpenVZ servers are hypervisors which allow you to create numerous guest instances within a single hardware node. Unlike other products which offer full hardware virtualisation, OpenVZ creates containers – isolated program execution environments – that share the hardware nodes kernel.

OpenVZ works very differently to the more mainstream hypervisors like VMWare’s ESXI, KVM or Xen and therefore comes with some benefits as well as a few problems. In the benefit category, the big one is performance.  OpenVZ containers loose very little power from what is available on a bare metal machine. The big drawback is that an OpenVZ container can only run Linux guests because each guest is actually using the hardware nodes kernel.

OpenVZ recommends running an OpenVZ server on Red Hat Linux, or one of it’s derivitives such as CentOS. Before starting this tutorial, make sure that you have a freshly installed CentOS server with terminal access. For this example, I’m going to use a fresh install of CentOS 6.5.

There are three stages to the installation of the OpenVZ software; install the OpenVZ kernel, configure system parameters and install the OpenVZ tools.

Install the OpenVZ kernel

All of the packages required to install an OpenVZ server are available in a repository which needs to be added to yum. Once this is complete, you can use yum to install all of the OpenVZ packages, including the kernel. Using this method, we can also keep our packages up to date as future releases are made available by the OpenVZ team.

Download the OpenVZ repository details and add the GPG key which is used to sign each package.

We can now install the OpenVZ kernel by running the below command. Type y when prompted to begin the download and installation.

Configure system parameters

We need to configure various system parameters for OpenVZ to work, especially on the networking side.

Open up the sysctl.conf file.

Either add or amend the following settings.

OpenVZ needs SELinux to be disabled. Open up the selinux config file and make the SELINUX attribute disabled.

For example:

Install OpenVZ tools

Once the kernel is set up we need to install the OpenVZ tools for creating and managing an OpenVZ server.

You can now reboot your machine. When your machine starts up, make sure that the OpenVZ kernel is loaded with the uname -r command. The result should be similar to below, although the version numbers will change with time.

And that’s it! You now have an OpenVZ server up and running.


See Basic container management for details on creating your first CT.


NFS Mount Error on OEL

Category : How-to

Get Social!

oelI have been using an Oracle Enterprise Linux (OEL) OpenVZ container in Proxmox for installing some Oracle software. The easiest and least interfering way I have found is to mount an NFS share which contains the binaries directly to the container. See my NFS blog post for more information on setting up an OpenVZ container for NFS.

After the service and container was set up for NFS I tried to mount the NFS share. I received the below error after running the mount command.

This was because the rpcbind daemon was not running. Run the below command to start the rpcbind daemon.

The service will display that the daemon is now running.

You can set rpcbind to start automatically by adding it to the startup group.

Retry the mount command and your NFS share should be mounted.

You may need to check that you have the NFS client packages installed.

Visit our advertisers


Quick Poll

Do you use GlusterFS in your workplace?

Visit our advertisers