GNS3 on Ubuntu 8.04 – Pemu Guide

Ok, so far we have gone through the hoops to get GNS3 with dynamips/dynagen working nicely in an (almost) fully contained directory in /opt. We then went through choosing an IOS image that is right for you, if you actually have multiple legal images to choose from of course. Now lets setup a pix firewall. The PIX is out of life as far as Cisco is concerned and had been superseded by the ASA line of security devices. But, there are still a lot of the PIX around and the concepts haven’t changed too much between them. So let us go through the motions already!

Too get Pemu going on Ubuntu you first need to download it. It is based of of Qemu and the binary is actually quite small. Digging up the right one to use can be a pain but if you are a rockin’ network geek and go to the forums, you will be able to find it there.

Get pemu for at (note that you have to register to download the fille). Grab  pemu_2008-03-03_bin.tar.bz2 and save it to some temporary location.

Extract the pemu files and copy them to the pemu directory in GNS3. Then make a Pix directory for your “legal” pix images. Copy your image files to this location.

tar xjvf pemu_2008-03-03_bin.tar.bz2
cd pemu_2008-03-03_bin
sudo cp ./* /opt/GNS3/pemu
sudo mkdir /opt/GNS3/Pix

Then copy over your pix images to /opt/GNS3/Pix/

Now lets make sure GNS3 is setup properly. The comes with GNS3 and you need to set the path accordingly. You will want to change your GNS3 settings to point to the image by default and enter in the serial number and activation codes as well. My setup looks like this:

GNS3 Pemu Preferences

Notice that the activation key is 4 hex values and has to be separated by commas. After it was setup there were still issues with the activation key when I started up a pix firewall. I had to do the following in a console of the emulated pix router to get the unrestricted activation key working.

format flash:
activation-key 0x-------- 0x-------- 0x-------- 0x--------
copy run start

After doing this I had issues getting the console to come back up so I closed GNS3 and killed any open gnome-terminal process (there was one in the process list that looked like “/bin/sh gnome-terminal”) and then restarted GNS3. After that, everything worked fine.


Thomas mentioned issues in maintaining settings in labs. I didn’t have the same issue from one lab to the next initially but after a reboot I did. Here is one way to save the files for loading at a later time. What you want to do is copy the FLASH file from /opt/GNS3/tmp/<your pix name in GNS>/ to another location after you have written it and saved it within the emulator. If you want to setup the serial and activation key to always work, even with a brand new lab do the following:

cd /opt/GNS3/tmp/<name of pix which you have already activated in previous instructions>/
sudo cp ./FLASH ../../Pix/FLASH.bin
sudo chmod +r ../../Pix/FLASH.bin

Then enter in the default flash image in in the Pemu preferences of GNS3 as /opt/GNS3/Pix/FLASH.bin and that base FLASH file will be copied over (and renamed to FLASH) for every new Pix instance you create.

As for backing up the running configuration for a future lab you may be able to copy out the Flash file to another location and put it back the next time you startup your machine. I’ve not tinkered with that yet.

In my next testing I’ll be messing around with connecting your devices to physical and virtual interfaces. This will let us do connectivity testing (in the case of the virtual interface) and connect to a live network for other fun experiments.

Comments (6)

  1. 4:02 AM, 06/05/2009mike  / Reply

    I installed gns3 on ubuntu 9.04 via …apt-get install gns3. The router section works fine as I can upload and start the ios’s. What I can’t figure out and get working is the pemu emulation. First of all the ubuntu gns3 package does not install pemu as a dep like I think it should and save the headaches. It also does not install the wrapper So after reading a few bits here and there about manually installing gns3 instead of apt-get I found that the src to gns3 had the wrapper and I needed to manually dl, compile and install pemu. So far I have downloaded gns3 src…just to get the wrapper….and compiled pemu. How do I setup gns3 and pemu now? The wrapper was moved over to where gns3 was looking by default /home/foo/pemu/ I put the pemu executable that was compiled in /usr/bin. So under the preference section I have the correct path for the executable wrapper and a pix-704 image but when I drag the pix over to the topology layout I get two errors:

    Can’t connect to pemu on port 10525
    Could not connect to pemuwrapper at localhost:10525

    I thought the wrapper was suppose to start the pemu binary?

    Trying to manually run the wrapper:

    Traceback (most recent call last):
    File “pemu/./”, line 47, in
    import pemubin
    ImportError: No module named pemubin

    I know pemu is working because I can manually start a pix image but am stuck on how pemu and gns3 work together.

  2. 2:09 AM, 02/26/2009Dheep  / Reply


    I am trying the Pemu in ubuntu with GNS3 but unsuccessful.

    I have followed the guide, done all the settings, serial, activation key etc. I am able to start the PIX but unable to connect to console.

    this is the error I am getting i try to connect to console of the emulated PIX.

    ubuntu804:~$ telnet localhost 4000
    telnet: Unable to connect to remote host: Connection refused

    Have you faced this issue? if so please help.

  3. 5:44 AM, 08/18/2008SivArt  / Reply

    Guys, I just got it to work!!!

    I have created an .sh script with two lines called under /opt/GNS3:

    cd /opt/GNS3
    python gns3

    and them, I have pointed the launcher to the /opt/GNS3/ instead of /opt/GNS3/gns3 and it worked!!!, just wanted to share it with you guys and thanks for this guide and the help!!!

    Pst.: Now I need to get PEMU and Capture to show up under Preferences! 😉

  4. 6:57 AM, 08/06/2008SivArt  / Reply

    It is nice to see Pemu working on linux like the way it works on W; however, I have followed the steps and the PEMU and Capture tabs are not showing up, do you have any idea of why this is happening? I have wireshark installed, but I cannot manage to make those tabs to showup.


  5. 4:11 AM, 08/01/2008zloeber  / Reply

    Well it automatically saved for me in the /opt/GNS3/tmp/ directory and loaded up again on start of a new lab with the same PIX name. I’d make sure that you have write access to that directory first. Second, I’d try to create a new project and make sure that the export config option is selected. If neither of these work shoot me more details and I’ll be happy to assist however I can.

  6. 1:29 PM, 07/31/2008Thomas  / Reply

    Hi, Very good guide. However i save the running config of the router to the startup config. I then save the project, when i reopen GNS3, and start the router its blank. just like the router has never been configured. Any ideas Thanks Tom Send me an email 🙂

Leave a Reply

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

Pingbacks (0)

› No pingbacks yet.


Get every new post delivered to your Inbox

Join other followers