GNS3 on Ubuntu 8.04 – Install Guide

GNS3 is a frontend for dynagen (which is a scripting language for dynamips). Getting it to work nicely in Ubuntu was a bit of a pain in the arse but I was able to get it to work in a manner I’m happy with. This setup will essentially encapsulate a large portion of the install to one directory in /opt. Some libraries and executables will be installed through apt though, but not many. I previously wrote part of a writeup for this on Ubuntu 7.10, I’d ignore that in favor of this one which is much more up to date and polished.

Start by getting the right packages for it to work correctly:
sudo apt-get install dynagen python-qt4

Now get GNS3 and extract it to /opt
cd ~
http://pfe.epitech.net/frs/download.php/818/GNS3-0.5-src.tar.bz2
tar xjvf GNS3-0.5-src.tar.bz2 && rm GNS3-0.5-src.tar.bz2
sudo mv GNS3-0.5-src /opt/GNS3

Next we will create some directories. Dynamips will hold our executable dynamips. IOS for our Cisco images, Project for our projects, and Cache and tmp for extraneous files that clutter things up. We need to be able to write to Cache and tmp so we make those directories writable by the “other” group for simplicity sake.

cd /opt/GNS3
sudo mkdir Dynamips
sudo mkdir IOS
sudo mkdir Project
sudo mkdir Cache
sudo mkdir tmp
sudo chmod o+rw -R ./Project
sudo chmod o+rw -R ./tmp

Now get a binary of dynamips and make it executable

#Get the dynamips binary and make it executable:
cd Dynamips
sudo wget http://www.ipflow.utc.fr/dynamips/dynamips-0.2.8-RC2-x86.bin
sudo chmod +x ./dynamips-0.2.8-RC2-x86.bin

Now create a desktop shortcut to GNS3. Right-click on your desktop and select “Create Launcher…” and for the command put in

python "/opt/GNS3/gns3"

Start GNS3 with this new shortcut. Now we should start messing around with our settings.

If it is your first time launching it you have the option to changes settings right away. Go ahead and do this.

Here is the terminal command you will want to use for gnome, there are other terminal examples in the documentation, but this one worked the best for Ubuntu it seemed.
gnome-terminal -t %d -e 'telnet %h %p' > /dev/null 2>&1 &
When you are done with the general settings it should look something like this:

gns3 general preferences

Here is the dynamips preferences tab:

GNS3 Dynamips Preferences

And finally the capture preferences tab:

GNS3 Capture Preferences

I will get back to doing Pemu in a different post 🙂

In the next post I will cover how to choose and setup your IOS image. I think that actually choosing an image can be more difficult than setting it up so stay tuned as I document a typical example for you.

**Update**
Ubuntu_Boy gives us the scoop on doing this for 64 bit Ubuntu architecture! The only note I’ll add is that you do not need to setup a root password to use “su -“, you can just use “sudo su -” and enter your password if you don’t want to use sudo all of the time. Also, you can follow the path convention used earlier to make your install more portable. I’ve not followed these directions yet but will test them out on my next 64 bit install.

Want to run GNS3 on 64 bit Ubuntu because of memory limitation,follow the instruction above except
sudo apt-get install dynagen python-qt4
this one won’t work in 64 bit …

instead follow this:

First you have to select system’s update sources:
Go to system > Administration > Software sources
[Type password in the pop up box]

Then,
Under “Ubuntu software” select 1 & 2
Under “Updates” select 1 & 2
Then click close and reload

Next you have to check if python v2.5 installed:
1. Open Terminal windows
2. type python
3. you will get something like this:
“Python 2.5.1 (r251:54863, Oct 5 2007, 13:50:07)
[GCC 4.1.3 20070929 (prerelease) (Ubuntu 4.1.2-16ubuntu2)] on linux2
Type “help”, “copyright”, “credits” or “license” for more information.
>>> ”
4. Close is by pressing Ctrl+d [Skip 5 and 6 if you get the above message and go to 7]
[if you do not get the above message, python is not installed on your system]
5. type “su -” [Without quotes ofcourse] [then type password]
6. atp-get insall python [type y] [Skip 7 & 8 and go to 9]

7. type “su -” [Without quotes ofcourse] [then type password]
8. “apt-get update”
9. “apt-get install qt4-dev-tools” [type y]
10. “apt-get install pyqt4-dev-tools” [type y]
11. “exit”
12. “mkdir ~/Desktop/GNS3″ [A folder named GNS3 is created in the Desktop]
13. “cd ~/Desktop/GNS3″
14. “wget hthttp://pfe.epitech.net/frs/download.php/598/GNS3-0.3.2-src.tar.bz2″
15. “tar -xf GNS3-0.3.2-src.tar.bz2″ [Extracts the Archive]
16. “cd GNS3-0.3.2″
and here comes the interesting part
17. “./gns3″


** End of Update **

Comments (44)

  1. 8:03 AM, 11/09/2011viki  / Reply

    Hi guys .. check this out GNS3 Installation on Ubuntu 11.04
    thanks

  2. 7:20 AM, 05/05/2011Bruno Ferreira  / Reply

    Hi:

    Does anyone knows how to put gns3 looking with a real envirnonment?

    It was like that when i used win7 but now with linux ubuntu 11.4 the ios works but not like putty aplcation.

    tanks

  3. 5:45 AM, 10/31/2010Billy  / Reply

    Hi – i have latest Unbunto 10.04 LTS version. I installed GNS3-0.7.2-src but when i test dynamips, I get ‘dynamips failed to start on port 7200’ error message. I have set the dynamips path in GNS correctly. I also allowed port 7200 in iptables on ubuntu. Dynamips version is dynamips-0.2.8-RC2-x86.bin. I changed the permisson of this dynamips file to executable. But after all these effors and spending a week on it, i am still getting same message. Please advise & help.
    Thanks.

    • 12:24 PM, 11/01/2010zloeber  / Reply

      Hello Billy,

      Have you tried just installing gns3 via apt-get (sudo apt-get install gns3)?

      Thanks!

  4. 8:45 AM, 10/06/2010Naresh  / Reply

    Gns3 installation on Centos/Redhat/Fedora can be found here http://networkingtips-tricks.blogspot.com/2010/08/tutorial-how-to-install-gns3-on.html

  5. 11:29 PM, 02/10/2010tobie  / Reply

    ei guys, konsole KDE-4 doesn’t work when running gns3 as root.. any workarounds???

    Thanks in advanced!

  6. 5:42 AM, 10/09/2009Ashish  / Reply

    I want to use the terminal server on GNS3, i have ubuntu 9.04, the latest version. I am a noob to linux, please can anyone help me. I have successfully installed GNS3. It up and running.

  7. 11:31 PM, 05/03/2009Maina M. Noah  / Reply

    Hi Folks,

    A big thanks to Zac for the howto and to those who have commented and contributed.

    Well, I was wondering if there is anyone who has achieved the same on Centos 5.x. If so,please dont hesitate to post your findings as am working on the same but with no success.

    cheers,

    ./noah

  8. 6:31 PM, 04/10/2009felix  / Reply

    i seem to be having issues with the idle pc settings. it doesnt matter which one i choose the cpu on my ubuntu box is still 100% any ideas.. ???

  9. 12:18 PM, 04/01/2009Nicola  / Reply

    Thanks, this worked perfectly.

  10. 3:24 PM, 02/25/2009Achid  / Reply

    how can i link it to launcher (etc. cairo) ?

    it seems it would only run in /. in my case i’ve placed it in /opt .

    i managed to get it working if run it from console and type in ./gns3 .

    any help ? running on fc10 x64.

  11. 1:34 AM, 02/23/2009romeo  / Reply

    Thnkx man!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    It is intalled on my pc
    gud guidance

  12. 10:07 PM, 02/22/2009George Pallis  / Reply

    Thanx sooooooooooooooooo much!!!!!!!! Your tip with the ld.so.cache worked like a charm!!!! At last gns3 runs on my Kubuntu Hardy box!!! Thank you once again!!!!!

  13. 7:15 AM, 02/02/2009Stamati  / Reply

    Worked perfectly on 64bit Ubuntu… Need assistance with configuring GNS3 to a cisco switch which is trunked to 4 cisco 3560’s… Anyone? 😉

  14. 8:54 AM, 01/19/2009Catur Wijiutomo  / Reply

    to Sean, I think you should clear your ld.so.cache file. it’s usuallu located in /etc folder. just remove all line in that files. it works for me

  15. 1:52 PM, 12/09/2008Marty  / Reply

    Works on 8.10 too
    Intrepid

  16. 11:08 PM, 11/21/2008Sean G  / Reply

    Thanks so much for a fantastic resource! I was going to give up on this, until I found your link. This is fantastic…thanks for what youŕe doing for the Linux and Cisco communities!

    All the best,
    Sean G.

  17. 7:38 AM, 11/14/2008Syed Khalid Ali  / Reply

    Dear all,

    Just installed Ubuntu 8.10 x64 to get my 4GB RAM. After installing, updated my linux using Update Manager. Then following the procedure mentioned above I installed GNS 0.5 and Dynamips 0.28 with the following:
    1- Qt 4.4
    2- Python 2.5
    3- Sip 4.7
    4 PyQt 4.2

    Another thing if you read the READEM file for GNS, they also have packages for Debian & Ubuntu. After doing the relevant changed I was able to see the GNS entry in the Update Manager. But I did not installed it.

    Once again, thanks for the wonderful post.
    Thanks
    Khalid

  18. 9:44 PM, 10/21/2008Brandon  / Reply

    Can you email me the dynamips-0.2.8-RC2-x86.bin
    file. The website you have to get it from, along with everyone else, is down. Been down for a couple of days now. I would appreciate it. Thanks, Brandon I

  19. 2:01 PM, 08/26/2008Quaz  / Reply

    Hello all !
    I installed everything dependency ( dynagen python-qt4 … ) to my system Ubuntu 8.04 but
    the script gns3 is still said to me:

    Can’t import Qt modules, PyQt is probably not installed …

    please help!

  20. 1:54 AM, 08/21/2008Trisco  / Reply

    For multitabbed terminal you can use KONSOLE-K4. The problem I found is that when you run GNS3 in root mode, Konsole-K4 won’t open.

  21. 4:00 PM, 08/18/2008speakeasy51  / Reply

    I followed the info and was able to install GNS3 on a PC running 64 bit Ubuntu 8.03. There a very good write-up on GNS3 by By Mike Fuszner, the best I have ever seen so far ” http://sourceforge.net/project/downloading.php?groupname=gns-3&filename=GNS3-0.5-tutorial.pdf&use_mirror=osdn

  22. 5:21 AM, 08/18/2008SivArt  / Reply

    Thanks guys,

    But I have the launcher that way, actually, I have tried two gksu python “/opt/GNS3/gns3” and python “/opt/GNS3/gns3” without success. I tried to CHOWN and everything inside the GNS3 is owned by sivart. I also checked if it has exec perm, and I tried changing the attr to 777, and it has exec permissions without success.

    At this point, when I hit the launcher it does nothing. If I run it from the by CLI from the desktop I get the following:

    [email protected]:~/Desktop$ python “/opt/GNS3/gns3”
    ———Traceback lines (saved in exception.log)———-
    Traceback (most recent call last):

    File “/opt/GNS3/gns3”, line 51, in
    import GNS3.Main

    ImportError: No module named GNS3.Main

    ———————————————————–

    Any help will be really appreciated.

    Thanks!
    SivArt

  23. 11:07 AM, 08/15/2008Hantzley  / Reply

    ZLOEBER, I’m running 12 nodes (9 of which are 7200) on an Intel PC with 2G Ram. Performance is pretty good after applying IDLE_PC values to the nodes. I guess there could be a slight impact on routing protocol timers and convergence time.

    I would like to know if the performance is better on Mac OS Leopard though. Any feedback from a Mac user?

    Regards,
    Hantzley

  24. 2:22 AM, 08/13/2008zloeber  / Reply

    Sean, does it run directly from a terminal with sudo ./gns3?

    Hantzley, that is pretty freaking clever! I’ve been overwhelmed with work recently but it would be interesting to see if there is a memory saving with the multi-tab solution.

  25. 6:42 PM, 08/12/2008Sean  / Reply

    Not working for me on Hardy 8.04 x86:

    I try to start the launcher but nothing happens. Running the launcher from the command line reveals the following. Any python experts out there who can help? I followed the how-to above exactly.

    [[email protected]:/opt/GNS3]$ python “/opt/GNS3/gns3”
    ———Traceback lines (saved in exception.log)———-
    Traceback (most recent call last):

    File “/opt/GNS3/gns3”, line 56, in
    import GNS3.Main

    File “/opt/GNS3/src/GNS3/Main.py”, line 25, in
    from GNS3.Application import Application

    File “/opt/GNS3/src/GNS3/Application.py”, line 29, in
    from GNS3.Workspace import Workspace

    File “/opt/GNS3/src/GNS3/Workspace.py”, line 23, in
    import GNS3.NETFile as netfile

    File “/opt/GNS3/src/GNS3/NETFile.py”, line 27, in
    from GNS3.Globals.Symbols import SYMBOLS

    File “/opt/GNS3/src/GNS3/Globals/Symbols.py”, line 24, in
    from GNS3.Node.IOSRouter1700 import IOSRouter1700

    File “/opt/GNS3/src/GNS3/Node/IOSRouter1700.py”, line 22, in
    from GNS3.Node.IOSRouter import IOSRouter

    File “/opt/GNS3/src/GNS3/Node/IOSRouter.py”, line 27, in
    from PyQt4 import QtCore, QtGui, QtSvg

    ImportError: /usr/lib/libQtSvg.so.4: undefined symbol: _ZN14QObjectPrivate15checkWindowRoleEv

    ———————————————————–

  26. 8:27 AM, 08/12/2008Hantzley  / Reply

  27. 1:26 PM, 08/09/2008Hantzley  / Reply

    Please read “file->Open Tab” instead of “file->Open Terminal” from my previous post.

    Cheers.

  28. 1:20 PM, 08/09/2008Hantzley  / Reply

    Hello,

    I found a simple way to get the routers in multiple tabs under gnome-terminal. Simply select “file->Open Terminal” on a router terminal. You will basically get two tabs. Simply click and drag the console tab to the main gnome-terminal window where you want to consolidate the consoles.

    Cheers,
    Hantzley

  29. 6:05 PM, 08/06/2008zloeber  / Reply

    Also make sure the launch looks exactly as I described it (python “/opt/GNS3/gns3”) or it will run the application but in the context of your desktop rather than the GNS3 directory. This issue bugged the crap out of me for a little bit as it seemed like it should just work.

  30. 11:52 AM, 08/06/2008Ubuntu_Boy  / Reply

    SivARt check the file permission, you need to run it as root

  31. 5:46 AM, 08/06/2008SivArt  / Reply

    I tried the steps below with a couple of changes but the launcher is not working. I am running Ubuntu hardy 64, and I can execute GNS3 only from /opt/GNS3, if I cp the launcher to that location it works, but if I tried to execute GNS3 from my desktop either by CLI or by launcher I get the following error:

    –>
    ———Traceback lines (saved in exception.log)———-
    Traceback (most recent call last):

    File “/opt/GNS3/gns3”, line 51, in
    import GNS3.Main

    ImportError: No module named GNS3.Main

    Traceback (most recent call last):

    File “./gns3”, line 51, in
    import GNS3.Main

    File “./src/GNS3/Main.py”, line 38, in
    app.run(file)

    File “./src/GNS3/Application.py”, line 249, in run
    retcode = QApplication.exec_()

    KeyboardInterrupt
    <–

    Could you please assist?

    Thanks!

  32. 12:48 PM, 07/27/2008Ubuntu_Boy  / Reply

    By the way to run GNS3 on 64 bit you need the 64 bit file dynamips

    for 32 bit
    sudo wget http://www.ipflow.utc.fr/dynamips/dynamips-0.2.8-RC2-x86.bin

    for 64 bit

    sudo wget http://www.ipflow.utc.fr/dynamips/dynamips-0.2.8-RC2-amd64.bin

  33. 12:19 PM, 07/22/2008Fred  / Reply

    Terrific guide. Made my day. GNS3 working like a charm on my 8.04. Thanks man.

  34. 10:37 AM, 07/21/2008Ubuntu_Boy  / Reply

    want to run GNS3 on 64 bit Ubuntu because of memory limitation,follow the instruction above except
    sudo apt-get install dynagen python-qt4
    this one won’t work in 64 bit …

    instead follow this

    First you have to select system’s update sources:
    Go to system > Administration > Software sources
    [Type password in the pop up box]

    Then,
    Under “Ubuntu software” select 1 & 2
    Under “Updates” select 1 & 2
    Then click close and reload

    Next you have to check if python v2.5 installed:
    1. Open Terminal windows
    2. type python
    3. you will get something like this:
    “Python 2.5.1 (r251:54863, Oct 5 2007, 13:50:07)
    [GCC 4.1.3 20070929 (prerelease) (Ubuntu 4.1.2-16ubuntu2)] on linux2
    Type “help”, “copyright”, “credits” or “license” for more information.
    >>> ”
    4. Close is by pressing Ctrl+d [Skip 5 and 6 if you get the above message and go to 7]
    [if you do not get the above message, python is not installed on your system]
    5. type “su -” [Without quotes ofcourse] [then type password]
    6. atp-get insall python [type y] [Skip 7 & 8 and go to 9]

    7. type “su -” [Without quotes ofcourse] [then type password]
    8. “apt-get update”
    9. “apt-get install qt4-dev-tools” [type y]
    10. “apt-get install pyqt4-dev-tools” [type y]
    11. “exit”
    12. “mkdir ~/Desktop/GNS3” [A folder named GNS3 is created in the Desktop]
    13. “cd ~/Desktop/GNS3”
    14. “wget hthttp://pfe.epitech.net/frs/download.php/598/GNS3-0.3.2-src.tar.bz2”
    15. “tar -xf GNS3-0.3.2-src.tar.bz2” [Extracts the Archive]
    16. “cd GNS3-0.3.2”
    and here comes the interesting part
    17. “./gns3”

  35. 3:46 PM, 07/14/2008zloeber  / Reply

    Hello D11,

    To do this you have to run GNS3 as root at the very least. Also, use the Linux Network NIO (Network Input/Output). I’ll be doing a more comprehensive writeup soon but hopefully that gets you in the right direction.

    Thanks!

  36. 11:08 PM, 07/12/2008d11  / Reply

    thanks for the tutorial. now i am trying to connect a router to a cloud. and configure the cloud to use my real network interface eth0. the problem is that i cant ping the router.
    help!!!!

  37. 1:18 PM, 07/05/2008Ubuntu_Boy  / Reply

    To all following this guide, make sure to check the path of corresponding devices and software to make this work. Thanks for this guide…I was able to run seven router without a glitch unlike M$. The only problem is I’ve encountered error loading PIX image … will wait for PEMU guide

  38. 1:55 PM, 07/03/2008zloeber  / Reply

    Yeah, I looked into this for a few hours trying to find a gnome based terminal that could be manipulated externally but was not able to find anything that did not require some supplemental application of some sort. iTerm in apple has some programmability and KDE based terms have dcop which could be manipulated to open terminals in multiple tabs on demand. gnome-terminal looks like it has options to do this but they don’t work as you would expect them to and from the looks of many forums and bug reports, never will. John, your script is what I had thought of doing earlier and is probably the most elegant and simple way to tackle the problem. Thanks for the help!

  39. 12:41 PM, 07/03/2008John Spencer  / Reply

    Actually you could save the above scripts I mentioned in /usr/local/bin and add a launcher to the desktop with the command sh scriptname.sh where scriptname is whatever you decide to call the script…

  40. 8:39 PM, 06/30/2008John Spencer  / Reply

    For those looking for using multiple tabs, I have not been able to get this to work from GNS3 on Ubuntu. There is a version of Tera Term with Tera term collector on Windows that can do it. However on Ubuntu or other Linux distros using gnome you can put the following or adapt it to get this to work. Save the file as telnet.sh and make it executable. If you double click this file it will do what you are looking to do, telnet with multiple tabs and set the name of each tab. If a router is not running the script will still open those that are. I find this quite useful to keep on the desktop. Notice I also use a gnome-terminal profile called RouterTelnet, to use the defualt it is explained below

    ————————————————
    #!/bin/sh
    # created John Spencer CCIE#14405 Fri 26 Oct 2007 21:15:01 BST
    #
    # Purpose to Telnet to routers in Dynagen or GNS Lab running on local machine
    # Script would be adaptable to telnet to devices on other hosts without difficulty by replacing localhost with a hostname or IP address.
    #
    # RouterTelnet is the name of a profile saved in gnome terminal with preferred colours and fonts.
    #
    #
    # To use without a specified profile use –tab -t etc… instead of –tab-with-profile.
    # e.g –tab -t R1 -e ‘telnet localhost 2000’ \
    # For other options in a shell enter gnome-terminal –help

    # You may adapt or distribute but include the above text.

    gnome-terminal \
    –tab-with-profile=RouterTelnet -t R1 -e ‘telnet localhost 2000’ \
    –tab-with-profile=RouterTelnet -t R2 -e ‘telnet localhost 2001’ \
    –tab-with-profile=RouterTelnet -t R3 -e ‘telnet localhost 2002’ \
    –tab-with-profile=RouterTelnet -t R4 -e ‘telnet localhost 2003’ \
    –tab-with-profile=RouterTelnet -t R5 -e ‘telnet localhost 2004’ \
    –tab-with-profile=RouterTelnet -t R6 -e ‘telnet localhost 2005’ \
    –tab-with-profile=RouterTelnet -t R7_SW1 -e ‘telnet localhost 2006’ \
    –tab-with-profile=RouterTelnet -t R8_SW2 -e ‘telnet localhost 2007’ \
    –tab-with-profile=RouterTelnet -t R9 -e ‘telnet localhost 2008’ \
    ———————————————–

  41. 3:43 PM, 06/27/2008zloeber  / Reply

    Hello Mike, Sorry it did not work for you. If the test fails first make sure that you ran this:

    sudo chmod +x ./dynamips-0.2.8-RC2-x86.bin

    and also make sure that the file name is typed in correctly with case sensitivity in mind. If you still have issues maybe try installing the ubuntu version of dynamips to resolve any dependency issues with:

    sudo apt-get install dynamips

    Good luck!

  42. 1:03 PM, 06/24/2008Mike  / Reply

    I tried this but the Dynamips test failed. Everything went smooth but it is not working.

  43. 5:38 PM, 06/18/2008Hantzley  / Reply

    This is an interesting and helpful post. However, I would like gns3 to launch the consoles in multiple tabs in the same gnome-terminal window.

    If you know how to do this with gnome-terminal or other terminal software, please let me know.

    Thanks, Hantzley

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Follow

Get every new post delivered to your Inbox

Join other followers