Centos 6 x86_64 & OpenVZ Container Virtualization with OpenVZ Web Panel

Home » Computer Articles » Linux » Centos 6 x86_64 & OpenVZ Container Virtualization with OpenVZ Web Panel
June 26, 2012 Linux 2 Comments

OpenVZ container based Virtualization is easier on system resources compared to full virtualization. Performance seems much better than full virtualization. So here are the steps I took for the setup on Centos 6 X86_64.

 

1. Do a minimal Centos 6 x86_64 installation. Click here to download the minimal install ISO.

 

2. Do all the updates. 

# yum update

 

3. To install OpenVZ follow steps below: See instructions Here

# cd /etc/yum.repos.d

# wget http://download.openvz.org/openvz.repo

# rpm --import http://download.openvz.org/RPM-GPG-Key-OpenVZ

# yum install vzkernel.x86_64 Edit the openvz.repo file and make sure rhel 6 is enabled=1 and rhel 5 is enable=0

# yum install vzctl vzquota

# vi /etc/sysctl.conf and add information below:

net.ipv4.ip_forward = 1

net.ipv4.conf.default.proxy_arp = 0

net.ipv4.conf.all.rp_filter = 1

kernel.sysrq = 1

net.ipv4.conf.default.send_redirects = 1

net.ipv4.conf.all.send_redirects = 0

net.ipv4.icmp_echo_ignore_broadcasts=1

net.ipv4.conf.default.forwarding=1

# vi /etc/vz/vz.conf

Look for NEIGHBOUR_DEVS and change to NEIGHBOUR_DEVS=all

Disable selinux, # vi /etc/sysconfig/selinux and change to SELINUX=disabled

 

4. Restart the server

# reboot

 

5. Next we will install OpenVZ Web Panel and you can go to their website Here.

To install run command below, this same command can also be run to update OpenVZ.

# wget -O - http://ovz-web-panel.googlecode.com/svn/installer/ai.sh | sh

 This command will install all packages that you need.

 

6. To connect to OpenVZ, goto a browser and type in http://ipaddress:3000 login with username admin and password admin. 

 

7. Now lets try out Virtual Container, you will need to download a template. In the web interface click on the Physical Servers called localhost, then click on OS Templates, then click on Install New OS Template, choose the template you want to use and click install. Now that you have a template we can setup a virtual.

 

8. Click on Physical Servers localhost, click on Create virtual server, Server ID format is like 101, 102 etc. OK so let put Server ID as 101, choose the template you downloaded, give it a ipaddress, give it a hostname, set a password, in Additional Setting, set your DNS Server ipaddress. Click on Create

You know have setup your first Virtual Container. There is a couple of things we should do.

 

Time Setup on Client Servers

# rm /etc/localtime

# ln -s /usr/share/zoneinfo/US/Eastern /etc/localtime

Do you need to access the Virtual Container, you can use SSH ssh root@ipaddress or login with vzctl enter 101 from your host server. Most templates seem to have ssh and a web server running.
There is a lot of other things you can do of course so have fun.

 

## Problems

If you receive this error, this is what I did to fix it.

 

root@mysql ~]# yum update
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
Traceback (most recent call last):
File "/usr/bin/yum", line 29, in <module>
yummain.user_main(sys.argv[1:], exit_code=True)
File "/usr/share/yum-cli/yummain.py", line 276, in user_main
errcode = main(args)
File "/usr/share/yum-cli/yummain.py", line 129, in main
result, resultmsgs = base.doCommands()
File "/usr/share/yum-cli/cli.py", line 434, in doCommands
self._getTs(needTsRemove)
File "/usr/lib/python2.6/site-packages/yum/depsolve.py", line 99, in _getTs
self._getTsInfo(remove_only)
File "/usr/lib/python2.6/site-packages/yum/depsolve.py", line 110, in _getTsInfo
pkgSack = self.pkgSack
File "/usr/lib/python2.6/site-packages/yum/__init__.py", line 883, in <lambda>
pkgSack = property(fget=lambda self: self._getSacks(),
File "/usr/lib/python2.6/site-packages/yum/__init__.py", line 668, in _getSacks
self.repos.populateSack(which=repos)
File "/usr/lib/python2.6/site-packages/yum/repos.py", line 265, in populateSack
self.doSetup()
File "/usr/lib/python2.6/site-packages/yum/repos.py", line 92, in doSetup
self.ayum.plugins.run('postreposetup')
File "/usr/lib/python2.6/site-packages/yum/plugins.py", line 184, in run
func(conduitcls(self, self.base, conf, **kwargs))
File "/usr/lib/yum-plugins/fastestmirror.py", line 202, in postreposetup_hook
all_urls = FastestMirror(all_urls).get_mirrorlist()
File "/usr/lib/yum-plugins/fastestmirror.py", line 369, in get_mirrorlist
self._poll_mirrors()
File "/usr/lib/yum-plugins/fastestmirror.py", line 413, in _poll_mirrors
pollThread.start()
File "/usr/lib64/python2.6/threading.py", line 474, in start
_start_new_thread(self.__bootstrap, ())
thread.error: can't start new thread

 

 

# vi /etc/yum/pluginconf.d/fastestmirror.conf" and set enabled=0

# yum update 

 

Share This:

2 Replies to “Centos 6 x86_64 & OpenVZ Container Virtualization with OpenVZ Web Panel”

  1. tinyproxy-1.8.3]# /usr/local/sbin/tinyproxy -d tinyproxy: Could not open file /tmp/tinyproxy.log: Permission deenid tinyproxy: Could not open file /tmp/tinyproxy.pid: Permission deenid /usr/local/sbin/tinyproxy: Could not create PID file. [root@localhost tinyproxy-1.8.3]#doing netstat -l doesn't even list the concerned port no. Plz help out!

    1. Hi Marcus, usually the /tmp directory anyone can write too. If you check the permissions, "ls -l /" what do you see. should be something like this "drwxrwxrwt 7 root root 140 Jul 20 07:05 tmp"

      The the pid file the nobody user and nogroup needs to own the directory where the pid go's.

      I hope that helps you out.

      Darcy

Leave a Reply to Marcus Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.