Showing posts with label CentOS. Show all posts
Showing posts with label CentOS. Show all posts

Saturday, July 30, 2011

The 5 Minute Guide to Running OpenVZ on CentOS 6.x

As much as I like Debian (and the fact that it has OpenVZ kernels in the repos, for now...) CentOS is really the best distribution for running this container-based virtualization environment. This assumes a minimal CentOS 6.0 install.

1) Add the OpenVZ repos

See the Quick Installation guide and ensure that:
[root@opti330 yum.repos.d]# cat /etc/yum.repos.d/openvz.repo
[openvz-utils]
name=OpenVZ utilities
#baseurl=http://download.openvz.org/current/
mirrorlist=http://download.openvz.org/mirrors-current
enabled=1
gpgcheck=1
gpgkey=http://download.openvz.org/RPM-GPG-Key-OpenVZ

[openvz-kernel-rhel6]
name=OpenVZ RHEL6-based kernel
#baseurl=http://download.openvz.org/kernel/branches/rhel6-2.6.32/current/
mirrorlist=http://download.openvz.org/kernel/mirrors-rhel6-2.6.32
enabled=1
gpgcheck=1
gpgkey=http://download.openvz.org/RPM-GPG-Key-OpenVZ

2) Install the packages (after updating of course)

# yum install openvz-kernel-rhel6 vzctl vzquota bridge-utils


3) Update /etc/sysctl.conf
net.ipv4.ip_forward = 1
net.ipv4.conf.all.proxy_arp = 1

This ARP proxying is really only needed if you are doing veth networking (the default we'll use below)

4) Reboot

You kernel should now be:
[root@opti330 yum.repos.d]# uname -a
Linux opti330 2.6.32-042stab024.1 #1 SMP Tue Jul 26 15:23:12 MSD 2011 x86_64 x86_64 x86_64 GNU/Linux

5) Update /etc/sysconfig/iptables to allow traffic to/from venet0 (only if you are using venet)

-A FORWARD -i venet0 -o eth0 -j ACCEPT
-A FORWARD -i eth0 -o venet0 -j ACCEPT



Or something close. You will also want to update your iptables policy or disable it or disable it.

6) Now you can create your VE's per the instructions on my OpenVZ Wiki Page.

Saturday, January 03, 2009

start-stop-daemon on CentOS/RHEL5 (and probably other RedHat derivatives)

Some packages depend on the start-stop-daemon command which is not available in CentOS (or the dag repositories, AFAIK) but the solution is to pull down the source for dpkg and compile it. Basically do a ./configure at the top level of the package and then do a make, make install the utils directory


[root@moodle_dev utils]# make
gcc -std=gnu99 -g -O2 -Wl,-O1 -o start-stop-daemon start-stop-daemon.o ../get
opt/libopt.a
[root@moodle_dev utils]# ls
enoent enoent.o Makefile.am start-stop-daemon start-stop-daemon.o
enoent.c Makefile Makefile.in start-stop-daemon.c
[root@moodle_dev utils]# make install
make[1]: Entering directory `/root/dpkg-1.13.26/utils'
test -z "/usr/local/lib/dpkg" || mkdir -p -- "/usr/local/lib/dpkg"
/usr/bin/install -c 'enoent' '/usr/local/lib/dpkg/enoent'
test -z "/usr/local/sbin" || mkdir -p -- "/usr/local/sbin"
/usr/bin/install -c 'start-stop-daemon' '/usr/local/sbin/start-stop-daemon'
make[1]: Nothing to be done for `install-data-am'.
make[1]: Leaving directory `/root/dpkg-1.13.26/utils'

Tuesday, July 29, 2008

CentOS 4/5 VMWare Guests

I pretty much will do anything to avoid running RHEL/CentOS on bare metal, but on guests it isn't so bad, because sometimes you have to choice:


Install and Configure VMWare Tools

# yum update
# yum install gcc
# yum install kernel-devel
# reboot
# vmware-config-tools.pl


Enable Time SYNC (you don't need X)

In your .vmx file (on the host obviously)

tools.syncTime = "TRUE"

Monday, March 17, 2008

Easy CentoOS 4.6 Network Installation

With a few exceptions (having to use Cisco Enterprise Linux for a project or two, and few torrid affairs with SuSE) ever since about 2001, I've been mostly faithly to Debian-based distributions. One of the things that has bothered me about RPM distros is the network installs, or lack thereof. Sure you can do it (I did on an old-world PPC Mac using YellowDog Linux) but it is not as straightforward as Debian network installs.

For me the only reason you'd use and infererior RedHat-based distros is if you had commercial products that required RHEL. Well now im in that situation, so CentOS 4.6 it is, and its not as hard as I thought.

  1. Find the boot.iso on one of the mirrors (it should be located in centos/4/os/i386/images/) I used http://isoredirect.centos.org/centos/4/os/i386/images/boot.iso
  2. Choose text linux at the boot loader
  3. Select HTTP install
  4. For the IP address enter the name of your mirror (I used isoredirect.centos.org) and the path (/centos/4/os/i386/) and it should find everything you need
That's it...