在VMware下的Ubuntu7.04中安装NS2

Windows XP SP2 + VMware6.0.0 + Ubuntu7.04 + VM tools + NS-allinone-2.31

1.       Install VMware6.0.0

2.       Start new virtual machine and install Ubuntu7.04 using “ubuntu-7.04-desktop-i386.iso”


Install VM tools------------------------------------------------------------------------------------------------------------

3.       Select VM -> Install VMware tools VMware6.0.0 in the Menu of VMware6.0.0 and Extract “VMware-linux-tools.tar.gz” to “Desktop”

4.       Select Applications -> Accessories -> Terminal in the Menu of Ubuntu7.04,

write “sudo –i” to use root,

cd vmware-tools-disturb

./vmware-install.pl

(if you don’t know how to config it, select default by using ‘Enter’ key)

5.       Select System -> Administration -> Update manager in the Menu of Ubuntu7.04

Install update

6.       Select Edit -> Preferences in the Menu of VMware6.0.0 and make sure “Enable all shared folders by default” is selected.

7.       Select VM -> Settings in the Menu of VMware6.0.0 and turn to the “option” tab, select shared folders and make sure Folder sharing select “Always enabled” and Add a “Folders”

Now you can copy the “ns-allinone-2.31.tar.gz” to the shared folder.

You can see it in the /mnt/hgfs in the filesystem of Ubuntu7.04.

Copy “ns-allinone-2.31.tar.gz” to /home/”your username”



Install NS2-------------------------------------------------------------------------------------------------------------------

8.       Select Applications -> Accessories -> Terminal in the Menu of Ubuntu7.04,

write “sudo –i” to use root,

apt-get install build-essential

           (for gcc and some essential)

apt-get install tcl8.4 tcl84.-dev tk8.4 tk8.4-dev

           (for tcl and tk)

apt-get install libxmu-dev

           (for nam)

9.       Select Applications -> Accessories -> Terminal in the Menu of Ubuntu7.04,

write “sudo –i” to use root,

cd /home/”your username”

tar xvfz ns-allinone-2.31.tar.gz

           (Extract ns-allinone-2.31.tar.gz)

cd ns-allinone-2.31

./install

           (install ns-allinone-2.31)

10.   Waiting for its end.

cd ..

gedit .bashrc

write below and save

export PATH=$PATH:/home/”your username”/ns-allinone-2.31/bin:/home/”your username”/ns-allinone-2.31/tcl8.4.14/unix:/home/”your username”/ns-allinone-2.31/tk8.4.14/unix

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/”your username”/ns-allinone-2.31/otcl-1.13:/home/”your username”/ns-allinone-2.31/lib

export TCL_LIBRARY=$TCL_LIBRARY:/home/”your username”/ns-allinone-2.31/tcl8.4.14/library

         Now you should log-out Ubuntu to reload “environment variables”

11.   cd ns-2.31

./validate

           (validate install)

validate overall report: all tests passed

12.   sudo apt-get install gawk

(for gawk)

13.   sudo apt-get install gnuplot

(for gnuplot)

14.   If you want use “Xgraph” you should add PATH to LD_LIBRARY_PATH:

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH: $PATH :/home/”your username”/ns-allinone-2.31/otcl-1.13:/home/”your username”/ns-allinone-2.31/lib

Now you should log-out Ubuntu to reload “environment variables”