Skip to content

Why People Face Problems While Installing Cygwin Under Virtualbox – Particularly for ns2

cygwin-logoIf you search for help regarding the installation of Cygwin, particularly for the installation of ns2, you will come to know about a lot of bad experiences of previous researchers or students.

The reasons for the failure of a Cygwin installation on Windows is version-specific – it depends upon both the version of Windows as well as the version of Cygwin.

Generally,  any version of Cygwin can not be even installed on a Windows version greater than Windows XP without problems ( as far as ns2 is concerned), And,  on a 64-bit version of the latest Windows OS,  almost no chance at all.

Some of the technical reasons

The following are some of the reasons for the failure of a Cygwin installation on a higher version of Windows XP

  • The thread implementation in Windows Vista or Windows 7 is said to be entirely different from previous versions of windows (98 and XP) which will conflict with the architecture of Cygwin.
  • The memory management  and addressing methods are also said to be entirely different in Windows Vista or Windows 7 and  entirely different from the previous version of windows (98 and XP)
  • Most Importantly, the ‘X-windows’ part of Cygwin components will not function on Windows Vista or Windows 7 – the ns2 will need that part for NAM Animation and Xgraph or GNU Plot.

But you can install visualization software like VirtualBox/VMWare/Microsoft Virtual PC
and then install Windows XP on the virtual machines – and then install Cygwin on that virtual host. – but the performance will be a little bit poor.

As a research scholar/student, one should be well familiar with this kind of installations under visualization technology.
Never use a Microsoft OS other than Windows XP  for ns2 related research work. You will certainly face LOT of problems while using Vista Windows, Windows 7  and Higher (especially 64-bit version of it) and trying to install Cygwin on it.

 

Trying a Native XP Installation on a New Laptop 

Ok, Even if you may be able to install Windows XP (32bit/64bit) on your latest laptop/commuter. But in that case, you will be able to use only less than 4Gb ram of your machine (since the latest laptops come with a LOT of memory) All the 32 bit operating systems can able to access only 4GB of RAM. Further Nowadays, you can not able to find all the Windows XP drivers for your latest hardware if you try to install XP on it. So you will end up with problems such as “No Sound”, “Poor Video Quality and Performance”, “WiFi Not working”  etc. etc.,

If you will be only using ns2, for your research then installing it on native Linux is the only good option. Because ns2 will work really very fast on all Linux Variants.

To Understand this speed, there is a test called ‘fork speed test’ – if you get a larger number in that test under a particular Operating system, then it means ns2 will work in that environment very fast on that Operating System.

Type the following command in your terminal (both Cygwin / Linux) and feel the difference

(see more about this at http://superuser.com/questions/133313/can-i-speed-up-cygwins-fork)

 

$ while (true); do date --utc; done | uniq -c
 5 Wed Apr 21 12:38:10 UTC 2010
 6 Wed Apr 21 12:38:11 UTC 2010
 1 Wed Apr 21 12:38:12 UTC 2010
 1 Wed Apr 21 12:38:13 UTC 2010
 8 Wed Apr 21 12:38:14 UTC 2010
 8 Wed Apr 21 12:38:15 UTC 2010
 6 Wed Apr 21 12:38:16 UTC 2010
 1 Wed Apr 21 12:38:18 UTC 2010
 9 Wed Apr 21 12:38:19 UTC 2010

See the number in the left column

The Available  Installation options 

The following are some of the installation options and their performance.

In Windows 7 64 bit with Cygwin 1.7 install, I am getting the number 1 to 3
In Windows 7 64 bit with Cygwin 15 install ( under Windows XP virtual box install), I am getting the number 10 to 20
In Windows XP 64 bit with Cygwin 1.5 native install, I am getting the number 20 to 30
In Windows XP 32 bit with Cygwin 1.5 native install, I am getting the number 30 to 40
*Under Linux, Windows XP +Cygwin 1.5 on the VirtualBox – 100 to 140
*Under Linux the same fork speed index was between 300 to 600

So, imagine the difference in speed in the different combinations of installations mentioned above.

Under Linux, the whole ns2 installation/compile is amazingly taking only one or two minutes (using multiprocessing enabled make) 

The same will take at least 10 or 20 minutes under a poor Operating System environment

Just imagine the difference in speed.
So, if you have to install ns2.35 for your research or project, then just do a native install of any of the latest Linux such as Ubuntu. Fedora (or Arch in case you are an expert)  – You will get maximum performance of ns2 out of it.
Or, if you need to use a particular lower version of ns2 such as ns2.28 or ns2.21b (some researches need that), then install Virtualbox on Ubuntu and then install XP + Cygwin 1.5 and then install ns2.28 or ns2.21b  – you will have a very decent performance from this XP + Cygwin environment..  Installing  ns2.28 or ns2.21b or any such lower versions of ns2 on the latest Linux variant mostly will fail because the new GCC version comes along with that new Linux OS.

So, the last two starred installation options in the above-mentioned list are only advisable.

 

The  ns2  working environment  which I use and preferred to use for Research :

See an example of the ns2  working environment  – in the past years, I used different OS environments – in the last 16 years, I used different ns2 working environments with different operating systems. According to me, what I am using now for the research is the most optimum solution. for me since I often use lower ns2 versions as well as the latest versions of ns2. In fact, I am having almost a hundred different ns2 installations – which was configured/patched for different routing and transport protocols and agents. Under this installation framework, I can switch from one particular ns2 version to another just in seconds (just by changing a folder name)

Carefully see the snapshot of my lUbuntu Desktop in the following image.

The left side terminal window is Cygwin’s terminal window – the right-side terminal window is Ubuntu’s terminal window.

The left side panel belongs to Windows XP and the Bottom Panel belongs to LUbuntu. I can use both of them simultaneously.
If you will be able to zoom in and see the text output of the two black terminal windows, you can see the difference in speed.

ns2 on Windows+cygwin and linux

 

Just try any of your /your friend’s Cygwin installation and a Linux installation with this command.  Just type this command in the terminal window.

while (true); do date --utc; done | uniq -c

You will realize the difference between the speed of my installation and your/your friend’s installation.

If you are having more recent hardware, then you will have a little bit higher performance.

 

My Bad Experience with using SSD while trying to get super fast simulation performance of ns2 to reduce overall simulation time.

A few months back, I planned to use an SSD (OCZ Agility 3 SSD) and purchased it from a US seller through Amazon.com.
It was very very fast – I was able to boot ubuntu in 6 seconds – Windows 7 in 7 seconds with that SSD.
But, the performance of Cygwin under virtual Windows XP install was not so good.  So, I avoided using that SDD. (I understood the reason for this poor performance of SSD under Cygwin – if possible, I will confirm it and then share it here later)

Then, without giving up, I decided to use a hybrid HDD (Seagate Optimus XT – A 7200 RPM SATA HDD with inbuilt 4GbSSD for optimum performance- it is a SATA SSD- HDD hybrid)
The boot time with this hybrid device was higher than a normal 7200 RPM HDD and (a very little bit) slower than an SSD.
But amazingly, the performance of Cygwin under virtual Windows XP install was Very very good with this hybrid HDD.

I did 3 months of research on my OCZ agility 3 SSD and Seagate Optimus XT hybrid drive.

Finally chose to use my Seagate Optimus XT hybrid drive instead of the most expensive SSD on my new laptop.

The new laptop originally came with a 1000GB HDD – I just throw it in the dust bin (  🙂 later I may use it as a backup device) – because these 5400 RPM HDD’s are useless ones. Their performance will be very very poor on any operating system.

 

If you see the following ‘fork test’ results which I did under a different operating condition, then you may understand the reason why I chose the SSD-HDD hybrid drive.

The following test can be used to test the performance of the fork.

# while (true); do date --utc; done | uniq -c
  1. (normal 5200rpm HDD) With Cygwin under native XP  installation it is giving around 60 to 70 (see the first column number)
  2. (normal 5200rpm HDD) With native arch installation, it is giving around 300 to 500
  3. (normal 5200rpm HDD) With Cygwin under XP in VirtualBox, it is giving around 60 to 70 (near XP performance with some installation issues)
  4. (SSD) With native Linux, it is giving 300 to 600 as result.
  5. (SSD) With Cygwin under XP in VirtualBox, it is giving around 15 to 20
  6. (SSD) With Cygwin under XP in VMware it is giving around 30 to 40 (so the performance of ./configure and make is two times better than VirtualBox)

So, under virtualization, the performance of ./configure and make operations (which a researcher do very often while doing research using ns2)  is very poor. So, if you are trying to write a new protocol agent in c under ns2 and trying to do modifications often, and compile ns2 again and again, and if you are doing it under Cygwin on an SSD installation, then you will certainly get irritated by the worst compile performance.

This is due to the internal design of fork mechanism, timers, interrupts etc., etc., under the virtual hardware+Cygwin  which is just mimicking Unix/Linux environment.

I installed the latest Vmware in Arch Bang  Linux and studied the performance of Cygwin under Wmware+Windows XP.  Even though Cygwin performance seems to be better under Vmware, than the performance under VirtualBox.,  the overall performance of  Virtual box seems to be good.

According to my experiments, Windows Vista/7/8 are not suitable for doing ns2 based research works (and even not suitable for researching with some lower versions of Matlab in case if your College/institute is having that particular lower Matlab version). As a fact, an old version of  Matlab code will run much faster under the Virtualbox (XP) than if you are running the same on a native installation of Windows 7/8 with the new version of Matlab on the same laptop – it is unbelievable – but just try to believe it.

Conclusion :

  • If you are doing any serious research using ns2, then just do it on any Linux Operation System.
  • If you are doing any serious research using any older version of ns2 such as ns2.21b, then just try to do it on Cygwin on an old computer with native Windows XP installation.
  • If you are only having a Windows Vista/7/8 in your new laptop and can not remove Windows fully and can not do a native Linux install for ns2, then first try the possibility of dual-booting Windows and Linux. If possible, then install ns2 on the Linux installation.
  • If you are not certain about dual booting – and not going to risk it with your laptop which may contain a lot of data, then just install Virtualbox under your native Windows Vista/7/8 install. And install any light version of Linux such as Lubuntu under the virtual box and then install ns2 in it.

 

 

WhatsApp Discuss Through WhatsApp