Create XEN VirtualBox Domain

#!/bin/bash

# filename: createXenImageVirtualbox.sh

# !!! Warning !!!
# This script are currently under development and not full testet yet!

# create ltsp image
xen-create-image --hostname=vb --ip=192.168.1.203 --gateway=192.168.1.5 --netmask=255.255.255.0 --dir=/home/xen --dist=gutsy --mirror=http://archive.ubuntu.com/ubuntu/ --size=4Gb --memory=512Mb -swap=1Gb

mount /home/xen/domains/vb/disk.img /mnt -o loop
mv /mnt/etc/network/interfaces /mnt/etc/network/interfaces.org
sed 's|# post-up ethtool -K eth0 tx off|post-up ethtool -K eth0 tx off|g' /mnt/etc/network/interfaces.org > /mnt/etc/network/interfaces
umount /mnt/

# configure vm
cp /etc/xen/vb.cfg /etc/xen/vb.cfg.org
cat <> /etc/xen/vb.cfg
extra='xencons=tty'
vif=['bridge=xenbr0,mac=00:00:00:00:00:eb']
EOF

# rename mv config
mv /etc/xen/vb.cfg /etc/xen/vb

# start vm
xm create vb -c

## on client
apt-get update
apt-get -y dist-upgrade
apt-get install build-essential wget

apt-get install linux-headers-`uname -r`

### http://www.oracle.com/technology/tech/linux/install/xe-on-kubuntu.html

dom0 ????
mv /lib/tls /lib/tls.disabled

rm /mnt/etc/init.d/hwclockfirst.sh
rm /mnt/etc/init.d/hwclock.sh
rm /mnt/etc/rc0.d/K25hwclock.sh
rm /mnt/etc/rc6.d/K25hwclock.sh
rm /mnt/etc/rcS.d/S11hwclock.sh
rm /mnt/etc/rcS.d/S08hwclockfirst.sh

Disabled Privacy Extensions