next up previous
Next: 7. Troubleshooting Up: IMUNES manual Previous: 5. Advanced Usage

Subsections

6. Installation

6.1 Installation of IMUNES on FreeBSD 8

6.1.1 Installing FreeBSD

A comprehensive and explanatory guide for installing configuring and using FreeBSD can be found here:

http://www.freebsd.org/doc/handbook/

Section 2 of the handbook describes the installation of the FreeBSD operating system:

http://www.freebsd.org/doc/handbook/install.html

You can choose to install FreeBSD with two different architectures:

6.1.2 Step by step guide through the FreeBSD installation

  1. Insert the FreeBSD-8.2-RELEASE or FreeBSD-8.3-RELEASE (i386 or amd64) medium on startup. Boot from it.
  2. Country Selection - Choose your country (e.g. United States). Press OK.
  3. Main Menu - Choose the "Standard" installation. Press Select.
  4. Message - Press OK.
  5. FDISK Partition Editor - Press C to create a slice:
    1. A minimum of 20GB is needed for FreeBSD. Type 20G to create a 20GB slice. Press OK.
    2. A screen with the number 165 appears. Press OK.
    3. Position on the created partition (probably named ad0s1).
    4. Press S to set the created partition bootable.
  6. FDISK Partition Editor - Position on the "unused" space beneath the created partiton. Press C to create another slice:
    1. A minimum of 5GB is needed for ZFS. Type 5G to create a 5GB slice. Press OK.
    2. A screen with the number 165 appears. Press OK.
    3. Remember the name of this partition (probably named ad0s2). This name will be later used for configuring ZFS.
  7. FDISK Partition Editor - Press Q to finish.
  8. Boot Manager - Select the "Standard" option. Press OK.
  9. Message - Press OK.
  10. FreeBSD Disklabel Editor - While the partition "ad0s1" (the 20GB one) is selected press A to automatically distribute system partitions on it.
  11. FreeBSD Disklabel Editor - The result should look similar to this:
        Part      Mount     Size
        ad0s1a    /       1024MB
        ad0s1b    swap    2006MB
        ad0s1d    /var    5099MB
        ad0s1e    /tmp    1024MB
        ad0s1f    /usr   11326MB
    
  12. FreeBSD Disklabel Editor - Press Q.
  13. Choose Distributions - Select the "6 User" distribution.
  14. FreeBSD Documentation Installation Menu - Select "en" and then "X Exit".
  15. Ports collection installation - Select "Yes".
  16. Choose Distributions - Select the "X Exit" to exit. Press OK.
  17. Choose Installation Media - Select "1 CD/DVD Install from a FreeBSD CD/DVD".
  18. Continue through the Installation - Select "Yes".
  19. Wait until the installation is over.
  20. Message - Press OK.
  21. Configure any ethernet devices? - Select "Yes".
    1. Select the wanted ethernet device, e.g. em0.
    2. IPv6 configuration - Select "No".
    3. DHCP configuration - Select "Yes".
    4. Enter the hostname, e.g. IMUNES1.
    5. Select "OK".
  22. Network gateway - Select "No".
  23. Install inetd services - Select "No".
  24. Allow SSH login - Select "Yes".
  25. Allow anonymous FTP access - Select "No".
  26. NFS server - Select "No".
  27. NFS client - Select "No".
  28. Customize system console settings - Select "No".
  29. Set time zone - Select "No".
  30. Configure mouse - Select "No".
  31. Browse package collection - Select "No".
  32. Add additional user accounts - Select "No".
  33. Message - Set root password - Press "OK". Enter password. Re-enter password.
  34. Visit the general configuration menu - Select "No".
  35. Main Menu - Select the "X Exit Install" option by using the "Tab" key.
  36. Are you sure you want to exit? - Select "Yes".
  37. Message - Reboot - Press "OK".

6.1.3 Installing the FreeBSD X11 system - GUI

Login into the machine as root. Edit the file /etc/rc.conf with an editor e.g. vi and add the following lines at the end of the file:

hald_enable="YES"
dbus_enable="YES"
zfs_enable="YES"
Save changes and exit.

# pkg_add -r xorg bash xpdf vim geany zip unzip xterm firefox

You can choose between multiple desktop environments:

After the installation of one or multiple window manager we need to configure which will be used. Edit the file .xinitrc in the user folder and add a line depending on which window manager you want to use:

Reboot the machine by issuing the reboot command:
# reboot

After the machine has rebooted, log in and issue the startx command to start the chosen window manager:
# startx

6.1.4 Installing IMUNES

First we need to install the packages needed for IMUNES. To do this execute the following command:

# pkg_add -r tk86 ImageMagick tcllib libimg wireshark

After all the packages are installed we need to use the second partition we prepared during the installation (the one with the size 5GB, probably named ad0s2). This partition will be used to store the data that will be in the virtual nodes. For this purpose we will create a ZFS pool on the second partition with the command zpool create assuming that the second partition is named ad0s2:

# zpool create vroot /dev/ad0s2

Now we need to fetch the IMUNES source/tarball from the official imunes site:

http://imunes.tel.fer.hr/imunes-1.0.tar.gz

To fetch you can use the firefox browser that we installed earlier or use the fetch command:

# fetch http://imunes.tel.fer.hr/imunes-1.0.tar.gz

To extract the tarball use the following command:

# tar xf imunes-1.0.tar.gz

Enter the extracted directory:

# cd imunes

Now we need to install IMUNES and populate the ZFS file system with predefined and required data. To install imunes on the system execute:

# make install

To setup the ZFS file system execute:

# make vroot

Both of these commands can be executed together by executing:

# make

Now the IMUNES GUI can be ran just by typing the imunes command in the terminal:

# imunes

The GUI allows the specification of network topologies but to execute experiments the FreeBSD kernel must be compiled with a few additional options.

6.1.5 Recompiling the FreeBSD kernel with VIMAGE support

First, the kernel sources need to be fetched, this can be done by using the sysinstall utility:

  1. Start the sysinstall utility:
    # sysinstall
  2. Go to "Configure".
  3. Go to "Distributions".
  4. Go to "sys".
  5. Mark "src" by pressing the Space key on it.
  6. Select "X Exit".
  7. Select "X Exit".
  8. Select "Install from an FTP server".
  9. Choose the "Main server" or a server closer to your location.
  10. When the installation is done select press the Esc key until you exit the sysinstall utility.

Now the kernel source is available in the folder /usr/src/sys. Enter that folder:

# cd /usr/src/sys

Depending which distribution architecture you have decided to install, i386 or amd64 the next command differs.

For i386 enter the directory i386/conf:

# cd i386/conf

For amd64 enter the directory amd64/conf:

# cd amd64/conf

With an editor (vi, vim or geany) create a file named VIMAGE:

# vi VIMAGE

Insert the following configuration in the VIMAGE file:

include GENERIC
nooptions FLOWTABLE
options VIMAGE
options VNET_DEBUG
options MROUTING

options DDB
options KDB

Exit and save the file.

Now execute the following commands:

# config VIMAGE
# cd ../compile/VIMAGE
# make cleandepend && make depend
# make
# make install

When the last command ends use the reboot command to restart the computer:

# reboot

6.1.6 Running IMUNES on FreeBSD

After login execute the startx command to start the window manager. Open a terminal and start imunes:

# imunes

Now you can create an arbitrary network topology or something like shown in Figure 4.1 and execute the experiment.

6.2 Installation of IMUNES on FreeBSD 9

6.2.1 Installing FreeBSD

A comprehensive and explanatory guide for installing configuring and using FreeBSD can be found here:

http://www.freebsd.org/doc/handbook/

Section 2 of the handbook describes the installation of the FreeBSD operating system:

http://www.freebsd.org/doc/handbook/bsdinstall-start.html

You can choose to install FreeBSD with two different architectures:

6.2.2 Step by step guide through the FreeBSD installation

  1. Insert the FreeBSD-9.2-RELEASE or FreeBSD-9.3-RELEASE (i386 or amd64) medium on startup. Boot from it.
  2. Welcome - Choose "Install".
  3. Keymap Selection
    1. FreeBSD 9.3 - Press "Select" to "Continue with default keymap" or choose an alternative one.
    2. FreeBSD 9.2 - If you use a non-default key mapping for your keyboard, choose "Yes" and find your keyboard. Otherwise, choose "No".
  4. Set Hostname - Set the hostname for your newly installed system (e.g. "imunes").
  5. Distribution Select - Optional system components to install: select "src" and "lib32" (only on amd64 architecture) and deselect "games" and "ports".
  6. Partitioning - choose Guided or Manual After finishing partitioning, choose "Finish" and then "Commit". NOTE: freebsd-boot boot partition will be created upon creation of the first freebsd-ufs partition.
  7. Archive extraction - Wait for the installation to complete.
  8. FreeBSD Installer - Enter your system administrator (root) password. Repeat the password.
  9. Network Configuration - Choose a network interface to configure (if any available).
    1. Select "Yes" to configure IPv4 network if you use it. Then select "Yes" to configure DHCP if you use it.
    2. Select "Yes" to configure IPv6 network if you use it. Then select "Yes" to configure SLAAC if you use it.
    3. Resolver Configuration - If DHCP/SLAAC is used to configure the interface, some values may already be present. Otherwise, enter them yourself.
  10. Timezones - If your timezone is not UTC, select "No" and choose your region and country (e.g. Europe->Croatia) and select "Yes" if asked for confirmation.
  11. System Configuration
    1. FreeBSD 9.3 - Choose the "sshd" service to be started at boot and select "dumpdev" to enable crash dumps in /var.
    2. FreeBSD 9.2 - Choose the "sshd" service to be started at boot.
  12. (FreeBSD 9.2 only) Dumpdev Configuration - Select "Yes" for enabling crash dumps in /var folder.
  13. Add User Accounts - If necessary, add additional users now.
  14. Final Configuration - Choose "Exit".
  15. Manual Configuration - Nothing else is needed, so choose "No" to skip manual configuration.
  16. Complete - Reboot. (Don't forget to remove your FreeBSD boot media.)

6.2.3 Installing the FreeBSD X11 system - GUI

Login into the machine as root. Edit the file /etc/rc.conf with an editor e.g. vi and add the following lines at the end of the file:

hald_enable="YES"
dbus_enable="YES"
Save changes and exit.

# pkg_add -r xorg bash xpdf vim geany zip unzip xterm firefox subversion

You can choose between multiple desktop environments:

After the installation of one or multiple window manager we need to configure which will be used. Edit the file .xinitrc in the user folder and add a line depending on which window manager you want to use:

Reboot the machine by issuing the reboot command:
# reboot

After the machine has rebooted, log in and issue the startx command to start the chosen window manager:
# startx

6.2.4 Installing IMUNES

First we need to install the packages needed for IMUNES. To do this execute the following command:

# pkg_add -r tk86 ImageMagick tcllib wireshark socat gmake

Now we need to fetch the IMUNES source/tarball from the official imunes site:

http://imunes.tel.fer.hr/imunes-1.0.tar.gz

To fetch you can use the firefox browser that we installed earlier or use the fetch command. Then extract the tarball and enter the directory:

# fetch http://imunes.tel.fer.hr/imunes-1.0.tar.gz
# tar xf imunes-1.0.tar.gz
# cd imunes_version

Alternatively, you could checkout the last fresh IMUNES source through the public SVN repository:

# svn co svn://imunes.tel.fer.hr/head/ imunes
# cd imunes

Now we need to install IMUNES and populate the virtual file system with predefined and required data. To install imunes on the system execute:

# make install

To setup the virtual file system execute:

# make vroot

Both of these commands can be executed together by executing:

# make

Now the IMUNES GUI can be ran just by typing the imunes command in the terminal:

# imunes

The GUI allows the specification of network topologies but to execute experiments the FreeBSD kernel must be compiled with a few additional options.

6.2.5 Recompiling the FreeBSD kernel with VIMAGE support

If you didn't include the src option in step 4 while installing FreeBSD, the kernel sources need to be fetched. Use your selected architecture and release combination:

# fetch ftp://ftp.freebsd.org/pub/FreeBSD/releases/arch/release/src.txz

e.g. for FreeBSD 9.2 with amd64 architecture use:

# fetch ftp://ftp.freebsd.org/pub/FreeBSD/releases/amd64/9.2-RELEASE/src.txz

Extract it by using:

# tar xf src.txz -C /

Now the kernel source is available in the folder /usr/src/sys. Enter that folder:

# cd /usr/src/sys

Depending which distribution architecture you have decided to install, i386 or amd64 the next command differs.

For i386 enter the directory i386/conf:

# cd i386/conf

For amd64 enter the directory amd64/conf:

# cd amd64/conf

With an editor (vi, vim or geany) create a file named VIMAGE:

# vi VIMAGE

Insert the following configuration in the VIMAGE file:

include GENERIC
nooptions FLOWTABLE
options VIMAGE
options VNET_DEBUG
options MROUTING

options IPSEC
device crypto
options IPSEC_DEBUG

options DDB
options KDB

Exit and save the file.

Now execute the following commands:

# config VIMAGE
# cd ../compile/VIMAGE
# make cleandepend && make depend
# make
# make install

When the last command ends use the reboot command to restart the computer:

# reboot

6.2.6 Running IMUNES on FreeBSD

After login execute the startx command to start the window manager. Open a terminal and start imunes:

# imunes

Now you can create an arbitrary network topology or something like shown in Figure 4.1 and execute the experiment.

6.3 Running IMUNES with VMware Player

We also have a VMware image containing the FreeBSD operating system including a complete and working installation of IMUNES.

6.3.1 Installing VMware

To run the image VMware Player (or any other similar VMware product) needs to be installed. VMware player can be downloaded from the following address (after registration with VMware):
http://www.vmware.com/products/player/
The installation procedure is clearly explained in the VMware "Getting Started Guide" (http://www.vmware.com/pdf/vmware_player310.pdf)

6.3.2 Downloading the VMware image

The VWware image can be downloaded from the following address:
http://imunes.tel.fer.hr/imunes/dl/index.html
There are two archives, one in the RAR format and other in the ZIP format. They both contain the same image but the RAR file is considerably smaller. Download one of them and then unpack the contents of the archive in a folder with enough space (The unpacked image is almost 2.3GB large, but for runtime execution 4GB is needed.)

6.3.3 Running the VMware image

After the image is extracted go into the image directory. There shpuld be two files, a vmdk file containing the disk image and a vmx file containing the VMware machine settings. Double-clicking the vmx file will open the VMware Player and start booting the image. A window will pop-up asking you wheter you moved or copied the image. Select the option "I copied it" and click on the "OK" button.

After a few minutes FreeBSD with the graphical interface will start. On the desktop there is an IMUNES icon to start IMUNES.


6.4 Installation of the IMUNES GUI on Linux

NOTE: Although you can draw network topology on any system that supports Tcl/Tk (Linux, FreeBSD, Windows, Mac OS X, Solaris), an experiment can only be started on FreeBSD operation system with root permissions (Figure 4.15 and Figure 4.16)!.

The first thing you need to do is install Tcl/Tk. The easiest way to do this is using ActiveState ActiveTcl 8.6. To download the installation files visit:

http://www.activestate.com/activetcl/downloads

Download the version 8.6, as IMUNES cannot run on earlier versions. Download the version that is designed for your operating system: x86 if you're using 32bit Linux or x86_64 if you're using 64bit Linux. Select the option AS package.

When the package is downloaded extract it using an archive manager or through the shell with the command:

# tar xzvf filename.tar.gz

Now enter the extracted directory and execute the file install.sh with root permissions. In the shell this is done with the line

# sudo ./install.sh

and provide the superuser password. If you don't have superuser permissions you can install ActiveTcl in your user directory. Make a directory in which ActiveTcl will be installed, and during the installation provide the path to that directory. After the installation you just need to put the ActiveTcl bin directory in the PATH variable.

For a csh or compatible (tcsh) perform:

# setenv PATH "/opt/ActiveTcl/bin:$PATH"

For a sh or similar perform:

# PATH="/opt/ActiveTcl/bin:$PATH"

# export PATH

To make the changes permanent add this lines to your shell rc configuration file (e.g. .bashrc for bash, .cshrc for csh).

To run IMUNES with full functionality you need the imagemagick package. You can install it through package managers or through shell.

On Debian, Ubuntu and other Debian based distributions you will use:

# sudo apt-get install imagemagick

On Fedora, Red Hat and other Red Hat based distributions you will use:

# su

# yum install imagemagick

Now we can fetch the latest version of IMUNES through CVS. To do this you need to have the cvs package installed. This is done the same way as the ImageMagick installation:

# sudo apt-get install cvs

or

# su

# yum install cvs

The line for fetching IMUNES from CVS is as follows:

# cvs -d :pserver:anonymous@imunes.net/usr/local/src/cvsroot co imunes

Now enter the imunes directory and start IMUNES:

# cd imunes

# ./imunes

6.5 Installation of the IMUNES GUI on Windows

NOTE: Although you can draw network topology on any system that supports Tcl/Tk (Linux, FreeBSD, Windows, Mac OS X, Solaris), an experiment can only be started on FreeBSD operation system with root permissions (Figure 4.15 and Figure 4.16)!.

The first thing you need to do is install Tcl/Tk. The easiest way to do this is using ActiveState ActiveTcl 8.6. To download the installation files visit:

http://www.activestate.com/activetcl/downloads

Download the version 8.6, as IMUNES cannot run on earlier versions. Download the package by clicking on the Windows Installer (EXE) option. When the file is downloaded start the installation by double clicking on the file. Follow the installation instructions to the end.

Now, to enable the full functionality of IMUNES you need to download the ImageMagick program from:

http://www.imagemagick.org/script/binary-releases.php

Go to the Windows Binary Release section. Select the appropriate file. Download it and install it following the installation instructions.

To start IMUNES you need the latest IMUNES release. If you have access to a Unix/Linux system you can download it like it is shown at the end of the previous section (Section 6.4). Then transfer it on the Windows machine.

Enter the imunes directory and double click the file imunes.tcl to start IMUNES.


next up previous
Next: 7. Troubleshooting Up: IMUNES manual Previous: 5. Advanced Usage
Denis Salopek 2015-04-08