Page Actions
Wiki Actions
User Actions
Submit This Story

kvm-preparations

# get the CentOS-5.4-i386-bin-DVD.iso, place it at /mnt/lv_public/isos/
apt-get install kvm # install kvm
modprobe kvm_amd
mkdir -p /mnt/lv_public/kvm/images

# the most simple kvm-networking with bridges and tap-interfaces does _not_ work for me. It
# doesnt allow tftp-filetransfers from one VM to an other. Use VDE instead.

apt-get install vde2
vde_switch -tap tap0 -d                    # starts our switch
ifconfig tap0 10.0.22.1 netmask 0xffffff00 # configures our interface

# enable natting from the virtualized network onto lan/intranet
iptables -A POSTROUTING -t nat -s 10.0.22.0/24 -j MASQUERADE
echo 'net.ipv4.conf.all.forwarding=1' >>/etc/sysctl.conf
sysctl -p

other preparations on the host-linux

# lets make a copy of the installation repo for easy access
mkdir -p /mnt/fed10 /mnt/lv_public/nfsshare
mount -o loop /mnt/lv_public/isos/CentOS-5.4-i386-bin-DVD.iso /mnt/centos

# lets export the distro from host-linux
apt-get install nfs-kernel-server
echo '/mnt/centos 10.0.22.0/24(async,rw,no_subtree_check,no_root_squash)' >>/etc/exports

# lets export the distro via http from the host-linux
apt-get install apache2
cat >/etc/apache2/conf.d/centos <<EOT
Alias /centos /mnt/centos
<Directory /mnt/centos>
  Options Indexes FollowSymLinks
  AllowOverride Limit Options FileInfo
</Directory>
EOT
/etc/init.d/apache2 restart

# now access to http://10.0.22.1/centos presents the distro-contents
 
cobbler/kvmsetup.txt · Last modified: 2010/12/05 11:50 by chris     Back to top