Installation 1.8

From VNUML-WIKI
(Redirected from Installation)
Jump to: navigation, search

Installing VNUML 1.8

Authors:
Fermín Galán (galan at dit.upm.es)
David Fernández (david at dit.upm.es)
version 1.8, April 5th, 2010


Introduction

There are two ways of installing VNUML:

  • From APT package in deb-based distribution (Debian, Ubuntu, Kubuntu, MEPIS,...).
  • From source .tgz

The recommended installation procedure is the former, due to it is much easier than the later (for example, dependencies are calculated and installed automaticly). However, this manual describes also the source based installation for users not using .deb based distributions (like Fedora or SuSE).

Note the installation prefix in both cases is different: /usr/share for the .deb package and /usr/local/share for the source .tgz installation (except if you use a differente PREFIX when ./configure).

UML simulations generally consume a lot of physical host resources (CPU, disk storage, RAM, etc). As a minimum, you need a standard Pentium III 500 Mhz with 128 Mb RAM to perform the tutorial included in the documentation. However, at least 256 Mb (better 512 Mb) and a faster CPU are recomended to execute more complex scenarios.

Note this document describes how to install the VNUML tool itself: kernels and filesystem files need to be download and installed separatelly (fortunallely, installing then is as simple as move a file to the right place, see <kernel> and <filesystem> tags in VNUML Language Reference document for details).

Warning when upgrading root filesystem for COW-based existing simulations: if you use a symlink that points to the actual filesystem (tipically root_fs_tutorial -> root_fs_tutorial-X.Y.Z), note that upgrading the actual filesystem (root_fs_tutorial-X.Y.Z) will corrupt previously created COW based simulations. Therefore, it is advisable to purge (vnulmparser.pl -P) that simulations before (or event removing directly their directory under ~/.vnuml/simulations to be sure).

Installing from .deb package

An APT respository has been set up for VNUML related packages. The installation procedure is as follows:

  1. Add the following line to the /etc/apt/sources.list file:
  2. deb http://www.dit.upm.es/~vnuml/debian binary/
    
  3. Update package list:
  4. apt-get update
    
  5. (Optional) If you want to consider testing version of VNUML, add also to/etc/apt/sources.list file:
  6. deb http://www.dit.upm.es/~vnuml/debian-testing binary/
    
  7. Install VNUML along the packages it depends on
  8. apt-get install vnuml
    

In addition, although they are not mandatory packages to work with VNUML, it is strongly recommended you install the following:

apt-get install vlan xterm bridge-utils screen

That's all! :)

Note for Ubuntu 10.04: tun module used to manage tuntap interfaces is now integrated in the kernel, so loading the module with "modprobe tun" is no longer needed. However, the vnumlparser always tries to load the module, giving the following error:

 host> /sbin/modprobe tun
 FATAL: Could not load /lib/modules/2.6.32-16-generic/modules.dep: No such file or directory

To solve the problem, just edit /usr/bin/vnumlparser.pl and change the following line in "mode_t" function:

 !$execution->execute ($bd->get_binaries_path_ref->{"modprobe"} . " tun") or $execution->smartdie ("module tun can not be initialized: $!");

by:

 if (! -e "/dev/net/tun") {
     !$execution->execute ($bd->get_binaries_path_ref->{"modprobe"} . " tun") or $execution->smartdie ("module tun can not be initialized: $!");
 }

Installing from source .tgz

VNUML 1.8 source package includes an easy to use installer thanks to Tony Prug and Casey T. Deccio contributions.

The most of the cases, all you need to install VNUML is untar the package in your GNU/Linux box (the package is quite distribution agnostic, but specific issues for Mandrake can be found later in this document) and perform the following operations. An Internet connection is needed, in order the installation scripts connect to CPAN (and other places) to get Perl modules and other libraries.

./configure
make
make install

(The lastest command needs root privileges in the host)

Several options can be configured using configure script (for example, the installation prefix). The ./configure --help give the list of the available options.

Host kernel needs to include tun and loop support in order to work properly. Skas support is also very desirable. 8012q is also required if you plan to use the VLAN features of VNUML.

Please read the INSTALL file that comes with the package in order to get futher information and details.

Libxml and expat installation

VNUML needs libxml2 and expat2 to work. By default, the VNUML install program doesn't perform special actions about it, assuming the libraries are installed in your system (for example, as RPM or .deb packages). This is the recomended procedure.

However, if you want VNUML installer to install libxml2 and/or expat2 being installed from the source (downloading the packages through Internet) use --with-libxml=yes and/or --with-expat=yes ./configure options, respectively.

External Perl modules

The VNUML tool requires some external Perl modules to work. By default, the installer (./configure) check if the required modules are installed. If not, the installer will report the user about the missing modules, in order he can install them before running again the installer.

The list of required modules is (newest versions can be found in CPAN):

  • Error
  • Exception::Class
  • XML::DOM, XML::Checker (these modules usually require some others: XML::RegExp, XML::Parser, XML::Parser::PerlSAX)
  • NetAddr::IP
  • Net::Pcap
  • IO::Socket
  • Term::ReadKey
  • Net::IPv6Addr (this module usually requires some others: Math::Base85, Net::IPv4Addr)
  • File::Glob


If you find some required module is missing in the list before, please, tell us in order to add it.

Perl modules are distributed as .tar.gz files. The standarized way to install them is the following:

  1. Uncompress the file.
  2. Execute 'perl Makefile.PL'. This checks dependencies and tell you if another required module have to be installed previously.
  3. Execute 'make'.
  4. Execute 'make test'. Note that (curiously!) not getting 100% success doesn't mean always that the module is not going to work.
  5. Install the module with 'make install' (root privilegies are needed).

In addition to manual installation, the VNUML installer can automate the missing modules installation using --with-build_modules=yes configure option. This is done throught the CPAN public repository and requires an Internet connection.

Required binaries

The vnumlparser.pl program needs some external binaries in order to work. The parser is able to check if the required binaries are in the command path (configure your PATH enviroment variable properly!) and report to the user if some required binary is missing.

The most of this binaries are common things, like cp, mv, rm, find and the like. However, some others may be difficult to find, in particular the following:

  • brctl (only if you plan tu use virtual bridge based virtual networks). It can be found in the bridge-utils package (Debian .deb or SuSE .rpm)
  • vconfig (only if you plan tu use VLAN features). It can be found in the vlan package (Debian .deb or SuSE .rpm)
  • tunctl, uml_mconsole, uml_switch. In Debian, it can be found in the uml-utilities package (just use 'apt-get install uml-utilities' to install). In other distribution you can use the RPM in the UML download page or compile from the sources .tar.bz2 at the same URL (we recommend you the second option).

Installing offline

The University of Koblenz-Landau has developed a VNUML offile installed that can be very useful if you don't have Internet access at installation time. You can find it in their download page.

General Troubleshooting

  • (Installation from source package) The usual './configure ; make ; make install' may fail in the last step if the perl-devel package is not installed. In particular, the problem seems not finding the /usr/lib/perl5/5.8.3/i386-linux-thread-multi/CORE/config.h file, that is included in that package.
  • (Installation from source package) In order to compile the UML tools you maybe need install previously the readline-devel and ncurses-devel packages (at least in SuSE 9.0 and Mandrake 10.0, see this bug report for details).
  • The installation procedure of VNUML may create new users and/or group. To avoid permission problems accesing some resources (for example, socket files), it is recommended logging completely out and logging back in (see this posting in the vnuml-devel list for some more detail).
  • There are problem reports using UML kernel linux-um-2.6.18.1-bb2-xt-4m (a 32 bits kernel) on some 64 bits hosts. The recommendation is to use at least a 2.6.27-7 or newer for 64 bits hosts. This problems were reported in Ubuntu 8.04 64 bits (that uses a 2.6.24 kernel) but they seem not being related with the distribution but with the host kernel version (see this thread for details). Thanks to Gerson Rodriguez for the bug report and proposed solution.

Mandrake specific issues

From [1].

  • perl-devel RPM package seems not being installed in the default Mandrake 10.0 installation
  • The libreadline4-devel RPM package (required to compile UML tools) seems not being installed in the default Mandrake 10.0 installation).
  • The /dev/net/tun device file only seems to exist when tun module is loaded. So, you need to 'modprobe tun' before running vnumparser.pl in order to avoid the '/dev/net/tun is not a valid character device file' error message.

Contributed software

The contrib/ directory in the source package after untaring contains contributed software that can be used with VNUML. For example, the contrib/uml_router is a uml_switch modification for traffic capture. Each contribution has its own README or INSTALL file, with installation steps and brief how-to descriptions (if you find this information insufficient the vnuml-user maillist is the right place to ask for :)

We strongly recommend you to review the contrib/ directory. Maybe you find something useful!