Slc-rootfs

Modificaciones al rootfs de SL3 para Xen
Download SLC3 image from http://project-xen.web.cern.ch/project-xen/xen/img/img.xml.

Copy the original rootfs image to a new file, mount it and chroot to it:

cp slc3_root_04.img slc3_root_04.img-v1 mount -o loop slc3_root_04.img-v1 /mnt/ chroot /mnt/

Create /mnt/vnuml directory and umlboot link:

mkdir /mnt/vnuml ln -s /mnt/vnuml/umlboot /etc/rc.d/rc3.d/S11bootuml

Edit /etc/fstab and include:

/dev/ubda / ext3 defaults 0 1 /dev/ubdb /mnt/vnuml iso9660 defaults 0 0

and comment entries about /dev/sda1 and /dev/hda5.

Edit /etc/defaults/ssh and add:

SSHD_OPTS=-u0

Create the /dev/ubd[a-h] nodes using the makeUBDdev.sh script (from http://www.theshore.net/~caker/uml/)

vi /tmp/makeUBDdev.sh (see the complete script below) chmod +x /tmp/makeUBDdev.sh cd /dev/ /tmp/makeUBDdev.sh

Edit /etc/inittab and create a new tty entry:

0:2345:respawn:/sbin/mingetty tty0

also comment tty3-6 entries.

Edit /mnt/etc/ssh/sshd_config to allow root access through ssh:

PermitRootLogin yes

Change root password (set it to "xxxx"):

passwd

Exit form chroot and install kernel modules:

exit cd /mnt/lib/modules/ tar xfv /usr/local/share/vnuml/kernels/src/linux-2.6.16.27-bs2-xt-1m/modules-2.6.16.27-bs2-xt-1m.tar

Unmount the filesystem:

umount /mnt

Create a test scenario slc3.xml:

1.7    sl3     /usr/local/share/vnuml/filesystems/slc3_root_04.img-v1 /usr/local/share/vnuml/kernels/linux xterm 

200M 

and test it:

vnumlparser.pl -t sl3.xml -v -u root -Z -w 120

Access the host via slogin (root access from the xterm does not work):

slogin host1 -l root

Updating the filesystem
To be able to update the filesystem from the network, you can use a virtual virtual scenario with network connectivity using a NAT in the host.

Copy this scenario to a file named slc3n.xml:

 <!DOCTYPE vnuml SYSTEM "/usr/share/xml/vnuml/vnuml.dtd">

1.7    slc3n /root/.ssh/identity.pub   xterm 

<net name="Net0" mode="uml_switch"/>

/usr/local/share/vnuml/filesystems/slc3_root_04.img-v1 256M /usr/share/vnuml/kernels/linux <if id="1" net="Net0"> <ipv4 mask="255.255.255.0">192.168.1.2 </if> <route type="ipv4" gw="192.168.1.1">default </vm>

<hostif net="Net0"> <ipv4 mask="255.255.255.0">192.168.1.1


 * On the host execute the following commands (eth0 is the name of the network interface with Internet connectivity):

iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE echo 1 > /proc/sys/net/ipv4/ip_forward


 * Start the scenario:

vnumlparser.pl -t slc3n.xml -v -u root -Z -w 120


 * Login to the virtual machine and check network connectivity (you'll have to configure a dns server in /etc/resolv.conf).

Notes:

chkconfig --off servicename

makeUBDdev.sh script
device=ubd major=98 minor=0 for u in a b c d e f g h        do dev=$device$u mknod $dev b $major $minor chmod 660 $dev chgrp disk $dev for i in $(seq 1 15) do                 mknod $dev$i b $major $(($minor + $i)) chmod 660 $dev$i chgrp disk $dev$i done minor=$(($minor + 16)) done
 * 1) !/bin/bash