GNS3 (Dynamips) on Mac OSX

I have been playing around with GNS3 (Dynamips) on my Windows VMWare image and I decided to get it working natively on my Mac OSX.  Unfortunately unlike the Windows installer the Mac OSX distribution does’nt include the necessary applications.  After poking around I figured out a way to get all the parts installed and working.  This post is an step by step of what I did to make it all work.

Step 1 – Apple Xcode Tools

The first thing you need to do is download and install the Apple Xcode Tools which are freely available from Apple at the following URL.

http://developer.apple.com/technology/xcode.html

Step 2 – Macports

Macports is a port application for Mac OSX. This is needed to install libpcap which is needed. The installation is pretty straight forward. Download the binary package from the following URL and install it.

http://www.macports.org/install.php

Once installed make sure you are updated by running the following command:

/opt/local/bin/port -d selfupdate

Step 3 – libpcap/dynamips

This is pretty straight forward and easy to do. Run the following:

/opt/local/bin/port install libpcap
sudo ln -s /opt/usr/local/libpcap.a /usr/local/lib/libpcap.a
/opt/local/bin/port install dynamips
NOTE: There is a good chance that the dynamips will fail. On top of that it will most likely install a version that is too old for the GNS3 Dynagen version to run. This is ok but we still want to run this step because it will download and install all the other requirements.

Step 4 – libelf

Most likely the port install dynamips failed with a rom2c error. This package will correct that issue. Go to a temporary directory such as your Downloads and do the following:

curl ‘http://www.mr511.de/software/libelf-0.8.9.tar.gz’ -o libelf-0.8.9.tar.gz
tar -zxvf libelf-0.8.9.tar.gz
cd libelf-0.8.9
./configure –prefix=/usr/local
make
sudo make install

Step 5 – dynamips

We are now ready to download a current version of Dynamips. You might want to check to see if a newer version is available. This is an example of the process:

curl ‘http://www.ipflow.utc.fr/dynamips/dynamips-0.2.8-RC2.tar.gz’ -o dynamips-0.2.8-RC2.tar.gz
tar -zxvf dynamips-0.2.8-RC2.tar.gz
cd dynamips-0.2.8-RC2
make
mv dynamips /opt/local/bin

Step 6 – Download & Install GNS3

Last but not least GNS3 itself. Simply go to the following URL, download the DMG and copy the application to your Applications folder. Once you are done point it to “/opt/local/bin/dynamips” and click Test. You should be ready to go now.

http://www.gns3.net/download

Optimizations

One of the easy things you can do to speed up booting of the IOS images is unzipping the images. To do this do the following, simply replace the filename with your filename.

unzip -p c1700-adventerprisek9-mz.124-15.T7.bin > c1700-adventerprisek9-mz.124-15.T7.image

Now point GNS3 to that new image and your router will boot significantly faster.

Summary

At this point everything should be working for you. If you run into problems let me know.


22 Responses to “GNS3 (Dynamips) on Mac OSX”


  1. c123,

    Just what I was looking for (just this week started self-learning for the CCENT then CCNA). I linked to here from the GN3 forum.

    Thanks.


  2. CCNA_Hopefull,

    Thank you for the excellent writeup and instructions. I was able to get this up and running on OS X 10.5.6.

    Thank you again!


  3. Joceline,

    First I want to thank you for your excellent instruction. I went through it step by step and it’s working fine. Wouldn’t made it without your instruction.

    Now, I have one more problem… sure it’s simple for you. I want to map the network cloud to my NIC. But there seems to be a problem with the permissions (”206-unable to create generic ethernet NIO”). Found out that I have to run dynmips as root.

    Can you help me to do that. I’m a beginner with MAC OS. So I’m little confused. Do I need to undo all the steps above?

    Thank you in advance!
    Greetings!


  4. dedwards,

    Honestly I have moved on from using GNS3 due to some stability issues and their site is down so I can’t re-download it right now to check but most likely you will run into some issues trying to use GNS3 to do that. You can still use GNS3 to design the networks but you might want to look at dynagen and then launch dynamips yourself via sudo and then dynagen to start the instances.


  5. x2pher,

    Thanks for the step by step info on how to get it to work on a mac.

    I just got my mac and still learning the ropes on this system, Im unsure on how or where to run the command that you have posted on Step 2.

    Can you tell me more on how to go about running it?


  6. dedwards,

    You need to run the command in Terminal. You can run it from any directory within Terminal.


  7. ccievirus,

    Hi,

    I get these error

    rsync error: some files could not be transferred (code 23) at /SourceCache/rsync/rsync-35.2/rsync/main.c(1400) [generator=2.6.9]
    Error: Synchronization of the local ports tree failed doing rsync
    DEBUG: Couldn’t sync the ports tree: Synchronization of 1 source(s) failed
    while executing
    “macports::selfupdate [array get global_options]”
    Error: /opt/local/bin/port: port selfupdate failed: Couldn’t sync the ports tree: Synchronization of 1 source(s) failed

    after typing /opt/local/bin/port -d selfupdate

    I’ve installed
    Apple Xcode Tools (step 1)
    xcode312_2621_developerdvd.dmg

    and Macports (step 2)
    MacPorts-1.7.0-10.5-Leopard.dmg

    My system requirements are
    OS: Mac OS X Leopard 10.5.6
    Model Name: MacBook
    Model Identifier: MacBook4,1
    Processor Name: Intel Core 2 Duo
    Processor Speed: 2.4 GHz
    Memory: 4 GB
    Bus Speed: 800 MHz
    Boot ROM Version: MB41.00C1.B00
    SMC Version: 1.31f0

    Let me know if I am missing something. Looking forward for your expert advices.

    Thanks

    CV


  8. nealz,

    Thanks for your great documentation. The Window version worked but is very slow. Used your instructions and on the Mac it is much faster.

    Thanks


  9. dedwards,

    I unfortunately don’t know much about ports so I can’t offer much for troubleshooting but it sounds like it had a problem download the updated ports tree. I would try it again as there might have been an issue with the remote server. If that doesn’t work I would find a ports support forum and see if they can help.


  10. Alex,

    ccievirus you must do it as root:

    sudo /opt/local/bin/port -v selfupdate


  11. Iyad,

    When I am trying to do step 2;
    this statement appears:
    Unrecognized action “-d”
    what should I do?


  12. haris,

    Guys can you explain again the step 4 and 5 pls. i copied the code into the terminal and i’m getting errors , that the path does not exist


  13. Ahmed,

    It is working finally, thanks a lot

    GNS3 with mac it is relay different then win$,, i should tray it with Fedora,,

    Thanks again,


  14. Kyle,

    I was doing great until I got to Step 6. I can’t point the GNS3 preferences to the dynamips at “/opt/local/bin/dynamips”
    The file exists as a Unix Executable, but the program won’t let me select it. Any advice?

    Thanks in advance!
    Kyle.


  15. CP,

    Great instructions. Very helpful. For those who might get stuck, I had to use sudo to run most of the commands provided in the steps.

    Is anyone aware of how to get a GN3 build for PowerPC? It looks as if the project is only supporting Intel at this point. I just downloaded the pre-built image provided on the site for Intel – without success (worth a try).

    I haven’t spent too much time looking around yet. I will try later tonight to build from the source and see if I can get it working.

    Thanks for your work on this. Very clean solution you’ve provided.


  16. Gutter,

    Kyle,

    change /opt/local/bin/dynamips to /opt/local/bin/dynamips.bin and select it through the GUI. Dont know why this works but it does


  17. GNS3 on MacOS X - Assassin’s Blog,

    [...] The following optimization techniques were take from:http://blog.crimsonsilo.com/2008/11/gns3-dynamips-on-mac-osx/ [...]


  18. Matthew,

    Hi
    Can someone help with my last step? I’m nearly there but it keeps on failing.. see below

    Macintosh-3:dynamips-0.2.8-RC2 matthewconran$ mv dynamips /opt/local/bin
    mv: rename dynamips to /opt/local/bin/dynamips: Permission denied

    Somehow I cant rename this. Any tip please?
    thanks


  19. Aaron,

    Try:
    sudo mv dynamips /opt/local/bin/dynamips


  20. Running GNS3 on MacOS X :: Assassin’s Blog,

    [...] do not work on the Mac. Update: After writing this article a friend of mine pointed me over to: http://blog.crimsonsilo.com/2008/11/gns3-dynamips-on-mac-osx/ This is an excellent guide. I have updated my guide to follow the guidelines he posted on this [...]


  21. lkhanna,

    hi
    thanks for this such a nice document…
    i have mac pro – 2 gb mem , 2.53 Ghz…
    how many devices can i run with this?


  22. dedwards,

    It’s tough to say, it really depends on the platform images you are loading but I have run 8 to 10 devices for some Equal Cost Pathing Labs


Leave a Reply