Go to http://www.gns3.net/downloadDynagen at Sourceforge and download.
Open the GNS3 package and copy it to your Applications folder.

and copying:

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.

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

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.
I would always enable the sparse memory feature to save memory when running multiple images of the same type.

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

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.

Press Shift-⌘-I or use the Menu, Edit, IOS Images and Hypervisors to get this screen:
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:
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.
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.

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

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)

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

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

And now you will have an IDLE PC value configured.

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:

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 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.








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.
I find that cleaning the TMP directory from time to time is a good idea. But permissions can be a big problem on OS X and can take some troubleshooting to sort out.
Great Writeup ! I have/had played with GNS3 on MacOSX Leopard and it works pretty good.
Excellent post Greg, you write the “exaustive guide” to GNS3 on Mac.
Great work
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?
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.
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?
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.
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.
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” ‘
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” ‘
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??
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.
Yep. that’s how it work.
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.
Try port 7201.
I’ve tried ports 7200 7201 2000 2001 but nothing to do.
Have I to manually open some ports or change some preferences?
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.
Thanks very much. That means it’s a permissions problem I guess.
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.
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!
Please,help)
I can’t understand, Were can I download dynagen?!
I found)
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
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
You need to run root using the sudo command to start dynamips.