Skip to content

Installing ns-3-dev Under chroot Jail and Compile with CMake

In a previous article we explained the way of installing ns-3.35 under chroot jail. But installing ns-3-dev in the same way is not possible under chroot jail because, ns-3-dev  configure and compile process will not allow running configure and compile script ‘ns3’ as root user which is the default user privilege under chroot.

In this article, we will see a trick to install ns-3-dev under chroot-jail 

The following article explains a chroot jail based installation of ns-3.35. 

Installing ns3.35 in Debian 10 chroot Jail Under Debian 11 Host OS or any Version of Linux Host


That article explained the following :

  1. Problems that we face during installing ns-3 under Native and Virtual Hardware/OS,
  2. Chroot based Virtualization,
  3. Advantages of installing ns-3 Under Chroot Jail Based Virtualization.
  4. Installation of Debian 10 Buster (64 bit) chroot Jail Environment under Debian 11
  5. Installation of ns-3 Under Chroot Jail and and
  6. Installation of NetAnim Under Chroot Jail

In the above-mentioned steps, instead of installing ns-3.35 at the 5th step, we are going to install ns-3-dev version as per the following procedure since we can not install the latest ns-3-dev in the same way since the installation script “ns3” will not allow us to run it as root user.

This procedure assumes that the user already set up a chroot jail and installed a suitable Linux OS under it. (I mean, up to step 4 in the above-mentioned list).


Installation of ns-3-dev under chroot

Step 1: Downloading ns-3-dev using “git”

You may download a compressed version of ns-3-dev or directly clone it using “git” command. The following shows the way of cloning ns-3-dev project repository using “git” command.  Here we try to install ns-3-dev under a folder named “/home” (even though /root is the default privileged home directory of the user root under chroot jail)

$ cd /home
$ git clone

The above command will clone the entire ns-3-dev project under the folder home. So, now the folder /home/ns-3-dev will contain the dev

Step 2: Editing the configuration and installation script “ns3”

The following shows the section/lines that needed to be edited.

Sorry!!!. Some sections are hidden; because, you are only having restricted access to this article.

While getting paid support/assistance for your research from Charles, you may get an access key/password to some articles. If you are having the access key/password to this particular article, then please enter it below to unlock the restricted section of this article.

If your research is related to this area, and you want to get paid support/assistance from Charles, then you may start a 'free' research discussion with Charles.


Step 3: Configure the ns-3-dev

$ cd /home/ns-3-dev
$ ./ns3 configure –enable-examples –enable-tests
The following screenshot shows the successful “configure operation” in which you can see the modules that are configured to build.

Step 4: Compiling ns-3-dev

$ cd /home/ns-3-dev
$ ./ns3
Running the script from the folder ~/ns-3-dev will compile ns-3-dev using CMake.

The following screenshot shows the successful installation of ns-3-dev under chroot jail.

Step 4: Testing the Installation by Running an Example

We may test the installation by running the example script as follows:

$ cd /home/ns-3-dev
$ ./ns3 run first
The following screenshot shows the installation completed good so that the example script is running and producing outputs correctly.


Final Note :

The important thing we have to understand here is, the application which is running under chroot jail environment will get the native or near-native performance of the Host OS and Host hardware. So, we are getting the native software and hardware performance under this unique virtualization technology. So that the ns-3 compile process also gets accelerated and get near-native software and hardware performance.

Some Examples of “chroot-jail” based ns-3 Simulations

In the following articles, you may find some of the simulations that I did under chroot jail. Please note the excellent performance of these GUI based 3D simulations. In fact, these simulations are actually running under chroot jail but the GUI 3D outputs are rendered in the Host Disply’s windowing system. So that these simulations are getting the native 3D performance.  One will never get such a level of performance under any other kind of virtualization like “VirtualBox”.



For Assistance in Protocol Implementation, Simulations & Analysis of Industrial as well as Scholarly Research Works, you may Contact Us.

WhatsApp chatDiscuss Through WhatsApp

Call 91 9843779735

Send an e-Mail Message.

This site is protected by reCAPTCHA and the Google
Privacy Policy and
Terms of Service apply.

WhatsApp Discuss Through WhatsApp