The Cloonix development team recently released Cloonix version 21. The new version includes some significant improvements, such as support for Cisco software images (via Dynamips) and support for 32-bit architectures. The Cloonix developers also added a large library of prepared filesystems including new, lightweight versions of popular linux filesystems, such as debian, ubuntu and fedora, and open-source routers, such as Vyatta and openWRT.
In version 21, Cloonix now runs on 32-bit and 64-bit versions of Ubuntu, Debian, and Fedora. Cloonix provides pre-compiled packages for those systems.
Cloonix will also compile and run on other Linux distributions. We will show how to compile and run Cloonix v21 on Knoppix Linux and discuss the new features in v21 that make Cloonix even more interesting as an open-source network simulator.
This post is an update to a previous post about compiling the Cloonix open-source network simulator in Knoppix, in which I described how to install Knoppix on a USB flash drive and boot Knoppix from the USB drive.
In that previous post, we used a special version of Cloonix provided by the Knoppix development team. Cloonix v21 incorporates the support for 32-bit systems from the special version so, while the compile procedure is updated below, the procedure to install and boot Knoppix is the same.
So, we will assume you are already running Knoppix and now we will discuss installing Cloonix v21 in Knoppix. Now that Cloonix supports 32-bit architectures, you do not need to enter any special boot codes when booting Knoppix; just let it run the default configuration.
Download Cloonix v21 source files
Cloonix is updated frequently, as often as every two months. The links in this post link to the Cloonix version 21 files on the Cloonix web site. Please check the web site and look for the latest version of Cloonix before downloading any files.
To download the Cloonix source files, go to the Downloads link on the Cloonix web site that is associated with the latest release. In this case, it is Downloads V21.
In the Downloads page, select the Cloonix tree link. In this case, it is Cloonix tree v21.
On the Cloonix tree page, you will see links to the source files and too pre-compile packages for various Linux distributions. Select the source files link. In this case, click on the cloonix-21.3 link to download a compressed archive containing the files.
After the download is complete, extract the contents of the archive to a folder on your Knoppix system. In this example, I chose the home folder. A new folder is created containing the source files, the README file, and the compile scripts. To extract the files, use the Archive Manager program provided by the Knoppix distribution or use the linux tar command.
Install prerequisite packages
Now that the main stream of Cloonix supports 32-bit architectures, we can just follow the steps described in the README file that comes with the Cloonix source code. We just have to perform one extra step because Knoppix uses a library version that needs to be replaced to allow Cloonix to compile.
First, install the required packages:
$ sudo modprobe kvm-intel nested=1 $ sudo chmod 666 /dev/kvm $ sudo apt-get update $ sudo apt-get --allow-unauthenticated -y install build-essential libncurses5-dev libssl-dev libgtk2.0-dev libcap-dev libevent-dev libreadline-dev
Then, we need to perform one extra step. We must replace the libsdl1.3-dev package (which is the default version in the Knoppix repository) with the libsdl1.2-dev package. The 1.3 version causes the compile script to fail. Execute the command, which will remove libsdl1.3-dev and then install libsdl1.2-dev:
$ sudo apt-get install libsdl1.2-dev
Compile and run Cloonix v21 in Knoppix
To compile Cloonix, go to the cloonix directory — in this example, it is ~/cloonix-21.3 and run the doitall script.
$ cd ~/cloonix-21.3 $ ./doitall
Important Note: Do not use the sudo command to run the doitall script. you must run the doitall script as a normal user or Cloonix will encounter problems with file permissions when it runs.
Download the Cloonix filesystems
Cloonix provides filesystems that are used to launch the virtual machines in the network simulation. A wide variety of filesystems are available. If you are running cloonix in a 32-bit system, use filesystems who have filenames ending in “i386” or “i686”.
Currently, some filesystems are stored in the version 21 directory and some are stored in the version 20 directory.
To find the filesystems, click on one of the download links in each directory (example: Downloads V20 and then click on one of the guests link.
When you download a guest filesystem, extract the contents of the archive to the bulk directory in the cloonix directory. For example: ~/cloonix-21.3/bulk.
On a Knoppix system configured with persistent storage and running on a USB flash drive, you only have 4GB of space to store files. So, pick just the filesystems you need.
Run Cloonix v21
Now, Cloonix is installed and the filesystems you plan to use are stored in the bulk directory.
To start Cloonix, first ensure KVM is enabled (you enabled it earlier in this tutorial but it needs to be enabled after each restart).
$ sudo modprobe kvm-intel nested=1 $ sudo chmod 666 /dev/kvm
To start Cloonix, navigate to the Cloonix directory (example: ~/cloonix-21.3) and run the following scripts in the Cloonix directory:
$ ./start_cloonix_net $ ./graph
To stop Cloonix, execute the kill command in the Cloonix directory:
$ ./ctrl -k
We installed Cloonix v21 in a 32-bit Knoppix system.