2 September 2010

Install GNS3 on Mac OSX Leopard


Go to http://www.gns3.net/downloadDynagen at Sourceforge and download.

Open the GNS3 package and copy it to your Applications folder.

gns3-install-osx-0.jpg

and copying:

gns3-install-osx-1.jpg

Now you can run the GNS3 and it will tell you to install Dynagen. Dynagen is a python wrapper that simplifies the dynamips emulator.

Dynamips is basically a MIPS CPU emulation software with some code to emulate the Cisco hardware. Dynagen extends this to read a text file for the configuration and makes it easier

Copy Dynagen to your Applications Folder.

gns3-install-osx-3.jpg

Configuring GNS3 Preferences

General

I have created a directory in my Documents folder to store my GNS3 data and IOS images.

gns3-install-osx-4.jpg

Dynamips

The Executable path for dynamips isn’t straightforward because it’s a file. Be default, OS X wants it to be a directory (because all programs are actually directories in OS X) so you will need to manually enter

/Applications/Dynagen/dynamips

When dynamips runs, it creates a number of files that are images of the memory etc, that the MIPS CPU emulator needs to reference about the hardware architecture and memory spaces.


Caption Text.

Caption Text.(Click for a full size image)

I would always enable the sparse memory feature to save memory when running multiple images of the same type.

gns3-install-osx-5.jpg

If you have everything correct, you should be able to press the TEST button and get a success message in green as shown:

gns3-install-osx-6.jpg

Capture

I haven’t used this feature as yet and may post something on this in the future.

Pemu

PEMU does not work on MAC OS X (as far as I know and these settings make no difference.). This is becuase the binary that emulates the PIX/ASA has only been compiled for the Windows and Linux platforms.

Working and Unzipping IOS Images

Cisco IOS images are compressed so as to use the least amount of flash memory. Historically, flash memory was expensive and not very large. As a result, IOS was compressed and the first thing IOS usually does these days on startup is to uncompress the image from Flash to RAM. When using GNS3/Dynagen, you can save startup time by uncompressing the IOS images.

Cisco IOS images are compressed using one of three formats, zip, mzip or STAC. The IOS image name will tell you which compression is being used. For the following filename, the letters MZ are the key:

c7200-advsecurityk9-mz.124-20.T1

The first letter tells you whether the image runs from flash, memory or ROM. (in the olden days, RAM was also expensive and the image would often run from flash, and only dynamic information was stored in RAM. That is, the program was always executed from Flash, not form memory. Today, RAM is cheap so the flash image is always copied to memory at boot time.)

  • f – flash
  • m – RAM
  • r – ROM
  • l – the image will be relocated at run time

and the second letter tells you what the compression type is:

  • z- zip compression
  • x – mzip compression
  • w – “STAC” compression

For most images, ZIP compression is used and you can use a standard software package. For those images that use mzip compression, you can download the Zipeg software which supports mzip.

Naming Convention

When unzip the file, it is a convention to rename it with a .image extension. This makes sure you don’t confuse it with a ‘normal’ image.

Which IOS image should you use ?

Because dynagen is an emulator for the MIPS CPU, you can only images that run on Cisco router hardware that uses the MIPS processor. This means most of the older routers, and not many of the new ones. Your best bet is to use 7200 series images, but also the C1700, C2600, C2691, C3600 and C3700 families used MIPS CPU’s. The C3700 is probably your seond best bet.

Configuring the IOS details

We need to tell Dynamips where the IOS image is.

gns3-install-osx-7.jpg

Press Shift-⌘-I or use the Menu, Edit, IOS Images and Hypervisors to get this screen:


Caption Text.

Configuring the Dynagen parameters.(Click for a full size image)

Point the Image file: to the directory where you IOS images are are stored. I prefer to create a GNS directory in my Documents and a sub-directory for IOS. Thus my directory is:

/Users/gregferro/Documents/GNS/IOS/c7200-adventerprisek9-mz.124-24.T1.image

You must click Save to write the parameters and it will look like:


Caption Text.

(Click for a full size image)

We will set the IDLEPC in the next section but you need to leave it blank for now.

You can have multiple images for a platform, but if you are using sparsemem (as I recommend you should to save memory), then run the same image for every router. In fact, I would typically only use a single router and a single image for all my GNS3/Dynagen use.

Setting the IDLEPC value

Drag the router model that you configured in the previous section onto the screen and click the play button to start the emulator.


Caption Text.

(Click for a full size image)

You need to connect to the router and move out of the of Setup mode. This is because Setup Mode uses all available CPU cycles and will cause your IDLEPC value to be wrong for normal use.

gns3-install-osx-17.jpg

And make you sure you get out of the Automated Setup utility.

gns3-install-osx-18.jpg

This window will pop up while dynamips calculates the unused CPU command that are being repeated (Note the “Please wait while calculating an IDLE PC” text in the corner)

gns3-install-osx-16.jpg

Right click on the router and select the IdlePC from menu:

gns3-install-osx-15.jpg

The system will offer a list of possible IDLEPC values, select one of the values that has a an asterisk next to it.

gns3-install-osx-19.jpg

And now you will have an IDLE PC value configured.

gns3-install-osx-20.jpg

CPU and Memory

There are many other sites that talk about how much CPU and Memory you need to run GNS3. But using Dynagen V0.11 and GNS3 V3.5 will use 100% of CPU. This is because the configuration file will spawn multiple dynamips hypervisors. I presumse that this allows better use of multicore processors,and is probably best for for MS Windows. For the following network layout:

gns3-install-osx-21.jpg

Here is the Activity Monitor for my modified config. What I did was reduce the number of hypervisors created when GNS3 starts by editing the .net text file that GNS3 creates.

gns3-install-osx-22.jpg

GNS3 will put the following text into the .net file. This text spawns another dynamips instance on the IDP port specified.

[localhost:7202]
workingdir = /Users/gregferro/Documents/GNS/BE-WAN-Emulator-V1.1_working
udp = 10200
[[7200]]
image = /Users/gregferro/Documents/GNS/IOS/c7200-advipservicesk9-mz.124-20.T1.image
idlepc = 0x61301b6c
ghostios = True
sparsemem = True

Why did I change it ?

Because each dynamips process seems to burn up 100% of CPU. I have been able to reduce this. Having four dynamips instances trying to grab CPU resources stoped me from using web browsing. By reducing the number of hypervisors to two, it works a lot more efficiently.

Wrap Up

So there are some notes on installing and using GNS3 on Mac OS X Snow Leopard. I expect I will continue to tune and modify parts of the configuration. I have a feeling that V0.11 of dynagen works less good than the previous version I was running. i think I might give that go. However, my previous Dynamips wasn’t using GNS3 as I configured everything from the command line. GNS3 makes setting up the networks a lot easier, so I expect that I will use both the command line and GNS3 for different purposes. GNS3 for quick and dirty testing, and the command line for much larger and more complicated testing (more about how to do this here.

Please rate this post:

1 Star - It\\\'s Crud2 Stars - It\\\'s Tosh3 Stars - Something\\\'s missing4 Stars - Needs works5 Stars - Good Enough6 Stars - Good7 Stars - Excellent8 Stars - Brilliant9 Stars - Astonishing10 Stars - Awesomely Godlike? (4 votes, average: 10.00 out of 10)
Loading ... Loading ...

About Greg Ferro
Greg is a Network and Security Architect / Designer / Engineer working freelance in the UK and worked for Resellers, DotCom's, Large Corporate's and Service Providers across a variety of products & Vendors. He prefers to work for end users, believes in the life cycle, total cost of ownership and that near enough is often good enough. He likes talking about himself in the first person to feel "royal", even when hosting the Packet Pushers Podcast on Data Networking. More about Greg at http://etherealmind.com/who-am-i/ and you can follow him on Twitter.

Comments

  1. As usual- great post Greg. I like the breakdown of the IOS naming convention in relation to it being ziped or mziped. I use zippeg but have had the last two images that I tried to unzip not load when running dynamips. If I leave them alone they seem to be fine. Another recent issue I have seen has something do do with permissions when I start the app but I think I just has some files that need to be cleaned up.

  2. TAS says:

    Great Writeup ! I have/had played with GNS3 on MacOSX Leopard and it works pretty good.

  3. Excellent post Greg, you write the “exaustive guide” to GNS3 on Mac.
    Great work

  4. Fernando says:

    Great explanation, thank you. I am running into an issue being able to open a terminal window to access the CLI. I get the following error:
    Last login: Wed Dec 9 22:26:45 on ttys000
    Nandos-MacBook-Pro:~ iNando$ telnet localhost 2007 ; exit
    Trying ::1…
    telnet: connect to address ::1: Connection refused
    Trying fe80::1…
    telnet: connect to address fe80::1: Connection refused
    Trying 127.0.0.1…
    telnet: connect to address 127.0.0.1: Connection refused
    telnet: Unable to connect to remote host
    logout

    [Process completed]

    Any ideas, please?

    • Greg Ferro says:

      Your are trying to connect to port 2007 on the dynamips hypervisor and it isn’t there. Because you also have IPv6 enabled on your network adapter, it then goes and attempts to connect to the other addresses on the loopback address.

      Check that your dynamips hypervisor is running, and that the emulated router is running on port 2007. Or check the port numbers that GNS3 is configured to run the ports on.

  5. Chris says:

    Good info Greg! I configured everything exactly as instructed. I’m using a 1700 IOS, Snow Leopard. I left the IOS files as .bin files instead of changing the extension to .image. Those are the only differences. Here’s what happens when I try to console into the router:

    Last login: Sun Jan 24 13:51:30 on ttys000
    telnet localhost 2000 ; exit
    AlarMacBP:~ a1arc0n$ telnet localhost 2000 ; exit
    Trying ::1…
    telnet: connect to address ::1: Connection refused
    Trying fe80::1…
    telnet: connect to address fe80::1: Connection refused
    Trying 127.0.0.1…
    Connected to localhost.
    Escape character is ‘^]’.
    Connected to Dynamips VM “R0″ (ID 0, type c1700) – Console port

    It pretty much stops there. I hit ‘enter’ a couple times and nothing. Any ideas?

    • Greg Ferro says:

      Open a terminal windows and attempt to telnet on port 7201 or port 7200 after you “turn the IOS on”. If you get a connection, then you have the wrong port configured in the terminal script. That’s the most likely cause.

      • Chris says:

        I made some changes so the 1st 2 telnet attempts are longer made. Here’s what I get now:

        Last login: Sun Jan 24 16:46:41 on ttys001
        AlarMacBP:~ a1arc0n$ telnet 127.0.0.1 2000
        Trying 127.0.0.1…
        Connected to localhost.
        Escape character is ‘^]’.
        Connected to Dynamips VM “R0″ (ID 0, type c1700) – Console port

        I tried as you suggested and port 7200 and port 7201 don’t yield a connection. However, port 2000 does. Results are the same as above and still no Router> prompt.

      • Chris says:

        Here’s my login script also:

        /usr/bin/osascript -e ‘tell application “Terminal” to do script with command “telnet %h %p ; exit”‘ -e ‘tell application “Terminal” to tell window 1 to set custom title to “%d” ‘

      • Chris says:

        Here’s my terminal script also:

        /usr/bin/osascript -e ‘tell application “Terminal” to do script with command “telnet %h %p ; exit”‘ -e ‘tell application “Terminal” to tell window 1 to set custom title to “%d” ‘

  6. Diego says:

    hi Greg, i’ve used your guide but when I press the TEST button I get an error message in RED:
    “Failed to start Dynamips”

    any suggests??

    • Chrised says:

      I had the same problem. Then I changed the executable path to:
      /Applications/GNS3.app/Contents/Resources/dynamips-0.2.8-RC2-OSX-Leopard.intel.bin and the test worked. I’m a newbie so not sure if this is correct.

      • Greg Ferro says:

        Yep. that’s how it work.

      • Diego says:

        Thanks now it works!!!
        But I have another problem: I can’t connect to the port 7200 using telnet..
        here my error

        Macintosh-2:~ dv$ telnet localhost 7200
        Trying ::1…
        telnet: connect to address ::1: Connection refused
        Trying fe80::1…
        telnet: connect to address fe80::1: Connection refused
        Trying 127.0.0.1…
        telnet: connect to address 127.0.0.1: Connection refused
        telnet: Unable to connect to remote host

        using ssh is the same in fact

        Macintosh-2:~ dv$ ssh dv@localhost -p 7200
        ssh: connect to host localhost port 7200: Connection refused

        I think my 7200 port is locked but my firewall isn’t working and the remote login preferences is allowed to all user without password.

  7. A Grateful Reader says:

    Thanks for the tip of changing the working directory for dynamips on one of those screenshots.
    It was failing to start dynamips until I changed it away from the default /tmp setting.

  8. Diego says:

    I’ve see where is the problem:
    using /Applications/GNS3.app/Contents/Resources/dynamips-0.2.8-RC2-OSX-Leopard.intel.bin the dynamips demon won’t start! So that telnet localhost 7200 can’t find the process behind the port.

    I’ve used the directory suggests by Greg /​Applications/​Dynagen/​dynamips in gns3, still the demon won’t start. In fact in this directory there is the script “Dynamips server”. This script starts the demon, so the command telnet localhost 7200 works.

    But
    1. if I launch manually “Dynamips server” I’ve an error in gns3: “service just started on port 7200″ and gns3 try to start the server on the port 7201
    2. obviously even if the server starts on port 7200 i can made a telnet connection but I’ve to configure manually the cisco emulator without the graphic interface of gns3 but using text command to create the router and the link.

  9. Kayode says:

    Greg,

    Really great post.
    Simply put – this is one of the best guides I have seen.
    Really descriptive and puts everything into context.

    I have been able to setup GNS3 on my Mac now.

    Thanks and Great job!

  10. dm says:

    Please,help)
    I can’t understand, Were can I download dynagen?!

  11. Battlechasers says:

    Hi,

    I cant seem to the get the GNS3 running on my MACbook 5.1 aluminum unibody with 2.0 gHz , 2.0GB DDR3 OSX 10.5 . I am getting an error ” GNS has encountered a fatal error, and will now terminate.”

    I’ve checked the console and saw the line ” /library/Frameworks/Python.framework/Versions/2.6/Phyton: No matching architecture in unversal wrapper”

    Do I need to do anything else or did I missed something. I ended reinstalling my OS but I am still getting the same error.

    I used the GNS3 from this site “http://downloads.sourceforge.net/gns-3/GNS3-0.7.2-intel-x86_64.dmg?download”

    I also tried to use ” http://blog.gns3.net/2010/03/how-to-run-gns3-on-mac-os-x/” but I stil cant get it to work.

    Hope someone could help

  12. Hale says:

    Hello,

    I tried this /Applications/GNS3.app/Contents/Resources/dynamips-0.2.8-RC2-OSX-Leopard.intel.bin
    but still red error “Failed to start Dynamips”

    How can I make it work? I am not able to login as root to my macbook pro, could that be the problem?

    Thanks a lot,

    Hale

Trackbacks

  1. [...] того момента пока вчера я не нашел отличное описание по шагам для тупых, что надо делать чтобы запустить [...]

Speak Your Mind

*