TenForward

技術ブログ。はてなダイアリーから移転しました

debian 5.0 で OpenVZ

メモ.

# apt-get install linux-image-openvz-686
# ln -s /var/lib/vz /vz

/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

http://download.openvz.org/template/precreated/ から適当に Template を取得.これを /var/lib/vz/template/cache にコピー.

# cp debian-5.0-i386-minimal.tar.gz /var/lib/vz/template/cache

あとは適当に CT を作成.

# vzctl create 101 --ostemplate debian-5.0-i386-minimal --config vps.basic
# vzctl set 101 --ipadd 192.168.0.129 --nameserver 192.168.0.1 --hostname example --save
# vzctl set 101 --userpasswd root:password --save
# vzctl start 101

前述の所から取ってきた debian-5.0 なら ssh サーバ動いているので,上記で ssh アクセス可能.