GNS3 v1.1 install on Ubuntu 14.04 LTS

gns3_icon_256x256In this post I will be running through the installation of the public release of GNS3 version 1.1 on a clean install of Ubuntu 14.04 LTS.

I am using the Ubuntu Gnome 14.04 LTS distribution, however I have also tested it on a clean install of the standard Ubuntu 14.04 LTS with unity

Step 1: Install the required dependencies for GNS3 and IOU

To get the system ready we first need to install the required dependencies.

All of the commands that follow are run as root, so first sudo into your root account:

Dependencies are programs that are required in order for the application you are installing to run correctly. These can be compliers, library files or even certain other applications.

In the case of installing GNS3 the main dependencies are:

  • build-essential
  • libelf-dev
  • uuid-dev
  • libpcap-dev
  • Python version 3.3 or above
  • pip and setuptools, we will install this from source
  • PyQt
  • pyzmq, will use pip to install
  • tornado, will use pip to install
  • python3-netifaces, I couldn’t install this using pip so used apt-get install instead
  • Dynamips version 0.2.11, we install this before we install GNS3

Dependencies to install Dynamips:

  • git
  • cmake

For installing IOU the following dependencies are required:

  • iniparser, will need to be installed from source
  • bison
  • Flex
  • Fix the missing library for 64bit systems

To install the dependencies execute the following apt-get install statement:

To install pip and setuptools get and install the source files:

Once we have pip installed we need to use it to get some prerequisite python modules for GNS3:

To fix the missing library for IOU on 64bit systems execute the following:

We can now create a symbolic link to the missing library:

To install iniparser which is a dependency for IOU we need to grab the source and compile it:

Step 2: Install Dynamips

Create a directory in your home folder to contain all the installation material for GNS3, IOU and Dynamips. Either download and extract a source tarball from the releases page or clone the Git repository using:

Now we need to generate the Make files required for compiling Dynamips:

To build and install Dynamips run:

Now we need to test dynamips to ensure it is working correctly:

Step 3: Install GNS3 Server

Next we need to download and install the latest GNS3 Server version, at the time of writing it is Beta 2 of V1.0:

Step 4: Install GNS3 GUI

Next we need to download and install the latest GNS3 GUI version, at the time of writing it is Beta 2 of V1.0:

Step 5: Install IOU

Next we need to download and install IOU, this will install the latest version of IOU that has support for using wireshark captures on the IOU interfaces:

Step 6: Create IOURC file

Next we need to creat the license file for IOU using the following script:

Add the following to the CiscoKeyGen file:

Make the file executable:

Execute the CiscoKeyGen script to generate the license file for IOU:

Sample output:

Add the license info to ~/iourc.txt:

Disable the phone home feature:

Step 7: Create an application launcher for GNS3

Unless you want to run GNS3 from the CLI each time you use it, it is worthwhile setting up an application launcher that you can use to launch GNS3 from the desktop, dock or Unity.

First we need to install the gnome panel and gksu so we can run GNS3 as root:

Next we will use the gnome-desktop-item-edit command to create an application launcher in the /usr/share/applications/ directory:

Once you execute the above command the Create Launcher window will pop up:

Create Launcher_003

    1. Select an Icon to use for GNS3.
    2. Select the type of launcher, In this case we will be using “Application”.
    3. Give the launcher a name, in this case GNS3.
    4. This is the command we will run when clicking on the launcher, “gksu gns3” will run GNS3 as root.

Click ok and the luncher will be created. You can now save this to your desktop, dock or run from unity.

Ubuntu 14.04 desktop [Running] - Oracle VM VirtualBox_004

Step 8: Setup GNS3

We are now ready to setup GNS3 to use Dynamips and IOU.

Unsaved project — GNS3_014

Enter the preferences by clicking edit->preferences.

Under the general preferences select where you want your GNS3 projects to be saved, as well as the folder where your binary images (IOS images) are saved:

Preferences_015

Under the Dynamips preferences ensure that the the path to Dynamips is /usr/local/bin/dynamips:

Preferences_016

Next we need to specify the IOS images that we will be using for Dynamips. You can use your Cisco CCO login, if you have one, to download the images or you can scour the net to find the IOS images you need. I will not provide any IOS or IOU images so please don’t ask.

Under the IOS routers preferences click “New”:

Preferences_017

Click “Browse” and select the IOS image you want to add. Click “Next”:

New IOS router_018

Give the IOS image a name, select the Platform and the Chassis for the image:

New IOS router - c7200-jk9s-mz.124-13b.image_019

Select the amount of RAM you want to allocate to the device and click “Next”:

New IOS router - c7200-jk9s-mz.124-13b.image_020

Select any additional network adaptaers you want included and click “Next”:

New IOS router - c7200-jk9s-mz.124-13b.image_021

At the time of writing it does not seem that the idle PC calculator is working so click “Finish”:

New IOS router - c7200-jk9s-mz.124-13b.image_022

Configure the path to your iourc.txt file under the Path to IOURC section:

Preferences_023

Next we will configure the IOU images under the IOU devices preference menu, this is done much the same as we did for the IOS devices earlier. Click “New” to add a new IOU device:

Preferences_024

Give IOU image a name, click “Browse” and select the image you want to add then select the type of image from the drop down menu and click “Finish”:

New IOU device_025

Once you have added all your IOU devices and saved them, click apply to save all the previous settings.

Preferences_026

That’s, GNS3 is now ready to run any combination of IOU and IOS devices to lab out those examples for your CCNA, CNNP or CCIE studies.

test.gns3 — GNS3_027

Thanks to Willdawg, CiscoStud and Fazle Arefins as I used their posts as the basis for this post:

https://github.com/GNS3/
http://forum.gns3.net/topic9030.html
http://forum.gns3.net/topic9106.html
http://fazlearefin.blogspot.co.uk/2013_03_01_archive.html

FacebookTwitterGoogle+Share

42 thoughts on “GNS3 v1.1 install on Ubuntu 14.04 LTS”

  1. This article is very clear and simple, thanks.

    Could you also explain the instalation of VirtualBox from scratch and the ingegration with GNS3 v1.1 on Linux, it looks like there is a problem with this integration.

  2. Hi, I dont know how to save in vi after copy and past.

    Also, i was getting error on line listed below

    for x in hostname:
    ioukey = ioukey + ord(x)

    1. With vi after you have inserted the text press the escape key and then type :wq! and press enter, this writes the changes to the file and then quits. For more details check out this cheat sheet http://www.lagmonster.org/docs/vi.html

      With regards to the error you are receiving, make sure you run the script using python 2.7 e.g. sudo python2.7 CiscoKeyGen

  3. Help on ubuntu 14.04 Failed to run gns3 as user root. The underlying authorization mechanism (sudo) does not allow you to run this program. Contact the system administrator.

  4. why do I keep getting an EOF error says I’m missing “*” but Im no and I even copied the CiscoKeyGen pythons script that I have used before and still get the same error? Any ideas?

      1. when I run the script I use python2.7 then CiscoKeyGen. I have tried multiple time and multiple things to get this to work. I have copied and pasted so many times. No I get an error saying indentation error on line 13. Why can’t I get this to run?
        Thanks

        1. If you are getting an Indentation error then it would appear that there may be a problem with copying and pasting the output from the site, python is very picky about white space. What text editor are you using?

          I have run the script again after copying and pasting the code using vi and it works fine using python 2.7:

          jonathanm@jonathanm:~$ python ciscokeygen.py
          *********************************************************************
          Cisco IOU License Generator – Kal 2011, python port of 2006 C version
          hostid=007f0101, hostname=jonathanm, ioukey=7f04c1

          Add the following text to ~/.iourc:
          [license]
          jonathanm = 0a241c5e597c7b21;

          You can disable the phone home feature with something like:
          echo ‘127.0.0.127 xml.cisco.com’ >> /etc/hosts

          jonathanm@jonathanm:~$ cat ciscokeygen.py
          #! /usr/bin/python
          print “*********************************************************************”
          print “Cisco IOU License Generator – Kal 2011, python port of 2006 C version”
          import os
          import socket
          import hashlib
          import struct
          # get the host id and host name to calculate the hostkey
          hostid=os.popen(“hostid”).read().strip()
          hostname = socket.gethostname()
          ioukey=int(hostid,16)
          for x in hostname:
          ioukey = ioukey + ord(x)
          print “hostid=” + hostid +”, hostname=”+ hostname + “, ioukey=” + hex(ioukey)[2:]
          # create the license using md5sum
          iouPad1=’\x4B\x58\x21\x81\x56\x7B\x0D\xF3\x21\x43\x9B\x7E\xAC\x1D\xE6\x8A’
          iouPad2=’\x80′ + 39*’\0′
          md5input=iouPad1 + iouPad2 + struct.pack(‘!L’, ioukey) + iouPad1
          iouLicense=hashlib.md5(md5input).hexdigest()[:16]
          print “\nAdd the following text to ~/.iourc:”
          print “[license]\n” + hostname + ” = ” + iouLicense + “;\n”
          print “You can disable the phone home feature with something like:”
          print ” echo ‘127.0.0.127 xml.cisco.com’ >> /etc/hosts\n”
          jonathanm@jonathanm:~$

  5. I followed this instuctions along with this walk through video:
    ( https://www.youtube.com/watch?v=RgdmZUmHtEQ ); which matched these instuctions, but got out all the kinks and problems out that people are having without the aid of having this video! I had success the first time!!!

    Oh! Also, I used installed GNS3 v 1.2.1 instead of 1.2 as well as Ubuntu 14.04. First I installed virtualbox on my mac pro i7 2.4 ghz running mountain lion, and then Ubuntu in virtualbox. Once inside Ubuntu, GNS3 was installed through Firefox within ubuntu! Good luck!

    1. @Genius: So you installed Ubuntu as a vm so you didn’t have to dual boot? I see a lot of walk-throughs about using the GNS3 IOU VM with oracle virtual box so that you can use the IOUs and have the IOURC. This walk-through will accomplish the same thing just goes about it a different way? I want to have the use of full IOS which was where I kind of thought this was going; am I wrong? Maybe I am in right church wrong Pew???

        1. what I am trying to do is run Ubunt 14 LTS as a dual boot alongside Win7 Ult 64. I’m just not a good linux guy but I am always willing to learn. I always find that I get to a part where something braks and I don’t know how to fix it. For example this script. It must be me doing something wrong. I tried copying and pasting into VI, I’ve used nano and gedit. I was wondering if I forgot to run something along the way. I really appreciate you all helping with this. Fro me, liux is always a trial and error thing and I give props to the people who work in it every day. I am going to do the video suggested by Genius earlier and see how that goes. I really have to get it up and running so I can start studying for CCNP. thanks again for helping an newbie.

          1. No problem at all, we have all been there before 😉

            Send me the output of the error you get and the output of your ciscokeygen.py file and I will see if I can spot anything.

            Hope the video helps 😉

      1. Exactly.. I have Ubuntu running in virtual box specifically for GNS3! Also Windows 8 running under parallels vm to use whenever I need to run packet tracer. I decided Ubuntu was the way to go for running GNS3 rather than the route of more red tape, installing it onto my my mac pro platform running mountain lion, which I probably will not ever upgrade it to Mavericks or Yosemite, but rather throw one or both on vm. I didn’t want dual boot simply due to wanting to harness the power of multitask; running all 3 simultaneously if needed and for what ever other os’s I may install in the future for further learning and testing!

        Yes, the video walk through is identical with exception of mistakes you would have performed or may have not notice unless you did it side by side with the video which is most concise, therefore, I would highly recommend using the instructions above as a template, and when the video strays from the instructions above, follow the instructions of the video over what the template says because its results are perfect! Again.. I use the instructions above side by side with the video on YouTube which they are damn near the same but with a few critical exceptions (corrections).

        You are right, you will have use of full IOS, reason I came here!

  6. @jonathan: I have rebuilt Ubuntu to try again. I will follow the video and try again. I will let you know the results. Thanks again

    1. Thanks everyone for helping. I got it installed by following the video and the steps above side-by-side. The only problem I am having now is that when I go to add and IOU image, GNS3 tells me the bin is not an executable. Should I be saving those somewhere special or does it not matter?
      Thanks again everyone for all the help.

      1. Sounds like a permission problem, try doing the following:

        chmod +x

        for each iou file or if you have a directory full of IOU binaries do the following:

        chmod -R +x /path_to_your_ directory

        Hope that helps, glad to hear you got it (almost) working in the end 😉

  7. @Jonathan: Thanks. After I worte that it dawned on me that it could be a permissions issue. I did a chmod +x i* so that I turned every .bin file into an executable. I then added the IOU image and I was off and running. A question about these IOU images, How do they differ from an IOS that ships on say a 3750 switch? Is it possible to use features of a layer 3 switch? I guess what I am asking is can I add an IOS for say a 3750 and use that unrestricted ?

    1. IOU is not specifically tied to a hardware platform like the 3750. It is based on the software features of a specific release of IOS. For example the IOU image i86bi-linux-l2-ipbasek9-15.1d.bin is a Linux implementation of the software features of the Layer 2 15.1d IOS.

      As far as I am aware most of the features required for the CCNP switch exam are supported in the l2 images, however because switching is heavily dependant on hardware ASICS not all features are available, private vlans springs to mind here. For a list of some of the features known not to work on IOU please see the following:

      http://www.routereflector.com/cisco/cisco-iou-web-interface/features-not-supported/

  8. First of all great guide. Got GNS3 up and running on Ubuntu GNOME for me no problem. However if I try to use QEMU to run ALU TiMOS SROSv QEMU doesn’t start up?? Do you have any guides for using QEMU on linux? I’ve installed the latest version of QEMU from GNS sourceforge but no joy.

    Any help would be great.

    1. @Keith,to be honest I haven’t done much with QEMU, I tend to use VirtualBox instead. Have you tried having a look in on the GNS3 forums for a solution? I will put it on my “to do” list to get a post setup 😉

      1. Thanks for the reply. I had it working fine but after a reboot it stopped and noe I can’t get it working again. I’ve search GNS3 forum but no joy.

    1. You should just change the permissions on the file before executing:

      chmod +x CiscoKeyGen
      and then either ./CiscoKeyGen or python2.7 CiscoKeyGen to run the script.

  9. Hi,

    I was able to install the icon on the desktop, but everytime I click on the Icon to open the GNS3, it keeps asking me for the sudo password… how can I solve it in order to just click the icon and open GNS3 instantly?

    1. you can remove gksu from the command in the application launcher. However to use features such as connecting GNS3 to the internet and physically networks GNS3 must be run as root and therefore the use of gksu in the application launcher. Hope this helps.

  10. Hi Jonathan,
    I have problem with the gui of gns3 not loading properly. With “gksu gns3” in the command for the launcher the gns3 window opens but cannot see anything inside the window, even the menu bar. But when I open with just “gns3” in the command, i can see the whole window with buttons and menu and all the directories in Edit -Preferences default to /home/user/…. I have tried the installation of gns3 twice now following the youtube video and this page.I want to open gns3 using “gksu gns3” so that gns3 has root privileges to avoid any future permission issues.
    Do you have any idea what is causing this problem.

  11. Hi,

    I followed this article and am running GNS3 successfully, but like to know how can i upgrade to latest GNS3 v1.3, please help
    Tried following the same steps and downloaded and installed V 1.3 no luck no working.
    please give us step by step for upgrade or fresh install for v1.3
    Thanks in Advance.

    1. @Narendra It is definetly on my “To do” list. Hopefully, if time permits, I will be able to get round to doing it in the next few days.

  12. Hi Jonathan,

    I followed your steps, but I can’t start the IOU switch or router. I got the error: Server error from 127.0.0.1:8000 IOU1: could not parse iourc file /root/iourc.txt: file contains no section headers. file: ‘/root/iourc.txt’, line 1
    ‘********************************************************\n’
    I also attached the screenshot. https://db.tt/AiYAx1hj
    I am using GNS3 1.3.2 on Ubuntu 12.04.02 LTS.

    How can i fix this issue? Any suggestion?

    Thanks.

  13. Added CiscoKeyGen in VI, ran the Chmod and then when I execute ./CiscoKeyGen I get no such file or directory
    bash: ./CiscokeyGen: No such file or directory

  14. Hi,
    On ubuntu 14.04 facing following error.
    root@kiran:/home/kiran# tar xf iniparser-3.1.tar.gz

    gzip: stdin: not in gzip format
    tar: Child returned status 1
    tar: Error is not recoverable: exiting now

    I was moved to .tar and did tar -xvf *.tar but didn’t worked.
    Please let me know any suggestions on this fix.

    Ravi

  15. Hi,
    Got the answer,search for iniparser file in google,and copied into GNS3 folder in terminal,ubuntu not supporting .gz files to extract

    Ravi

Leave a Reply to Keith Cancel reply