Ubuntu Jaunty domU under Debian Lenny Dom0

# configure domU
[ -z $DOMAIN_NAME ] && DOMAIN_NAME=jaunty
[ -z $DOMAIN_MAC ] && DOMAIN_MAC=00:00:00:00:aa:bb
[ -z $DOMAIN_RAM ] && DOMAIN_RAM=512Mb
[ -z $DOMAIN_HDD ] && DOMAIN_HDD=4Gb
 
# create vm
xen-create-image --hostname=${DOMAIN_NAME} --dhcp --mac=${DOMAIN_MAC} \
--lvm=vg01 --dist=jaunty --mirror=http://archive.ubuntu.com/ubuntu --size=${DOMAIN_HDD} --memory=${DOMAIN_RAM} --swap=${DOMAIN_RAM}
 
# rename vm config
mv /etc/xen/${DOMAIN_NAME}.cfg /etc/xen/${DOMAIN_NAME}
 
# post config domU
mount /dev/vg01/${DOMAIN_NAME}-disk /mnt/
# configure hvc0
sed -i 's|tty1|hvc0|g' /mnt/etc/event.d/tty1
# configure password
chroot /mnt/ sh -c "echo root:terceS | chpasswd"
# configure locale
chroot /mnt/ sh -c "locale-gen en_US.UTF-8"
echo LANG=en_US.UTF-8 >> /mnt/etc/environment
echo LC_ALL=C >> /mnt/etc/environment
umount /mnt
 
# start vm
xm create -c ${DOMAIN_NAME}
 
# post install in domU
passwd
apt-get update -qq
apt-get dist-upgrade -y