FreeS/WAN User-Mode-Linux testing guide
Keywords: Linux, IPsec, VPN, security, FreeSWAN, testing, User-Mode-Linux, UML

# User-Mode-Linux Testing guide

User mode linux is a way to compile a linux kernel such that it can run as a process in another linux system (potentially as a *BSD or Windows process later). See http://user-mode-linux.sourceforge.net/

You'll need about 500Mb of disk space for a full sunrise-east-west-sunset setup. You can possibly get this down by 130Mb if you remove the sunrise/sunset kernel build. If you just want to run, then you can even remove the east/west kernel build.

1. Get the following files:
   - from http://www.sandelman.ottawa.on.ca/freeswan/uml/
     - umlfreeroot-6.0.tar.gz (or highest numbered one). This is a debian potato root file system. You can use this even on a Redhat host, as it has the newer GLIBC2.2 libraries as well.
     - From ftp://ftp.xs4all.nl/pub/crypto/freeswan/ a snapshot or release (1.92 or better)
     - From http://linux.kernel.org mirror, the virgin 2.4.17 kernel. (if you get a future kernel, then please report success/failure. AC kernels already have UML patched, so use /dev/null for the patch below)
     - Get http://ftp.nl.linux.org/uml/ uml-patch-2.4.17-4.bz2 or the one associated with your kernel. If you use an AC kernel, then subsitute /dev/null.
     - You'll probably want to visit http://user-mode-linux.sourceforge.net and get the UML utilities. These are not needed for the build or interactive use (but recommended). They are necessary for the regression testing proceedures used by "make check".
   - Pick a suitable place, and extract the following files:
     - 2.4.17 kernel. For instance:

                      mkdir -p /c2/kernel/linux-2.4.17
                      cd /c2/kernel/linux-2.4.17
                      tar xzvf ../download/pub/linux/kernel/v2.4/linux-2.4.17.tar.gz

     - extract the umlfreeroot file

                      mkdir -p /c2/user-mode-linux/basic-root
                      cd /c2/user-mode-linux/basic-root
                      tar xzvf ../download/umlfreeroot-6.0.tar.gz

     - FreeSWAN itself (or checkout "all" from CVS)

                      mkdir -p /c2/freeswan/sandbox
                      cd /c2/freeswan/sandbox
                      tar xzvf ../download/snapshot.tar.gz

   - cd to /c2/freeswan/sandbox/testing/utils
   - copy umlsetup-sample.sh to ../../umlsetup.sh `cp umlsetup-sample.sh ../../umlsetup.sh`
   - open up ../../umlsetup.sh in your favorite editor.
   - change POOLSPACE= to point to the place with at least 500Mb of disk. Best if it is on the same partition as the "umlfreeroot" extraction, as it will attempt to use hard links if possible to save disk space.
   - Set TESTINGROOT if you intend to run the script outside of the sandbox/snapshot/release directory. Otherwise, it will configure itself.
   - KERNPOOL should point to the directory with your 2.4.9 kernel tree. This tree should be unconfigured! This is the directory you used in step 2a.
   - UMLPATCH should point at the bz2 file you downloaded at 1g.
   - FREESWANDIR should point at the directory where you unpacked the snapshot/release. Include the "freeswan-snap2001sep16b" or whatever in it. If you are running from CVS, then you point at the directory where top, klips, etc. are. The script will fix up the directory so that it can be used.
   - BASICROOT should be set to the directory used in 2b, or to the directory that you created with RPMs.
   - SHAREDIR should be set to the directory used in 2c, to /usr/share for Debian potato users, or to $BASICROOT/usr/share.

   -     cd $TESTINGROOT/utils
         sh make-uml.sh

             It will grind for awhile. If there are errors it will bail.
             If so, run it under "script" and send the output to bugs@lists.freeswan.org.

   - You will have a bunch of stuff under $POOLSPACE. Open four xterms:

             for i in sunrise sunset east west
             do
                 xterm -name $i -e $POOLSPACE/$i/start.sh
             done

   - Login as root. Password is "root" (Note, these virtual machines are networked together, but are not configured to talk to the rest of the world.)
   - verify that pluto started on east/west, run "ipsec look"
   - login to sunrise. run "ping sunset"
   - login to west. run "tcpdump -p -i eth1 -n" (note that this is tcpdump.org tcpdump)