Skip to content

Steps for Installing Ubuntu & ns-3 under WSL  of Windows 10.

 This article explains the way of installing Ubuntu Linux and ns-3 network simulator under WSL2 of Windows 10 and doing ns-3 simulations under Windows 10.  In this procedure, we will install our choice of ns-3 version by installing the current ns-3-dev version and downgrading it to the lower ns-3 version of our choice. In this example, we will install ns-3.35 using ‘waf’ based compile process.

One may check the following article for the  detailed procedure for installing WSL2 under Windows 10

Installing WSL2 Under Windows 10 and Running GUI Linux Apps.

Installing WSL2 Under Windows 10  for doing ns-3 Simulations

One may find a detailed installation procedure for installing WSL2 under Windows 11 and using GUI based Linux application in[2]

Step 1: Install WSL2 using windows Powershell

Run Windows Powershell  with Administrator privilege and issue the following command:

c:UsersUserNamewsl --install

Restart your computer to finish the WSL installation on Windows 10.

Step 2: Install the choice of your Linux from Microsoft Store

In this example, after running Microsoft Store, we searched for Ubuntu and started to install it by pressing the get button

If we click the “get” button, it will start downloading ubuntu and then installing it.

 

Step 3: Running the Ubuntu Shell

Start the newly installed Ubuntu from the start menu.

 

Step 4: Updating Ubuntu Package Repository

 

# apt-get update

The following screenshot shows the completion of the update operation :

 

Step 4: Installation of the Dependencies

If ‘git’ is not installed on your system, first install it.

$ apt-get install git
$ apt-get install libc6-dev
The following screenshot shows the completion of libc6-dev installation:
 
 
$ apt-get install sqlite sqlite3 libsqlite3-dev
The following screenshot shows the completion of the dependency library installation:
 

 

$ apt-get install build-essential
The following screenshot shows the completion of the installation of the build essentials:

 

Step 5: Download ns-3-dev Version

Download a working copy of the ns-3-dev repository as follows:
Here, we assume that the current dev version is equal to ns-3.35. So in future, you may need to install the appropriate version of ns-3 which is compatible with nr and nr-u modules.
 
$ cd /home/your_home/
$ git clone https://gitlab.com/nsnam/ns-3-dev.git
The following screenshot shows the successful clone operation:
 

 

Step 6: Downgrade the ns-3-dev version to ns-3.35

$ cd ns-3-dev

At this step, you can switch to the compatible ns-3 release branch as follows:

$ git checkout ns-3.35
The following screenshot shows the successful ns-3 downgrade operation:

 

Step 7: Configure ns-3

 
$  ./waf configure –enable-examples –enable-tests
The following screenshot shows the output of configure command
 

 

Step 8: Compile the Default ns-3-dev

$ ./waf build
If you are using CMake,  to compile ns-3, then it  may end up with some errors.

You may correct this error as follows:

Hidden Section! Contact Charles  

The key/passphrase will be given once you have been approved for getting paid research support/assistance from Charles. To get paid support, you may start a 'free' research discussion.  

WhatsApp chatDiscuss Through WhatsApp
 

The following screenshot shows the successfully compiled modules under ns-3.35

 

Step 9: Testing the ns-3 installation by running an Example Simulation

After the successful compilation of ns-3, we may test its working by running an example simulation.

 

$ cd /home/ns-3-dev
$ ./waf –run first
Now the simulation will run and produce the following output at the end of the simulation.

 

Conclusion

With Windows 10 and WSL2 support, we can run ns-3 simulations. Of course, the overall compilation process of ns-3 took very much time on the WSL of Windows 10. For me, even on an 11th-generation Core i5 Intel laptop processor, it took a very long time to compile ns-3(if we compare it with a native Linux installation). In fact, the default installation of Windows 10 only provides around 50% CPU for the ns-3 compilation process. But I think, even if we provide 100%CPU, the compilation performance will never come near to the native Linux installation.

So, for those who worry about speed and performance in the ns-3 compiling process and doing simulation, definitely WSL is not at all a solution. For people who love to stick to Windows, they may live with poor ns-3 compiling performance, in case, they will not do the compilation repeatedly very often.

For Linux lovers, particularly researchers those who do network simulations with tools like ns-3,  using Linux under WSL will be a great tragedy and a nightmare.

 

The following Procedure explains the installation of ns-3 and NetAnim Under Windows 11 with WSL2 :

 

Installing ns-3 and NetAnim Under New Windows 11 Using WSL2 

The following Procedure explains the installation of OMNet++ IDE Under Windows 11 with WSL2 :

Installing OMNet++ IDE Under new Windows11 Version Using WSL

 

 Meantime, one may try the following installation procedures under WSL2.

https://www.projectguideline.com/installing-aquasim-aqua3d-on-an-old-linux-under-virtualbox/

Installing Aquasim & Aqua3D on an old Linux under VirtualBox

 

References 

  1. https://docs.microsoft.com/en-us/windows/wsl/about
  2. https://ubuntu.com/tutorials/install-ubuntu-on-wsl2-on-windows-11-with-gui-support#1-overview
  3. https://www.projectguideline.com/installing-wsl2-under-windows-11-and-running-gui-linux-apps/
WhatsApp Discuss Through WhatsApp