NS2 and UBUNTU Installation on VMWARE

There are multiple ways that you can adopt to install ns2. As ns2 runs on the linux. so first you will have to install linux. You can install any distribution of linux fedora, ubuntu etc.

So, one way to do the installation is to first install this software called VMWARE. It creates a virtual machine which allows you to run operating system on another operating system just like any other application. Other ways include by installing Ubuntu direct from website using windows installer. Lets look at the first option.
So,

Install Vmware

Install fedora or any other Linux distribution on VMware. Select ‘New Virtual Machine’ option.

2

Click Next.
 3



Select Typical.
 4
Select Linux and Ubuntu.

 5
Next …
 6
Select Bridged networking.
 7
You can change the hard disk space availability for your virtual machine based on your needs and available space. Click Finish.

 8
Now, that we have create our virtual machine, let us set some more parameters.

 9
Set RAM that will be available for this virtual machine.

 10

This is the important part. Here you give the path of the ISO image of the ubuntu file by selecting the ‘Use ISO image’ option and giving the path by browsing it as follows.

 12
Now, when you click on the start this virtual machine .
 ns2
For the very first time, when it loads it will start installation. I have done that already. So, my ubuntu is loading.

 14
You can also use FULL SCREEN mode of virtual machine.

 15
Now, let us install ns2. Download ns2 from the following link.
NS2 Download
It is in zipped folder. You will have to extract it twice. Then,
Go to the ns2 folder and run the install file by applying following command.
. /install
 16
Installation starts. It will take a minute or two.
 17
Continued…
 18
…………
 19

And it ends. Do not worry about the error messages. It will be fine.

 20

Now, let us set environment variables and set the paths.
Run, command ‘gedit ~/.bashrc’.
 21

Set the following paths. Set the right folder hierarchy according to your own like i have set mine as follows.

 22
 23

Now, if we write ns command and press enter. If we see this % sign, this means that our ns2 installation is successful.
Hurrah.
FYI, if you dont see the % sign and instead see some errors, run the following command.
sudo apt-get install ns2 nam xgraph
Provide the password. It will download some packaged online and install ns2.
Now, let us create a file. Write some TCL code and run it. Just for fun :)

 24

Let us write some code.
 25
Now, let us run it as follows.

 26


Reactions:

21 comments:

  1. Hi,

    I was following the tutorial to install ns-allinone-2.35 package on my xubuntos-2.1.4 image (ubuntu 8.04) installed on a vmware virtual machine. I have followed all the mentioned steps but still not getting % on terminal when I type ns after installation. Can you help me out please?

    Akshay

    PS: I changed all the paths according to the my package version and it's location

    ReplyDelete
    Replies
    1. Just saw your message akshay . Sorry for late reply. You need internet connectivity for the installation because it needs to download some packages online. Please make sure internet is enabled on your virtual machine. Then write

      sudo apt-get install ns2 nam

      Delete
  2. when i give this command "ns" it produced the following error
    Command not found. Similar command is: 'nc'
    will u plz help me its urgent..

    ReplyDelete
    Replies
    1. thats the message you get when your ns installation is not complete. You can write the following command and run it.

      sudo apt-get install ns2 nam xgraph
      Provide the password. It will download some packaged online and install ns2.

      You surely need internet connectivity for that. Otherwise, your problem cannot be resolved.

      Delete
  3. Your simple description on installing NS2 is simply awesome.

    ReplyDelete
  4. IPTradex provides best VoIP calls with Lowest rates.

    For more details:
    http://goo.gl/aitxHJ

    ReplyDelete
  5. hey i m using linux instead of ubuntu...so please tell me how to write a trace file in it ...after doing all the installation part

    ReplyDelete
  6. NS2,JAVA,MATLAB,ANDROID,OPNET,OMNET,CLOUDSIM,GSM,GPS,RFID,ARM,VLSI,ZIGBEE,LABVIEW project support
    http://www.starstudentproject.com/
    http://www.starstudentproject.com/ns2-projects-2/

    ReplyDelete
  7. Listen to this funny story of mine:

    I play Natural Selection 2 and I was looking for a tutorial on how to install NS2 server, I blindly and successfully installed ns2 (the one in your article) into a vm running ubuntu and I still have not got Natural Selection 2 server.

    I realised this when your tutorial did not say anything about the next steps of configuring the server !

    Anyways, thank you for the mind stimulation when I did all this.

    ReplyDelete
    Replies
    1. hahaha .. just hillarious ... thats what happens when u follow it without reading it :)

      Delete
  8. I followed this tutorial but unfortunately didn't able to succeed. I get "The program 'ns' is currently not installed. You can install it by typing:
    sudo apt-get install ns2".
    When I type sudo apt-get install ns2 nam xgraph I get "Reading package lists... Done
    Building dependency tree
    Reading state information... Done
    E: Unable to locate package ns2
    E: Unable to locate package nam
    E: Unable to locate package xgraph
    "

    ReplyDelete
  9. Hey can i install ns-2.34 in ubuntu on vm-ware?

    ReplyDelete
    Replies
    1. please answer this....

      Delete
    2. Hey there,

      once , u install ubuntu on vm-ware . U can do anything that u can do on ubuntu . Its no different . You can easily install ubuntu 2.34 on it ..
      Better would be to download ubuntu 2.34 and then install it manually .

      Rather than installing it using this command .

      sudo apt-get install ns2

      Hope u got ur answer.

      Delete
    3. thank you very much Usman Ashraf Saab

      Delete
  10. Thank you very much for the post

    ReplyDelete
  11. This comment has been removed by the author.

    ReplyDelete
  12. I also recommend you to watch this ubuntu installation video.
    https://www.youtube.com/watch?v=-DLZETe0onY

    ReplyDelete