#You need processor with hardware virtualization!

egrep '(vmx|svm)' --color=always /proc/cpuinfo


#install debian etch
#Add backport repository

echo "deb http://www.backports.org/debian etch-backports main contrib non-free" >> /etc/apt/sources.list
#get key for validating all packages in this repository
wget -O - http://backports.org/debian/archive.key | apt-key add -

#install KVM:
apt-get install kvm bridge-utils qemu qemu-source

#Modify network config
vi /etc/network/interfaces
#From:
iface eth0 inet dhcp
#To:
auto br0
iface br0 inet dhcp
bridge_ports eth0
bridge_maxwait 0

#Tell qemu to use the bridge:
vi /etc/qemu-ifup
-------
#!/bin/sh
echo "Executing /etc/qemu-ifup"
echo "Bringing up $1 for bridged mode..."
sudo /sbin/ifconfig $1 0.0.0.0 promisc up
echo "Adding $1 to br0..."
sudo /usr/sbin/brctl addif br0 $1
sleep 2
-------

#You need to add the user accounts that will run kvm to this group 
adduser [username] kvm

#Create disk image for guest
#Either use image files: qemu-img create -f qcow2 hd_image_name.img 4G
#Or use LVM (faster)

lvcreate --name test --size 4G KvmVG

#Let's install debian etch guest
kvm -hda /dev/KvmVG/test -cdrom /archive/iso/linux/debian/debian-40r1-amd64-netinst.iso -boot d -m 384
