Welcome to http://www.marssoft.de/
 
Tuesday, 11th December 2018 21:37:09 (GMT+1) 

Xen Server

Install the right kernel:

sudo aptitude install ubuntu-xen-server
mkdir /tmp/kernel
cd /tmp/kernel
wget http://ftp.ch.debian.org/debian/pool/main/l/linux-2.6/linux-modules-2.6.26-2-xen-amd64_2.6.26-15_amd64.deb
wget http://ftp.ch.debian.org/debian/pool/main/l/linux-2.6/linux-image-2.6.26-2-xen-amd64_2.6.26-15_amd64.deb
sudo dpkg -i linux-modules-2.6.26-2-xen-amd64_2.6.26-15_amd64.deb
sudo dpkg -i linux-image-2.6.26-2-xen-amd64_2.6.26-15_amd64.deb
shutdown -r now

Check if Xen is running:

uname -a
# Linux aldebaran 2.6.26-2-xen-amd64 #1 SMP Fri Mar 27 07:12:15 UTC 2009 x86_64 GNU/Linux
xend --help
# -bash: /usr/sbin/xend: /usr/bin/python2.5: bad interpreter: No such file or directory
sudo aptitude install python2.5
sudo xend start

Nice, a running Xen system in 25 minutes.

grep 'netloop' /etc/modules >/dev/zero || echo "netloop" | sudo tee -a /etc/modules
grep 'max_loop=64' /etc/modules >/dev/zero || sudo perl -pi -e 's/^loop$/loop max_loop=64/g' /etc/modules
sudo nano /etc/xen/xend-config.sxp
# disable:
# (network-script network-bridge)
# (vif-script vif-bridge)
# enable:
# (network-script 'network-route netdev=eth0')
# (vif-script vif-route)
sudo /etc/init.d/xend restart
<code>

Partition and format:
<code>
sudo swapoff /dev/md1
sudo mdadm --stop /dev/md1
sudo fdisk /dev/sda
sudo fdisk /dev/sdb
# type 2 82
sudo sfdisk -d /dev/sda|sudo sfdisk --no-reread -D -L /dev/sdb
sudo mkswap /dev/sda2
sudo mkswap /dev/sdb2
sudo update-initramfs -k all -u
sudo shutdown -r now

sudo mdadm /dev/md0 --fail /dev/sdb1
sudo mdadm /dev/md0 --remove /dev/sdb1
sudo mdadm /dev/md1 --fail /dev/sdb3
sudo mdadm /dev/md1 --remove /dev/sdb3

sudo mdadm /dev/md0 --add /dev/sdb1
sudo mdadm /dev/md1 --add /dev/sdb3


sudo mdadm --create /dev/md2 --level=1 --raid-devices=2 /dev/sd[ab]5
sudo mdadm --create /dev/md3 --level=1 --raid-devices=2 /dev/sd[ab]7
sudo mdadm --create /dev/md4 --level=1 --raid-devices=2 /dev/sd[ab]8
sudo mkswap /dev/sda6
sudo mkswap /dev/sdb6
sudo mke2fs /dev/md2
sudo mke2fs -j /dev/md3
sudo mke2fs /dev/md4

sudo mv -vi /etc/mdadm/mdadm.conf /etc/mdadm/mdadm.conf.bak
echo 'DEVICE /dev/sda* /dev/sdb*' |sudo tee -a /etc/mdadm/mdadm.conf
sudo mdadm --detail --scan |sudo tee -a /etc/mdadm/mdadm.conf

Install Ubuntu

sudo mkdir /mnt/fabelwerk
sudo mount /dev/md3 /mnt/fabelwerk
sudo mkdir -p /mnt/fabelwerk/tmp \
  /mnt/fabelwerk/boot \
  /mnt/fabelwerk/dev \
  /mnt/fabelwerk/proc \
  /mnt/fabelwerk/sys
sudo mount /dev/md4 /mnt/fabelwerk/tmp
sudo cp -pr admin bin cdrom etc home lib \
  lib32 lib64 media opt root sbin selinux \
  srv/ usr var /mnt/fabelwerk/
sudo nano /mnt/fabelwerk/etc/hostname 
sudo nano /mnt/fabelwerk/etc/network/interfaces 
sudo nano /mnt/fabelwerk/etc/fstab 
sudo mv -vi /etc/mdadm/mdadm.conf /etc/mdadm/mdadm.conf.bak
sudo umount /mnt/fabelwerk/tmp
sudo umount /mnt/fabelwerk

Adding networks and a virtual machine:

ip addr show dev eth0
ip addr add 188.40.40.240/64 dev eth0

echo "up ip addr add 188.40.40.240/64 dev eth0"|sudo tee -a /etc/network/interfaces

Create a new xen image

sudo mkdir -p /etc/xen/domUs
sudo nano /etc/xen/domUs/fabelwerk.cfg

Where /etc/xen/domUs/fabelwerk.cfg contains:

kernel = "/boot/vmlinuz-2.6.26-2-xen-amd64"
ramdisk = "/boot/initrd.img-2.6.26-2-xen-amd64"
memory = 1024
name = "fabelwerk"
disk = [ 'phy:/dev/sda6,sda1,w', 'phy:/dev/sdb6,sdb1,w', 'phy:/dev/md3,sda2,w', 'phy:/dev/md4,sda3,w' ]
root = "/dev/sda2 ro"
vcpus = 1
vif = [ 'ip=188.40.40.241' ]
on_poweroff = 'destroy'
on_reboot = 'restart'
on_crash = 'restart'
sudo xm list
sudo xm create -c /etc/xen/domUs/fabelwerk.cfg
sudo xm create /etc/xen/domUs/fabelwerk.cfg
sudo xm list
sudo xm console fabelwerk

sudo xm shutdown fabelwerk
sudo xm destroy fabelwerk
sudo xm help
internal/xen_server.txt · Last modified: 2014/04/02 22:39 (external edit)