XEN install under Debian

# update repository
apt-get update
 
# install debian xen kernel
#apt-get install -y linux-image-xen-amd64 xen-tools
apt-get install -y xen-linux-system xen-tools
 
# OPTINAL: install qemu for HVM guests
#apt-get -y install qemu
apt-get install -y xen-qemu-dm-4.0
 
# configure grub to start xen kernel
mv /etc/grub.d/10_linux /etc/grub.d/25_linux
echo "GRUB_DISABLE_OS_PROBER=true" >> /etc/default/grub
update-grub
 
# OPTIONAL: configure memory for dom0
echo GRUB_CMDLINE_XEN="dom0_mem=1G" >> /etc/default/grub
sed -i 's|(enable-dom0-ballooning yes)|(enable-dom0-ballooning no)|g' /etc/xen/xend-config.sxp
update-grub
 
# configure network bridge
sed -i 's|# (network-script network-bridge)|(network-script network-bridge)|g' /etc/xen/xend-config.sxp
 
# dont save domU, just shutdown
sed -i 's|XENDOMAINS_SAVE=/var/lib/xen/save|XENDOMAINS_SAVE="" |g' /etc/default/xendomains
sed -i 's|XENDOMAINS_RESTORE=true|XENDOMAINS_RESTORE=false |g' /etc/default/xendomains
 
# create dir for domU autostart
[ -d /etc/xen/auto ] || mkdir /etc/xen/auto
 
# set more cpu time for dom0
sed -i '$ i\xm sched-credit -d Domain-0 -w 512' /etc/rc.local
 
# OPTIONA: sync time
apt-get install -y ntpdate
ntpdate ntp.ubuntu.com
hwclock --systohc
 
# OPTIONAL: updae bootstrap
http://www.panticz.de/update_debootstrap
 
# OPTIONAL: enable ip forward in dom0
cp /etc/sysctl.conf /etc/sysctl.conf.org
sed -i 's|#net.ipv4.ip_forward=1|net.ipv4.ip_forward=1|g' /etc/sysctl.conf
 
# reboot
reboot
 
 
### LINKS ###
http://wiki.debian.org/Xen
http://wiki.xensource.com/xenwiki/XenBestPractices
http://www.panticz.de/configure_network_bridge
http://www.panticz.de/update_debootstrap
http://www.chrisk.de/blog/2008/12/how-to-run-xen-in-ubuntu-intrepid-without-compiling-a-kernel-by-yourself/
http://wiki.debian.org/Xen
https://help.ubuntu.com/community/Xen

Do you like this page? Then support it. Please click the AD below and visit the sponsor. Thank you!