VNUML Tutorial
version 1.5

Authors:
Fermín Galán (galan@dit.upm.es)
David Fernández (david@dit.upm.es)

March 21st, 2005



Virtual Network User Mode Linux
Contents

1. Introduction
2. Writting the VNUML Specification
    2.1. Generating SSH key
3. Building the Simulation Scenario
    3.1. Checking if the Scenario is up
4. Starting and Stoping Simulations
5. Releasing the Simulation Scenario
6. Additional Tips
7. Further Reading
Appendix: Execution Logs (1.5.0)

1. Introduction

VNUML (Virtual Network User Mode Linux) is a general purpose virtualization tool designed to easily create complex network simulation scenarios based on User Mode Linux (UML) virtualization software. It has been initially developed in the context of Euro6IX research project to simulate IPv6 IX scenarios based on Linux and zebra routing daemon. However, it is a useful tool that can be used to simulate general Linux based network scenarios.

VNUML is aimed to help in testing network applications and services over complex testbeds made of several nodes (even tenths) and networks inside one Linux machine, without involving the investment and management complexity needed to create it using real equipment.

This tutorial explains in detail how to use VNUML tool to simulate the simple networking scenario shown in the figure. It is intended as a hands-on approach for people that wants to start using VNUML tool, as well as an overview of the philoshopy and features behind VNUML tool for people that does not want to install it yet.

Tutorial Scenario

Although VNUML hides the user most of the details needed to use UML virtualization software, a minimum knowdledge about UML and how it works is needed. The reader is refered to UML web server to get that knodledge.

Along this document and the rest of the documentation, we refer to the machine where VNUML is running as the "host". The Linux virtual machines that run over the host using UML virtualization software are typically refered as "virtual machines" or simply "UMLs".

In order to simulate the scenario defined in this tutorial, you need to have VNUML properly installed. Please, refer to the VNUML Installation Guide for more details. The tutorial has to be performed using the root user account.

This tutorial covers VNUML language version 1.5 and vnumlparser.pl 1.5.X.


2. Writting the VNUML Specification

VNUML tool is made of two main componets: the VNUML language used for describing simulations in XML; and the interpreter of the language (vnumlparser.pl), that builds and manages the simulation, hidding all UML complex details to the user.

If you managed to successfully install VNUML parser and all related software packages, one of the hardest steps is over :). Now it is time to create the XML description of the scenario to be simulated using VNUML language (see VNUML Language Reference for a complete description of the language).

The specification of the tutorial scenario in VNUML language follows:


<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE vnuml SYSTEM "/usr/local/share/xml/vnuml/vnuml.dtd">
<vnuml>
  <global>
    <version>1.5.0</version>
    <simulation_name>tutorial</simulation_name>
    <ssh_key>/root/.ssh/identity.pub</ssh_key>
    <automac/>
    <ip_offset>100</ip_offset>
    <host_mapping/>
  </global>
  <net name="Net0"/>
  <net name="Net1"/>
  <net name="Net2"/>
  <net name="Net3"/>
  <vm name="uml1">
    <filesystem type="cow">/usr/local/share/vnuml/filesystems/root_fs_tutorial</filesystem>
    <mem>50M</mem>
    <if id="1" net="Net0">
      <ipv4>10.0.0.1</ipv4>
    </if>
    <route type="inet" gw="10.0.0.3">default</route>
  </vm>
  <vm name="uml2">
    <filesystem type="cow">/usr/local/share/vnuml/filesystems/root_fs_tutorial</filesystem>
    <if id="1" net="Net0">
      <ipv4>10.0.0.2</ipv4>
    </if>
    <route type="inet" gw="10.0.0.3">default</route>
  </vm>
  <vm name="uml3">
    <filesystem type="cow">/usr/local/share/vnuml/filesystems/root_fs_tutorial</filesystem>
    <if id="1" net="Net0">
      <ipv4>10.0.0.3</ipv4>
    </if>
    <if id="2" net="Net1">
      <ipv4>10.0.1.1</ipv4>
    </if>
    <if id="3" net="Net3">
      <ipv4>10.0.3.1</ipv4>
    </if>
    <route type="inet" gw="10.0.1.2">10.0.2.0/24</route>
    <route type="inet" gw="10.0.3.2">default</route>
    <forwarding type="ip" />
  </vm>
  <vm name="uml4">
    <filesystem type="cow">/usr/local/share/vnuml/filesystems/root_fs_tutorial</filesystem>
    <if id="1" net="Net1">
      <ipv4>10.0.1.2</ipv4>
    </if>
    <if id="2" net="Net2">
      <ipv4>10.0.2.1</ipv4>
    </if>
    <route type="inet" gw="10.0.1.1">default</route>
    <forwarding type="ip" />
  </vm>
  <vm name="uml5">
    <filesystem type="cow">/usr/local/share/vnuml/filesystems/root_fs_tutorial</filesystem>
    <if id="1" net="Net2">
      <ipv4>10.0.2.2</ipv4>
    </if>
    <route type="inet" gw="10.0.2.1">default</route>
  </vm>
  <host>
    <hostif net="Net3">
      <ipv4>10.0.3.2</ipv4>
    </hostif>
    <route type="inet" gw="10.0.3.1">10.0.0.0/16</route>
  </host>
</vnuml>

Just copy the above XML code to a file named tutorial.xml and save it (if you don't want to do the copy-paste, you can find it in the examples directory after VNUML installation, usually /usr/local/share/vnuml/examples).

Some initial comments about this description file:

  • <global> section defines certain parameters and options that apply to the whole simulation. For example, <ip_offset> is an important parameter in case you are using private network addresses prefix 192.168.x.x in your host enviroment.

    VNUML creates virtual network interfaces between the host and virtual machines as an internal mechanism of communciation between them (basically to transmit orders from the host to the virtual machines), and uses 192.168.x.x range to assign them IP addresses. <ip_offset> tag allows to control which addresses are assigned to avoid conflicts.

    For example, using <ip_offset>100</ip_offset> in the specification above means that VNUML parser will use addresses in the range 192.168.1.16-192.168.1.34. If this range is being used in your host enviroment you must change ip_offset value.

  • Virtual networks are created using <net> tag. Each network is identified by a name (e.g., "Net0") which is used later in virtual machines descriptions to define the network each virtual interface is connected to.
  • Virtual machines (or UMLs) are created and described using <vm> tag. Inside <vm> section, several different tags can be included to define each UML characteristics. For example:
    • <filesystem> tag is used to specify the filesystem the UML will use,
    • <if> tag is used to create and describe network interfaces (<ipv4> tag is used to set up the IP address; <ipv6> is supported also),
    • <route> tag is used to add static routes, and
    • <forwarding> to enable forwarding.
  • <host> tag is used to define configuration parameters related with the host. For example, in our case <hostif> configures the connection between host and uml5, to allow external access to the virtual scenario created.

2.1. Generating SSH key

VNUML parser uses SSH to access and manage the UMLs. To avoid being asked for a password whenever this happens (quite often) you have to generate a public key that will be installed automatically in the UMLs by the VNUML parser (<ssh_key> tag).

To create the public key just type:

> ssh-keygen -t rsa1

Select the default file to save the key (/root/.ssh/identity, supposing you are the root user). The passphrase is not relevant (althought we recommend not to use an empty passphrase, because of it could be not accepted during authentication in some cases).

Anyway, the first time (and only once) that SSH is used, you will have to confirm the server key answering 'yes'. ti the question you will be asked



3. Building the Simulation Scenario

Once you have the VNUML specification written, you can build the scenario using "-t" switch of VNUML parser. That is:

> vnumlparser.pl -t tutorial.xml -v

This command builds the virtual network topology described in "tutorial.xml" file and boots all the virtual machines defined inside it.

After command execution, you will see a lot of output messages, showing what the parser is exactly doing. That is because "-v" (verbose) switch is beign used (we recommend always using "-v" to see how things are going).

By default, the output of each UML is rediderect to the null device; if you want to see that output (getting a even more verbose output) use "-o" switch (for example "-o /tmp/boot").

Be patient, because the boot process of each UML takes a while (think about how long it takes a convetional Linux kernel to boot; virtualized ones can take even more). It can take easily several minutes to boot each UML, so it could take around 10-15 minutes to boot to boot the tutorial scenario (time depends greatly on the host machine characteristics).

To check the booting process of an UML, you can use:

> ps axw | grep linux | cut -c 1-100

(The 'cut' filter can be omitted if brief output is not desired)

If you want to see only the processes belonging to a given virtual machine use the following. Note that this only works if you are not using a SKAS host kernel, due to SKAS mode doesn't map UML processes as user processes in the host process space.

> ps axw | grep linux | grep uml_name | cut -c 1-100

where uml_name is the name (attribute name of <vm> tag) of the virtual machine.

If you want to check if a given process is in execution:

> ps axw | grep linux | grep process | cut -c 1-100

where process is the name of the process.

3.1. Checking if the Scenario is up

Each virtual machine can be accessed through SSH. However, note that the ssh daemon has to be already running in the UML to allow it (and that can take a while since booting starts). You can check if sshd is running with (if you are not using SKAS):

> ps axw | grep linux | grep sshd | cut -c 1-100

When it is running, you should see something like the following, showing that sshd is running inside each virtual machine:

root     11384  0.0  2.9 42408 15280 pts/2   S    16:06   0:00 linux (uml5) [/usr/sbin/sshd]
root     11436  0.0  3.0 60840 15724 pts/2   S    16:06   0:00 linux (uml1) [/usr/sbin/sshd]
root     11741  0.2  3.0 42408 15496 pts/2   S    16:06   0:00 linux (uml3) [/usr/sbin/sshd]
root     11844  0.1  2.9 42408 15312 pts/2   S    16:06   0:00 linux (uml4) [/usr/sbin/sshd]
root     11919  0.0  2.9 42408 15352 pts/2   S    16:06   0:00 linux (uml2) [/usr/sbin/sshd]

NOTE: 'grep linux' in the commands before assumes that your kernel name is 'linux' or linux-compossed (like 'linux-2.4.22um12'). If you are using other name in the <kernel> tag, you have to use the appropiated grep expression.

Anyway, this manual process can be avoided using "-B" switch when building topology. That is:

> vnumlparser.pl -t tutorial.xml -v -B

Using "-B" option, vnumlparserl.pl keeps waitting until the sshd processes are ready.

Once the UMLs are ready, to get access to a specific UML you can use ssh:

> ssh -1 uml1

Note that in this case version 1 of the SSH protocol is being used (see the "-1" switch). Although SSH v2 can also be used, vnumparser.pl version 1.3.x only configures automatic authentication for SSH v1.

The use of names in ssh only works if /etc/hosts mapping has requested by means of <host_mapping> tag (a new line in hosts file is written for each UML). If you have not used that tag, you have to access UMLs using its management IP address (more obscure):

> ssh -1 192.168.1.18

To check the connectivity you can use ping or traceroute, as shown in the examples below. For example, from uml1 try (you should see a similar trace, if everything is going right):

uml1:~ # traceroute -n 10.0.2.2
traceroute to 10.0.2.2 (10.0.2.2), 30 hops max, 38 byte packets
 1  10.0.0.3  1.282 ms  0.726 ms  0.678 ms
 2  10.0.1.2  1.243 ms  1.462 ms  1.010 ms
 3  10.0.2.2  1.396 ms  1.345 ms  1.303 ms
uml1:~ # traceroute -n 10.0.3.2
traceroute to 10.0.3.2 (10.0.3.2), 30 hops max, 38 byte packets
 1  10.0.0.3  1.779 ms  2.572 ms  1.359 ms
 2  10.0.3.2  1.785 ms  1.641 ms  1.744 ms

From uml5 try:

uml5:~ # traceroute -n 10.0.0.1
traceroute to 10.0.0.1 (10.0.0.1), 30 hops max, 38 byte packets
 1  10.0.2.1  0.916 ms  0.743 ms  0.681 ms
 2  10.0.1.1  1.072 ms  1.019 ms  1.009 ms
 3  10.0.0.1  1.420 ms  1.363 ms  1.352 ms
uml5:~ # traceroute -n 10.0.3.2
traceroute to 10.0.3.2 (10.0.3.2), 30 hops max, 38 byte packets
 1  10.0.2.1  1.407 ms  0.857 ms  1.243 ms
 2  10.0.1.1  1.265 ms  1.019 ms  0.980 ms
 3  10.0.3.2  1.545 ms  3.156 ms  2.033 ms

From host try:

host# traceroute -n 10.0.0.1
traceroute to 10.0.0.1 (10.0.0.1), 30 hops max, 40 byte packets
 1  10.0.3.1  0.000 ms   0.000 ms   0.000 ms
 2  10.0.0.1  0.000 ms   0.000 ms   0.000 ms
host# traceroute -n 10.0.2.2
traceroute to 10.0.2.2 (10.0.2.2), 30 hops max, 40 byte packets
 1  10.0.3.1  0.000 ms   0.000 ms   0.000 ms
 2  10.0.1.2  0.000 ms   0.000 ms   0.000 ms
 3  10.0.2.2  0.000 ms   0.000 ms   0.000 ms


4. Starting and Stoping Simulations

Once the simulated scenario is up and running, you can get access to each virtual machine using ssh and execute the commands you desire. You could, for example, start manually a web or ftp server inside uml1 and uml5 virtual machines. You could also start routing daemons in uml3, uml4 and the host in order to set-up dynamic routing for the scenario. You could even start automatically such services from the init scripts in the root filesystem being used, although that would probably led to use a different filesystem for each UML.

However, in order to be able to easily create and reproduce simulation scenarios, a simple and powerfull way to specify the commands that each virtual machine has to execute to start the scenario is needed, as well as the commands to stop the simulation and return the virtual machine to a known state.

That is basically what VNUML offers: a way to automate the execution of commands in the virtual machines and host usint the execute commands mode (-x switch). By means of the <exec> tag included inside each virtual machine definition, you can specify the commands that will be executed. Commands are grouped using a command sequence identifier, specified in the seq attribute of the <exec> tag. In this tutorial we will to consider two comand sequences: "start" and "stop".

To show this functionality in this tutorial we will use the /usr/bin/hello program included in the tutorial root filesystem. It is just a quite simple program whose only function is to output 'hello' word to file /tmp/hello every 10 seconds (it is only for testing purposes, we suppose you'll use VNUML for more uselful tasks :).

In order to test it, just add the following lines at the end of uml1 description (you can find the modified tutorial VNUML specification, tutorial_plus.xml, including the new lines in the examples directory after VNUML installation, usually /usr/local/share/vnuml/examples).

<exec seq="start" type="verbatim"> nohup /usr/bin/hello &lt;/dev/null &gt;/dev/null 2&gt;&amp;1 &amp; </exec>
<exec seq="stop" type="verbatim">killall hello</exec>

Basically, we have specified the following command to be executed in uml1 whenever the simulation is started (note that <, > and & characters had to be escaped in XML files):

nohup /usr/bin/hello </dev/null >/dev/null 2>&1 &

(Why not simply use 'nohup /usr/bin/hello &'? There are ssh related problems that force to redirect standard input and output; look at VNUML User Manual for more details).

And the following one to be executed in uml1 whenever the simulation is stoped:

killall hello

Start the simulation using:

> vnumlparser.pl -x start@tutorial_plus.xml -v

Note that the process is much shorter than when building the simulation scenario (mode -t). Access uml1 (remember, 'ssh -1 uml1') and check the existence and growing of /tmp/hello file: the hello daemon is working.

uml1:~ # tail -f /tmp/hello
Hello! Current date: Thu Jul 10 09:53:52 EDT 2003
Hello! Current date: Thu Jul 10 09:54:02 EDT 2003
Hello! Current date: Thu Jul 10 09:54:13 EDT 2003
Hello! Current date: Thu Jul 10 09:54:24 EDT 2003
Hello! Current date: Thu Jul 10 09:54:35 EDT 2003

In a similar way you can stop the simulation (killing the hello daemon) with:

> vnumlparser.pl -x stop@tutorial_plus.xml -v

Access again to uml1 and check that hello daemon is not working now ('ps axw | grep hello' for example) and that /tmp/hello file has stopped growing.



5. Releasing the Simulation Scenario

Once you have finished playing around with the simulation scenario, you can release it in a "polite way" by means of "-d" switch of VNUML parser.

> vnumlparser.pl -d tutorial_plus.xml -v

After waiting for a while (think that a convetional kernel can take a couple of minutes to halt, so a set o virtualized ones take quite more), the simulation scenario should be released (all virtual machines should have been halted and the virtual networks deleted).

After releasing the scenario in such way, you can recreate it with "-t". Note that releasing a scenario does not mean that filesystems changes are lost. On the contrary, any change performed on them remains after the scenario has been released and restarted again (for example, the data in the /tmp/hello file).

In case of problems, you can also release the scenario using an "unpolite" way: 'killall linux' (be aware that some process ignore SIGTERM signal and do not stop using killall; identify remaining process with 'ps -aux | grep linux' and use kill -9 with them).

However, killall method should only be used as a last resort (just when -d switch fails), because:

  1. aditional resources (as virtual briges, TUN/TAP devices, etc.) will not be deleted and will remain in the host operating system until removed manually or the host is rebooted,
  2. UML filesystem may be corrupted and not boot properly next time.

See VNUML User Manual for more details when -d mode fails (including the purge mode (-P).



6. Additional Tips

In addition to the basic tutorial you can try the following tips:

  • Improve perfomance. A virtualized kernel runs slower than a conventional one. Anyway, UML provides a mechanism of improving efficiency using SKAS mode. Different from previous versions of vnumlparser.pl, version 1.3.0 and beyond works fine with SKAS: only that you need is to compile a host kernel with SKAS support enabled. More information in the UML Project webpage.
  • Direct login. SSH is not the unique way to login the UML since vnumlparser.pl 1.3.0. If you have a X11 grafical enviroment, try adding the following tags inside a <vm>:
    <boot>
       <con0>xterm</con0>
    </boot>
    
    This configures the virtual machine to output (and, so, a login prompt) to a xterm console. You can also trying to get a login prompt for the virtual machine in tty8 (ensure firstly that tty8 is not already in use in your system):
    <boot>
       <con0>tty:/dev/tty8</con0>
    </boot>
    
    You can find a version of the tutorial, tutorial_direct_login.xml, with xterm configured for uml1 and tty8 configured for uml2 (uml3, uml4 and uml5 are still "hiden" virtual machines, the unique way to login them is through SSH) in the examples directory after VNUML installation, usually /usr/local/share/vnuml/examples) . More useful could be the access from a pseudo-terminal:
    <boot>
       <con0>pts</con0>
    </boot>
    
    After booting, get the pseudo-terminal alocated for the UML with something like:
    uml_mconsole /var/vnuml/tutorial/uml2/mconsole config con0
    
    and open a screen session with (supposing that the pseudoterminal were '/dev/pts/6'):
    screen /dev/pts/6
    
    The -e switch of the -t mode helps to automatize this steps. See VNUML User Manual for details.
  • Inter-boot delay. It's possible (it depends of UML unstability related with certain host Linux distributions and kernels) some UMLs could not boot properly when you build the topology (mode -t). This situation is detected when vnumlparser.pl seems waitting forever (in blocking mode, -B swich) or the sshd daemon of the virtual machine never appears in a recurrrent ps (in non-blocking mode).
    In some cases, adding a small delay between UML booting seems to fix the situation. You can introduce such delay using "-w" switch. For examples, a "-w 10" introduces 10 seconds interval between UML boots.
  • UML kernel selection. By default, the UML kernel used in each virtual machine is the same: the one in /usr/local/bin/linux. You can specify a different UML kernel using <kernel> tag.
  • Blocking mode also with -x and -d. We have been told above that -B switch can be using while building a topology (mode -t) in order vnumlparser.pl to wait until UMLs are ready (indeed: sshd is alive in each virtual machine). Blocking mode can be used also with executing commands (-x) and destroying topology (-d). In those cases, if the UMLs are not ready, the parser waits until then (in non-blocking mode, the parser exits doing nothing).

The tutorial_user.xml specification (that you can find in the examples directory after VNUML installing, usually /usr/local/share/vnuml/examples) contains adavenced features (hostfs, uml_switch-based network, no-root execution, etc.)


7. Further Reading

This tutorial does not show all features of VNUML tool. Concurrent simulation execution, filetree copying, VLAN integration and other interesting capabilities are available in VNUML. To know about them in detail you should next read VNUML User Manual and VNUML Language Reference. If you need to hack vnumparser.pl to adapt it to your needs, you should read the source code (we think it's very clear! :). A VNUML Developers Manual could be released in the future if needed.



Appendix: Execution Logs (1.5.0)

The following logs were taken while performing this tutorial at morfeo (Debian system running 2.6.10-skas3-7), using verbose switch (-v) of vnumlparser.pl version 1.5.0. UMLs run 2.6.10-1m.

Building topology:

root@morfeo# vnumlparser.pl -t tutorial.xml -v
host> /bin/touch /var/vnuml/LOCK
host> /bin/touch /var/vnuml/tutorial/lock
host> /sbin/modprobe tun
host> /usr/sbin/tunctl -t uml1-eth0 -f /dev/net/tun
Set 'uml1-eth0' persistent and owned by uid 0
host> /usr/sbin/tunctl -t uml1-eth1 -f /dev/net/tun
Set 'uml1-eth1' persistent and owned by uid 0
host> /sbin/ifconfig uml1-eth1 0.0.0.0 promisc up
host> /sbin/modprobe tun
host> /usr/sbin/tunctl -t uml2-eth0 -f /dev/net/tun
Set 'uml2-eth0' persistent and owned by uid 0
host> /usr/sbin/tunctl -t uml2-eth1 -f /dev/net/tun
Set 'uml2-eth1' persistent and owned by uid 0
host> /sbin/ifconfig uml2-eth1 0.0.0.0 promisc up
host> /sbin/modprobe tun
host> /usr/sbin/tunctl -t uml3-eth0 -f /dev/net/tun
Set 'uml3-eth0' persistent and owned by uid 0
host> /usr/sbin/tunctl -t uml3-eth1 -f /dev/net/tun
Set 'uml3-eth1' persistent and owned by uid 0
host> /sbin/ifconfig uml3-eth1 0.0.0.0 promisc up
host> /usr/sbin/tunctl -t uml3-eth2 -f /dev/net/tun
Set 'uml3-eth2' persistent and owned by uid 0
host> /sbin/ifconfig uml3-eth2 0.0.0.0 promisc up
host> /usr/sbin/tunctl -t uml3-eth3 -f /dev/net/tun
Set 'uml3-eth3' persistent and owned by uid 0
host> /sbin/ifconfig uml3-eth3 0.0.0.0 promisc up
host> /sbin/modprobe tun
host> /usr/sbin/tunctl -t uml4-eth0 -f /dev/net/tun
Set 'uml4-eth0' persistent and owned by uid 0
host> /usr/sbin/tunctl -t uml4-eth1 -f /dev/net/tun
Set 'uml4-eth1' persistent and owned by uid 0
host> /sbin/ifconfig uml4-eth1 0.0.0.0 promisc up
host> /usr/sbin/tunctl -t uml4-eth2 -f /dev/net/tun
Set 'uml4-eth2' persistent and owned by uid 0
host> /sbin/ifconfig uml4-eth2 0.0.0.0 promisc up
host> /sbin/modprobe tun
host> /usr/sbin/tunctl -t uml5-eth0 -f /dev/net/tun
Set 'uml5-eth0' persistent and owned by uid 0
host> /usr/sbin/tunctl -t uml5-eth1 -f /dev/net/tun
Set 'uml5-eth1' persistent and owned by uid 0
host> /sbin/ifconfig uml5-eth1 0.0.0.0 promisc up
host> /usr/sbin/brctl addbr Net0
host> /usr/sbin/brctl stp Net0 off
host> /sbin/ifconfig Net0 0.0.0.0 promisc up
host> /usr/sbin/brctl addbr Net1
host> /usr/sbin/brctl stp Net1 off
host> /sbin/ifconfig Net1 0.0.0.0 promisc up
host> /usr/sbin/brctl addbr Net2
host> /usr/sbin/brctl stp Net2 off
host> /sbin/ifconfig Net2 0.0.0.0 promisc up
host> /usr/sbin/brctl addbr Net3
host> /usr/sbin/brctl stp Net3 off
host> /sbin/ifconfig Net3 0.0.0.0 promisc up
host> /sbin/ifconfig Net3  10.0.3.2 netmask 255.255.255.0
host> /sbin/route -A inet add -net 10.0.0.0/16 gw 10.0.3.1
host> /usr/sbin/brctl addif Net0 uml1-eth1
host> /usr/sbin/brctl addif Net0 uml2-eth1
host> /usr/sbin/brctl addif Net0 uml3-eth1
host> /usr/sbin/brctl addif Net1 uml3-eth2
host> /usr/sbin/brctl addif Net3 uml3-eth3
host> /usr/sbin/brctl addif Net1 uml4-eth1
host> /usr/sbin/brctl addif Net2 uml4-eth2
host> /usr/sbin/brctl addif Net2 uml5-eth1
host> /bin/dd if=/dev/zero of=/var/vnuml/tutorial/uml1_opt_fs count=1 bs=1M
1+0 registros leídos
1+0 registros escritos
1048576 bytes transferred in 0,008030 seconds (130583098 bytes/sec)
host> /sbin/mke2fs -F /var/vnuml/tutorial/uml1_opt_fs
mke2fs 1.30-WIP (30-Sep-2002)
Filesystem label=
OS type: Linux
Block size=1024 (log=0)
Fragment size=1024 (log=0)
128 inodes, 1024 blocks
51 blocks (4.98%) reserved for the super user
First data block=1
1 block group
8192 blocks per group, 8192 fragments per group
128 inodes per group

Writing inode tables: 0/1   done                            
Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 39 mounts or
180 days, whichever comes first.  Use tune2fs -c or -i to override.
host> /bin/mount /var/vnuml/tutorial/uml1_opt_fs /mnt/uml -o loop
host> /bin/cat /root/.ssh/identity.pub >> /mnt/uml/authorized_keys
uml1> #!/bin/bash
uml1> # UML boot file generated by vnumlparser.pl at lun mar 21 12:09:13 CET 2005
uml1> hostname uml1
uml1> ifconfig eth0 192.168.1.146 netmask 255.255.255.252 up
uml1> ifconfig eth1 0.0.0.0 promisc up
uml1> ifconfig eth1  10.0.0.1 netmask 255.255.255.0
uml1> route -A inet add default gw 10.0.0.3
uml1> HOSTNAME=$(hostname)
uml1> grep $HOSTNAME /etc/hosts > /dev/null 2>&1
uml1> if [ $? == 1 ]
uml1> then
uml1>    echo >> /etc/hosts
uml1>    echo \# Hostname configuration >> /etc/hosts
uml1>    echo "10.0.0.1 $HOSTNAME" >> /etc/hosts
uml1> fi
host> /sbin/ifconfig uml1-eth0 192.168.1.145 netmask 255.255.255.252 up
host> /bin/chmod a+x /mnt/uml/umlboot
host> /bin/umount /mnt/uml
host> /bin/dd if=/dev/zero of=/var/vnuml/tutorial/uml2_opt_fs count=1 bs=1M
1+0 registros leídos
1+0 registros escritos
1048576 bytes transferred in 0,008995 seconds (116574034 bytes/sec)
host> /sbin/mke2fs -F /var/vnuml/tutorial/uml2_opt_fs
mke2fs 1.30-WIP (30-Sep-2002)
Filesystem label=
OS type: Linux
Block size=1024 (log=0)
Fragment size=1024 (log=0)
128 inodes, 1024 blocks
51 blocks (4.98%) reserved for the super user
First data block=1
1 block group
8192 blocks per group, 8192 fragments per group
128 inodes per group

Writing inode tables: 0/1   done
Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 28 mounts or
180 days, whichever comes first.  Use tune2fs -c or -i to override.
host> /bin/mount /var/vnuml/tutorial/uml2_opt_fs /mnt/uml -o loop
host> /bin/cat /root/.ssh/identity.pub >> /mnt/uml/authorized_keys
uml2> #!/bin/bash
uml2> # UML boot file generated by vnumlparser.pl at lun mar 21 12:09:18 CET 2005
uml2> hostname uml2
uml2> ifconfig eth0 192.168.1.150 netmask 255.255.255.252 up
uml2> ifconfig eth1 0.0.0.0 promisc up
uml2> ifconfig eth1  10.0.0.2 netmask 255.255.255.0
uml2> route -A inet add default gw 10.0.0.3
uml2> HOSTNAME=$(hostname)
uml2> grep $HOSTNAME /etc/hosts > /dev/null 2>&1
uml2> if [ $? == 1 ]
uml2> then
uml2>    echo >> /etc/hosts
uml2>    echo \# Hostname configuration >> /etc/hosts
uml2>    echo "10.0.0.2 $HOSTNAME" >> /etc/hosts
uml2> fi
host> /sbin/ifconfig uml2-eth0 192.168.1.149 netmask 255.255.255.252 up
host> /bin/chmod a+x /mnt/uml/umlboot
host> /bin/umount /mnt/uml
host> /bin/dd if=/dev/zero of=/var/vnuml/tutorial/uml3_opt_fs count=1 bs=1M
1+0 registros leídos
1+0 registros escritos
1048576 bytes transferred in 0,007581 seconds (138314788 bytes/sec)
host> /sbin/mke2fs -F /var/vnuml/tutorial/uml3_opt_fs
mke2fs 1.30-WIP (30-Sep-2002)
Filesystem label=
OS type: Linux
Block size=1024 (log=0)
Fragment size=1024 (log=0)
128 inodes, 1024 blocks
51 blocks (4.98%) reserved for the super user
First data block=1
1 block group
8192 blocks per group, 8192 fragments per group
128 inodes per group

Writing inode tables: 0/1   done                            
Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 24 mounts or
180 days, whichever comes first.  Use tune2fs -c or -i to override.
host> /bin/mount /var/vnuml/tutorial/uml3_opt_fs /mnt/uml -o loop
host> /bin/cat /root/.ssh/identity.pub >> /mnt/uml/authorized_keys
uml3> #!/bin/bash
uml3> # UML boot file generated by vnumlparser.pl at lun mar 21 12:09:23 CET 2005
uml3> hostname uml3
uml3> ifconfig eth0 192.168.1.154 netmask 255.255.255.252 up
uml3> ifconfig eth1 0.0.0.0 promisc up
uml3> ifconfig eth1  10.0.0.3 netmask 255.255.255.0
uml3> ifconfig eth2 0.0.0.0 promisc up
uml3> ifconfig eth2  10.0.1.1 netmask 255.255.255.0
uml3> ifconfig eth3 0.0.0.0 promisc up
uml3> ifconfig eth3  10.0.3.1 netmask 255.255.255.0
uml3> route -A inet add -net 10.0.2.0/24 gw 10.0.1.2
uml3> route -A inet add default gw 10.0.3.2
uml3> echo 1 > /proc/sys/net/ipv4/ip_forward
uml3> echo 1 > /proc/sys/net/ipv6/conf/all/forwarding
uml3> HOSTNAME=$(hostname)
uml3> grep $HOSTNAME /etc/hosts > /dev/null 2>&1
uml3> if [ $? == 1 ]
uml3> then
uml3>    echo >> /etc/hosts
uml3>    echo \# Hostname configuration >> /etc/hosts
uml3>    echo "10.0.0.3 $HOSTNAME" >> /etc/hosts
uml3> fi
host> /sbin/ifconfig uml3-eth0 192.168.1.153 netmask 255.255.255.252 up
host> /bin/chmod a+x /mnt/uml/umlboot
host> /bin/umount /mnt/uml
host> /bin/dd if=/dev/zero of=/var/vnuml/tutorial/uml4_opt_fs count=1 bs=1M
1+0 registros leídos
1+0 registros escritos
1048576 bytes transferred in 0,008039 seconds (130436408 bytes/sec)
host> /sbin/mke2fs -F /var/vnuml/tutorial/uml4_opt_fs
mke2fs 1.30-WIP (30-Sep-2002)
Filesystem label=
OS type: Linux
Block size=1024 (log=0)
Fragment size=1024 (log=0)
128 inodes, 1024 blocks
51 blocks (4.98%) reserved for the super user
First data block=1
1 block group
8192 blocks per group, 8192 fragments per group
128 inodes per group

Writing inode tables: 0/1   done                            
Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 26 mounts or
180 days, whichever comes first.  Use tune2fs -c or -i to override.
host> /bin/mount /var/vnuml/tutorial/uml4_opt_fs /mnt/uml -o loop
host> /bin/cat /root/.ssh/identity.pub >> /mnt/uml/authorized_keys
uml4> #!/bin/bash
uml4> # UML boot file generated by vnumlparser.pl at lun mar 21 12:09:28 CET 2005
uml4> hostname uml4
uml4> ifconfig eth0 192.168.1.158 netmask 255.255.255.252 up
uml4> ifconfig eth1 0.0.0.0 promisc up
uml4> ifconfig eth1  10.0.1.2 netmask 255.255.255.0
uml4> ifconfig eth2 0.0.0.0 promisc up
uml4> ifconfig eth2  10.0.2.1 netmask 255.255.255.0
uml4> route -A inet add default gw 10.0.1.1
uml4> echo 1 > /proc/sys/net/ipv4/ip_forward
uml4> echo 1 > /proc/sys/net/ipv6/conf/all/forwarding
uml4> HOSTNAME=$(hostname)
uml4> grep $HOSTNAME /etc/hosts > /dev/null 2>&1
uml4> if [ $? == 1 ]
uml4> then
uml4>    echo >> /etc/hosts
uml4>    echo \# Hostname configuration >> /etc/hosts
uml4>    echo "10.0.1.2 $HOSTNAME" >> /etc/hosts
uml4> fi
host> /sbin/ifconfig uml4-eth0 192.168.1.157 netmask 255.255.255.252 up
host> /bin/chmod a+x /mnt/uml/umlboot
host> /bin/umount /mnt/uml
host> /bin/dd if=/dev/zero of=/var/vnuml/tutorial/uml5_opt_fs count=1 bs=1M
1+0 registros leídos
1+0 registros escritos
1048576 bytes transferred in 0,008382 seconds (125098857 bytes/sec)
host> /sbin/mke2fs -F /var/vnuml/tutorial/uml5_opt_fs
mke2fs 1.30-WIP (30-Sep-2002)
Filesystem label=
OS type: Linux
Block size=1024 (log=0)
Fragment size=1024 (log=0)
128 inodes, 1024 blocks
51 blocks (4.98%) reserved for the super user
First data block=1
1 block group
8192 blocks per group, 8192 fragments per group
128 inodes per group

Writing inode tables: 0/1   done                            
Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 21 mounts or
180 days, whichever comes first.  Use tune2fs -c or -i to override.
host> /bin/mount /var/vnuml/tutorial/uml5_opt_fs /mnt/uml -o loop
host> /bin/cat /root/.ssh/identity.pub >> /mnt/uml/authorized_keys
uml5> #!/bin/bash
uml5> # UML boot file generated by vnumlparser.pl at lun mar 21 12:09:34 CET 2005
uml5> hostname uml5
uml5> ifconfig eth0 192.168.1.162 netmask 255.255.255.252 up
uml5> ifconfig eth1 0.0.0.0 promisc up
uml5> ifconfig eth1  10.0.2.2 netmask 255.255.255.0
uml5> route -A inet add default gw 10.0.2.1
uml5> HOSTNAME=$(hostname)
uml5> grep $HOSTNAME /etc/hosts > /dev/null 2>&1
uml5> if [ $? == 1 ]
uml5> then
uml5>    echo >> /etc/hosts
uml5>    echo \# Hostname configuration >> /etc/hosts
uml5>    echo "10.0.2.2 $HOSTNAME" >> /etc/hosts
uml5> fi
host> /sbin/ifconfig uml5-eth0 192.168.1.161 netmask 255.255.255.252 up
host> /bin/chmod a+x /mnt/uml/umlboot
host> /bin/umount /mnt/uml
daemon: /usr/local/share/vnuml/kernels/linux
   ubd0=/var/vnuml/tutorial/uml1_cow_fs,/usr/local/share/vnuml/filesystems/root_fs_tutorial
   ubd1=/var/vnuml/tutorial/uml1_opt_fs root=/dev/ubd/0 mem=50M eth1=tuntap,uml1-eth1,fe:fd:0:0:1:1
   eth0=tuntap,uml1-eth0 uml_dir=/var/vnuml/tutorial/ umid=uml1 con=null
daemon: /usr/local/share/vnuml/kernels/linux 
   ubd0=/var/vnuml/tutorial/uml2_cow_fs,/usr/local/share/vnuml/filesystems/root_fs_tutorial 
   ubd1=/var/vnuml/tutorial/uml2_opt_fs root=/dev/ubd/0 eth1=tuntap,uml2-eth1,fe:fd:0:0:2:1 
   eth0=tuntap,uml2-eth0 uml_dir=/var/vnuml/tutorial/ umid=uml2 con=null
daemon: /usr/local/share/vnuml/kernels/linux 
   ubd0=/var/vnuml/tutorial/uml3_cow_fs,/usr/local/share/vnuml/filesystems/root_fs_tutorial 
   ubd1=/var/vnuml/tutorial/uml3_opt_fs root=/dev/ubd/0 eth1=tuntap,uml3-eth1,fe:fd:0:0:3:1 
   eth2=tuntap,uml3-eth2,fe:fd:0:0:3:2 eth3=tuntap,uml3-eth3,fe:fd:0:0:3:3 
   eth0=tuntap,uml3-eth0 uml_dir=/var/vnuml/tutorial/ umid=uml3 con=null
daemon: /usr/local/share/vnuml/kernels/linux 
   ubd0=/var/vnuml/tutorial/uml4_cow_fs,/usr/local/share/vnuml/filesystems/root_fs_tutorial 
   ubd1=/var/vnuml/tutorial/uml4_opt_fs root=/dev/ubd/0 eth1=tuntap,uml4-eth1,fe:fd:0:0:4:1 
   eth2=tuntap,uml4-eth2,fe:fd:0:0:4:2 eth0=tuntap,uml4-eth0 uml_dir=/var/vnuml/tutorial/ 
   umid=uml4 con=null
daemon: /usr/local/share/vnuml/kernels/linux 
   ubd0=/var/vnuml/tutorial/uml5_cow_fs,/usr/local/share/vnuml/filesystems/root_fs_tutorial 
   ubd1=/var/vnuml/tutorial/uml5_opt_fs root=/dev/ubd/0 eth1=tuntap,uml5-eth1,fe:fd:0:0:5:1 
   eth0=tuntap,uml5-eth0 uml_dir=/var/vnuml/tutorial/ umid=uml5 con=null
host> /bin/mv /etc/hosts /etc/hosts.vnuml.old
host> /bin/cat /tmp/hostfile.1 /tmp/hostfile.2 /tmp/hostfile.3 > /etc/hosts
host> /bin/rm -f /tmp/hostfile.1 /tmp/hostfile.2 /tmp/hostfile.3
host> /bin/rm -f /var/vnuml/LOCK
Total time eslapsed: 32 seconds

Executing commands (start):

root@morfeo# vnumlparser.pl -x start@tutorial_plus.xml -v
host> /bin/touch /var/vnuml/LOCK
uml1 sshd is ready (socket style): 192.168.1.146 (mng_if)
uml1> #!/bin/bash
uml1> # UML commands sequence start - file generated by vnumlparser.pl 1.5.0-rc1 at lun mar 21 12:11:06 CET 2005
uml1> nohup /usr/bin/hello </dev/null >/dev/null 2>&1 &
host> /bin/chmod a+x /tmp/vnuml.uml1.start
host> /usr/bin/ssh -x -1 -l root 192.168.1.146 rm -f /root/vnuml.uml1.start &> /dev/null
host> /usr/bin/scp -q -oProtocol=1 /tmp/vnuml.uml1.start root@192.168.1.146:/root
host> /usr/bin/ssh -x -1 -l root 192.168.1.146 /root/vnuml.uml1.start
host> /bin/rm -f /var/vnuml/LOCK
Total time eslapsed: 31 seconds

Executing commands (stop):

root@morfeo# vnumlparser.pl -x stop@tutorial_plus.xml -v
host> /bin/touch /var/vnuml/LOCK
uml1 sshd is ready (socket style): 192.168.1.146 (mng_if)
uml1> #!/bin/bash
uml1> # UML commands sequence stop - file generated by vnumlparser.pl 1.5.0-rc1 at lun mar 21 12:11:44 CET 2005
uml1> killall hello
host> /bin/chmod a+x /tmp/vnuml.uml1.stop
host> /usr/bin/ssh -x -1 -l root 192.168.1.146 rm -f /root/vnuml.uml1.stop &> /dev/null
host> /usr/bin/scp -q -oProtocol=1 /tmp/vnuml.uml1.stop root@192.168.1.146:/root
host> /usr/bin/ssh -x -1 -l root 192.168.1.146 /root/vnuml.uml1.stop
host> /bin/rm -f /var/vnuml/LOCK
Total time eslapsed: 31 seconds

Destroying topology:

root@morfeo# vnumlparser.pl -d tutorial_plus.xml -v 
host> /bin/touch /var/vnuml/LOCK
uml1 sshd is ready (socket style): 192.168.1.146 (mng_if)
uml2 sshd is ready (socket style): 192.168.1.150 (mng_if)
uml3 sshd is ready (socket style): 192.168.1.154 (mng_if)
uml4 sshd is ready (socket style): 192.168.1.158 (mng_if)
uml5 sshd is ready (socket style): 192.168.1.162 (mng_if)
host> /usr/bin/ssh -x -1 -l root 192.168.1.146 halt
host> /usr/bin/ssh -x -1 -l root 192.168.1.150 halt
host> /usr/bin/ssh -x -1 -l root 192.168.1.154 halt
host> /usr/bin/ssh -x -1 -l root 192.168.1.158 halt
host> /usr/bin/ssh -x -1 -l root 192.168.1.162 halt
---------- Waiting until UML extinction ----------
12 seconds elapsed...
18 seconds elapsed...
23 seconds elapsed...
host> /sbin/route -A inet del -net 10.0.0.0/16 gw 10.0.3.1
host> /sbin/ifconfig uml1-eth0 down
host> /usr/sbin/tunctl -d uml1-eth0 -f /dev/net/tun
Set 'uml1-eth0' nonpersistent
host> /sbin/ifconfig uml1-eth1 down
host> /usr/sbin/tunctl -d uml1-eth1 -f /dev/net/tun
Set 'uml1-eth1' nonpersistent
host> /sbin/ifconfig uml2-eth0 down
host> /usr/sbin/tunctl -d uml2-eth0 -f /dev/net/tun
Set 'uml2-eth0' nonpersistent
host> /sbin/ifconfig uml2-eth1 down
host> /usr/sbin/tunctl -d uml2-eth1 -f /dev/net/tun
Set 'uml2-eth1' nonpersistent
host> /sbin/ifconfig uml3-eth0 down
host> /usr/sbin/tunctl -d uml3-eth0 -f /dev/net/tun
Set 'uml3-eth0' nonpersistent
host> /sbin/ifconfig uml3-eth1 down
host> /usr/sbin/tunctl -d uml3-eth1 -f /dev/net/tun
Set 'uml3-eth1' nonpersistent
host> /sbin/ifconfig uml3-eth2 down
host> /usr/sbin/tunctl -d uml3-eth2 -f /dev/net/tun
Set 'uml3-eth2' nonpersistent
host> /sbin/ifconfig uml3-eth3 down
host> /usr/sbin/tunctl -d uml3-eth3 -f /dev/net/tun
Set 'uml3-eth3' nonpersistent
host> /sbin/ifconfig uml4-eth0 down
host> /usr/sbin/tunctl -d uml4-eth0 -f /dev/net/tun
Set 'uml4-eth0' nonpersistent
host> /sbin/ifconfig uml4-eth1 down
host> /usr/sbin/tunctl -d uml4-eth1 -f /dev/net/tun
Set 'uml4-eth1' nonpersistent
host> /sbin/ifconfig uml4-eth2 down
host> /usr/sbin/tunctl -d uml4-eth2 -f /dev/net/tun
Set 'uml4-eth2' nonpersistent
host> /sbin/ifconfig uml5-eth0 down
host> /usr/sbin/tunctl -d uml5-eth0 -f /dev/net/tun
Set 'uml5-eth0' nonpersistent
host> /sbin/ifconfig uml5-eth1 down
host> /usr/sbin/tunctl -d uml5-eth1 -f /dev/net/tun
Set 'uml5-eth1' nonpersistent
host> /sbin/ifconfig Net0 down
host> /usr/sbin/brctl delbr Net0
host> /sbin/ifconfig Net1 down
host> /usr/sbin/brctl delbr Net1
host> /sbin/ifconfig Net2 down
host> /usr/sbin/brctl delbr Net2
host> /sbin/ifconfig Net3 down
host> /usr/sbin/brctl delbr Net3
host> /bin/mv /etc/hosts /etc/hosts.vnuml.old
host> /bin/cat /tmp/hostfile.1 /tmp/hostfile.2 /tmp/hostfile.3 > /etc/hosts
host> /bin/rm -f /tmp/hostfile.1 /tmp/hostfile.2 /tmp/hostfile.3
host> /bin/rm -f /var/vnuml/tutorial/lock
host> /bin/rm -f /var/vnuml/LOCK
Total time eslapsed: 120 seconds

Last update: