2. Configuring Junos Olive in GNS3 using VirtualBox


First of all let me provide some useful links:
Please don't skip this step and go through all the tutorials above, this is where most of information on the subject I have came from.
What is necessary to have before actual installation of Junos begins:
  1. GNS3 v0.8.3.1 all in one download here
  2. VirtualBox 4.2.8 for Windows hosts x86/amd64
  3. FreeBSD 6.4 6.4-RELEASE-i386-disc1.iso
  4. Junos-Olive 10.1 - find it yourself, don't ask for it
You might ask a question - "Why do we need FreeBSD installed?"
Answer is simple - In few words - Junos OS is based on FreeBSD kernel. 

OK, Hope you've got everything.

It is better to have "GNS3 all in one" package installed as it provides you with all necessary software components.  VirtualBox 4.2.8 is the latest version available and is proven to work with all other software including my Widows 7.
FreeBSD 6.4 - try using this one. you'll need disc1 only. I spent lots of time trying to install Junos on top of FreeBSD mini install 4.1 used for Qemu installation. It doesn't work, do not repeat my mistake! Any Junos ver 10 and over should be OK for studies. I didn't find information about any problems with installation of more recent  releases.

1. Install GNS3 all in one  package. It is straight forward process described in many tutorials and videos available on internet. 
2. Install Oracle VM VirtualBox. If you have any questions watch this video:


3. Prepare Junos CD ISO image.
   Use any CD/DVD burning software and make IS0 CD image containing Junos OS package.
4. Run VitualBox application and create NEW VM instance.
   Name - FreeBSD - for example; Type - BSD, Version -FreeBSD
   NEXT -->   Memory Size 512MB;  NEXT --> Create a Virtual Hard Drive now;
   Create  -->  VDI; NEXT --> Dynamically Allocated; NEXT --> File Location - better to change to
   some easily accessible folder  - C:\VM\FreeBSD for example; Size - 6GB; CREATE.
5. Modify settings for FreeBSD Instance.
   SETTINGS -- System -- Motherboard; Modify Boot Order settings: by disabling Floppy and
   moving CD/DVD-ROM down.



   System -- Processor Tab --> Check Enable PAE/NX box. Leave default values for other options for now.
   Note that you can limit CPU resources dedicated to single instance here.
  
   Storage -- Choose CD/DVD in Storage Tree -- Click on CD Icon in Attributes Area and select FreeBSD ISO Image.


   Audio - Uncheck box Enable Audio
 
   Serial Ports -- Port 1 -- Check Enable Serial Port, Port Number - Com1, Port Mode - Disconnected.

   Close VirtualBox Application.

6. Configure GNS3 for VirtualBox
   I hope you have already played a bit with GNS3 and checked that Dynamips is running.
   So now  cancel all dialogs appearing after GNS3 start up and go Edit - Preferences -VirtualBox and
   press Test Settings button. result has look like one on picture:


    Click VirtualBox Guest Tab
    Set Identifier Name; Select FreeBSD Instance from drop down list.
    Set Number of NICs to 6
    and check Console Support Check box.
    Click OK Button.


    Drag VirtualBox Guest Icon from Node Types Window to the Topology Design area
    and select FreeBSD Instance for guest.
    Right click on created Virtualbox FreeBSD Guest and select Start.
    Virtualbox window should pop up where you can see FreeBSD boot process.

    I'm way too laze to rewrite excellent tutorial which is already posted.
    Please simply follow FreeBSD Install Section there. 
    The only difference - please use Standard Installation type -  no Boot Manager.

    Pay special attention to slices creation process.
    I was using following sizes for file systems:

      ad0s1a 1024M /
      ad0s1b 1024M swap
      ad0s1d 10M /spacer
      ad0s1e 128M /config
      ad0a1f (All space remaining) /var

    Don't miss Spacer slice as it is important.

    Answer all questions NO at the end of FreeBSD installation process.

    7. Junos Olive Installation.

      When FreeBSD reboots to root prompt go to menu on top of VM window
      Click Devices --> CD/DVD Devices --> Choose a virtual CD/DVD disk file -->
       "jinstall10.1" in my case.

# mount /cdrom
# mount -- gives you a table of mounted filesystems. Check if /cdrom is mounted.

   /dev/acd0   on    /cdrom

# cd /var/tmp
# mkdir jinstall
# cd jinstall
# tar zxvf /cdrom/jinstall101.tgz     <- your file name would be different.
# mkdir pkgtools
# cd pkgtools
# tar zxvf ../pkgtools.tgz
# cd bin
# cp /usr/bin/true  checkpic
# cd ..
# tar zcvf ../pkgtools.tgz *
# cd ..
# rm -rf pkgtools
# tar zcvf ../jinstall101.tgz *
# cd ..
# rm -rf jinstall
# pkg_add -f  jinstall101.tgz

You can use unix commands like ll, pwd, df -h during the installation.

Reboot FreeBSD when installation is complete with "reboot" command.
Right after Virtualbox instance starts to reboot - right click on FreeBSD icon in GNS3 and open console.
Using console you can follow all the boot process.  All boot information is redirected now to console device.

Here what we have at the end:

8. Some more tweaking
Log into Junos with root and issue "cli" command, then shut system down with "request system halt".
Wait until it stops and then stop instance in GNS3.
Open Virtualbox Guest configuration and make changes as it shown on picture below:


We are done!

Now you can clone this Junos Virtual Machine in VirtualBox application and create as many instances as you want (or your PC can handle) but first click Settings Button in Virtualbox click Storage --> CD Room icon in Storage Tree Area --> CD Icon in Attributes and Remove Disk from Virtual Drive. When cloning rename Instance and check Reinitialize The MAC Address of all network cards check box. Choose Full Clone. For cloned Image you can set 256MB Base Memory. Do not forget to configure newly created instances in GNS3 so they will be ready for placement into GNS3 topology.

Good Luck with studies!

< Back


    

13 comments:

  1. Thank you so much! I've been trying to find solutions on how to install JunOS for a week and this is the only fix!

    Good job mate! :)

    ReplyDelete
  2. Hi buddy,
    I glad information I gathered helped you.
    It means my effort was not for nothing.
    Good luck in your studies.

    ReplyDelete
  3. Thank you very much! I use step by step your method. It works! I will upgrade junos to the latest version. Is it possibe!
    Djaffer. france.

    ReplyDelete
    Replies
    1. Hi Djafar,
      Sorry for late response. I didn't try to use latest JunOS version. What I tried actually was even more interesting for me.
      I had installed j-web on one of my virtual routers.
      IT works! The only thing - I had to allocate something close to 700MB of memory per image as OS uses it to create virtual drive at the time of installation. FreeBSD node i used as FTP server for this installation.

      Good Luck.

      Delete
  4. I tried connecting two junos devices through this method using interface em1, both are up and up however i cannot ping each other.
    Help please?

    ReplyDelete
    Replies
    1. OK,
      Simple topology - two routers connected to each other through interfaces em0(note when you connect em0 interfaces in GNS3 they appear as e1).
      The interface configuration is as follows:

      root@RJ07> show interfaces terse
      Interface Admin Link Proto Local Remote
      cbp0 up up
      demux0 up up
      dsc up up
      em0 up up
      em0.0 up up inet 172.16.2.7/24

      Ping works between both routers.

      One more thing which I should mention - if you use em0 interface to connect to network devices then select checkbox against "Do not use first NIC for connection with host OS" item in virtual box configuration in GNS3.

      Hope it helps,
      Cheers

      Delete
  5. I have 2 Olive routers working in GNS. When I directly connect them, each can ping the other. If I put a virtual GNS switch or hub between them, the routers cannot ping each other. I need to be able to use virtual switches and/or hubs so I can connect virtual hosts to a Juniper router or connect a Juniper router to one of the cloud objects that's bridged to a real interface on my laptop/desktop. If I try to directly connect a Juniper router to a virtual host or a cloud object without a virtual switch, I get the message "Device does not support this type of NIO. Use an ETHSW or hub to bridge the connection to NIO instead". Any ideas?

    ReplyDelete
  6. Everything is ok, before I got to this step,

    When FreeBSD reboots to root prompt go to menu on top of VM window
    Click Devices --> CD/DVD Devices --> Choose a virtual CD/DVD disk file -->
    "jinstall10.1" in my case.
    I use Macbook Pro late 2013, OSX Maverick, FreeBSD 8.1 64bits, VirutalBox 4.3.6, GNS3 0.8.6.

    How should I continue? Please guide me!
    jbundle-9.2R2.15-export-signed.tgz

    ReplyDelete
  7. Looks like you didn't prepare Junos ISO image

    ReplyDelete
    Replies
    1. may i know how to prepare junos ios image.
      i am using freebsd dvd installer.
      can i use freebsd4.1.img that is offered at http://www.gns3.net/appliances/ ?
      Thank you so much.

      Delete
  8. sorry for my stupid question that i previously asked, i passed these all steps but at last i got another error. I think it will be the last error.
    after i typed "# pkg_add -f jinstall101.tgz" command, it showed

    Saving the config files ....
    Installing the bootstrap installer ...
    bsdlabel: Class not found

    WARNING: Failed while trying to install bootstrap loaders

    Deleting bootstrap installer ...

    WARNING: This installation attempt will be aborted.
    WARNING: If you wish to force the installation despite these warnings
    WARNING: you may use the 'force' option on the command line.
    pkg_add: install script returned error status

    ReplyDelete
    Replies
    1. Hi Eric,
      It sounds like you are missing something from previous steps.
      First check if all partitions have been created according section 6. Order is important. I.e.ad0a1f slice is /var.

      Than verify steps from section 7.
      It should work unless there is a mistake which is easy to make.
      Good luck.

      Delete
  9. Thanks for your every reply.
    I do appreciate. I do created /var partitions.
    But anyway, I will try again from step one again.
    Thank you.

    ReplyDelete