Install OpenVZ on debian

# find the documentation on http://wiki.openvz.org/Installation_on_Debian
Preparation, create folder to download the source

cd /root
mkdir OpenVZ
cd OpenVZ

Download the kernel support OpenVZ and prepare the repository

wget http://download.openvz.org/debian/dists/etch/main/binary-i386/base/linux-image-2.6.18-openvz-686_028.18.1-2.6.18-12-1_i386.deb

echo -e “\ndeb http://download.openvz.org/debian-systs etch openvz” >> /etc/apt/sources.list

wget -q http://download.openvz.org/debian-systs/dso_archiv_signing_key.asc -O- | apt-key add – && apt-get update

REF : http://download.openvz.org/debian/dists/etch/main/binary-i386/base/

# install

dpkg -i linux-image-2.6.18-openvz-686_028.18.1-2.6.18-12-1_i386.deb

Edit grub and make new kernel as default option

vi /boot/grub/menu.lst

Reboot the server

init 6

Install vzctl and vzquota tools

apt-get install vzctl vzquota

Modify sysctl.conf

vi /etc/sysctl.conf


[…]

# On Hardware Node we generally need
# packet forwarding enabled and proxy arp disabled

net.ipv4.conf.default.forwarding=1
net.ipv4.conf.default.proxy_arp = 0
net.ipv4.ip_forward=1

# Enables source route verification
net.ipv4.conf.all.rp_filter = 1

# Enables the magic-sysrq key
kernel.sysrq = 1

# TCP Explict Congestion Notification
#net.ipv4.tcp_ecn = 0

# we do not want all our interfaces to send redirects
net.ipv4.conf.default.send_redirects = 1
net.ipv4.conf.all.send_redirects = 0

[…]

sysctl -p

make link to /vz

ln -s /var/lib/vz /vz

Install template and necessary tools

apt-get install vzctl-ostmpl-debian-*
apt-get install vzprocps vzdump

Start openVZ

/etc/init.d/vz start

Link this file to allow auto start openVZ

ln -s /etc/init.d/vz /etc/rc2.d/S98vz

# Check cache / template

ls -lsa /vz/template/cache/
total 94536
4 drwxr-xr-x 2 root root     4096 2008-09-04 11:42 .
4 drwxr-xr-x 3 root root     4096 2008-09-03 16:36 ..
47432 -rw-r–r– 1 root root 48516759 2007-10-03 08:36 debian-4.0-i386-minimal.tar.gz
47096 -rw-r–r– 1 root root 48171486 2008-05-19 03:33 debian-5.0-i386-minimal.tar.gz

# This mean there are 2 OS template which is debian-4.0-i386-minimal and debian-5.0-i386-minimal
Create VPS

# vzctl help

vzctl –help

# create Guest OS

vzctl create 1001 \
–ostemplate debian-4.0-i386-minimal \
–hostname marshavm01.netdns.net \
–ipadd 192.168.0.104 \
–nameserver 192.168.0.1

# for editing VZ configuration,i.e edit the disk space

vzctl set 1002 \
–diskspace $(( 1048576*2 )):$(( 1153434*2 )) \
–save

# check VZquota

vzquota stat 1002

NOTE : 1002 is VEID => ID for each VPS created on Host OS. For your info,VEID start from 101.

# enter and manage your VPS from Host OS

vzctl enter 1002

~ oleh r420r pada September 5, 2008.

3 Tanggapan to “Install OpenVZ on debian”

  1. wah.. mas nya emank keren…
    tetep pake nama marsha.. :))

  2. weq… pake moderation…

  3. @ komen1
    Ya gimana ya… sempet mau ganti melissa siy :p
    @ komen2
    Dah ak apus tuh moderasinya😀

Tinggalkan Balasan

Isikan data di bawah atau klik salah satu ikon untuk log in:

Logo WordPress.com

You are commenting using your WordPress.com account. Logout / Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout / Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout / Ubah )

Foto Google+

You are commenting using your Google+ account. Logout / Ubah )

Connecting to %s

 
%d blogger menyukai ini: