Jump to content


2

IOSv in GNS3


8 replies to this topic

#1 ccie4lab

ccie4lab

    Advanced Member

  • Members
  • PipPipPip
  • 57 posts
  • 14412 thanks

Posted 08 May 2014 - 12:02 PM

Following on from the Cisco ViRL - a first taste! post where I said that I was going to try and get the IOSv image working in GNS3 I have done a bit of playing around. After a few misses I finally got it working. So here is my walk through.

Firstly you need to get the ova file out of the onePk image - once you have loaded the onePk vm you can connect to it using WinSCP and get the ova file from /usr/share/vmcloud/data/images/vios.ova.
Importing the onePK vIOS ova file into VirtualBox

I first tried setting the IOSv image up as a VirtualBox guest and adding it to GNS3 that way. No go, and it bluescreened my laptop. DONT TRY THIS AT HOME KIDS!
Creating a vIOS Qemu guest (attempt 1)

Secondly I tried to create a Qemu guest by extracting the files from the ova and running a bunch of qemu commands to create an img file. I didn't get a bluescreen, and the image loaded, but nothing much happened after that, and I couldn't console onto it. So it was pretty useless.

Creating a vIOS Qemu guest (attempt 2)

The second attempt, and the one that works it to first extract the contents of the ova file. make sure that the Qemu settings in GNS3 work, so the All-in-One version of the GNS3 software is best, so that you get all the Qemu goodness.


Posted Image



The resulting vmdk can be run directly as a qemu guest. So with the following settings:

Qemu-flavor: -x86_64
Identifier name: anything you like
Binary Image: the extracted vmdk file
RAM: 384Mb works well, though Cisco recommend 512Mb
Number of Nics: anyting up to 8
NIC Model: e1000


Posted Image


You can then drag a Qemu guest onto GNS3. If you want one, drag on two and delete the first one, for some reason it didnt seem to like the first one, probably due to a numbering thing with the telnet ports.

When you click on boot the Qemu screen will come up, it will appear to hang at "Booting 'IOSv', this is fine, you should now be able to console onto the devices. I added one 7200 router (R1) with two gigabit ethernet interfaces (1.1.1.1/24 and 2.2.2.1/24) and three vIOS images (deleting the first one). The IOSv images had IP addresses 1.1.1.2 and 2.2.2.2 connecting them to the 7200 via gi 0/1, and 3.3.3.1 and 3.3.3.2 connecting them to each other vis gi 0/0. CDP worked, and so did ping:


Posted Image


Posted Image


I have uploaded a video showing all of the steps.



Thanked by 51 Members:

#2 wanzxj

wanzxj

    Advanced Member

  • Members
  • PipPipPip
  • 74 posts
  • 4131 thanks

Posted 08 May 2014 - 11:43 PM

hi,ccie4lab
    post image can not see.


###############################################################################
#
# This .ova contains a bootable disk image for IOSv that will work with
# ESXi5.1 and QeMU/KVM 1.4 hypervisors.
#
# The .ova cannot be imported to ESXi but it can be untarred and then a
# disk added to an existing VM with the extracted .vmdk file.
#
# As an example invocation, for QeMU, you can do the following:
#
#   qemu-system-x86_64 -boot d -nographic -m 512 \
# -netdev socket,id=id1,listen=:1234 -device e1000,netdev=id1,mac=52:54:99:66:99:51  \
# -netdev socket,id=id2,listen=:1235 -device e1000,netdev=id2,mac=52:54:99:66:99:52  \
# -netdev socket,id=id3,listen=:1236 -device e1000,netdev=id3,mac=52:54:99:66:99:53  \
# -netdev socket,id=id4,listen=:1237 -device e1000,netdev=id4,mac=52:54:99:66:99:54  \
# -netdev socket,id=id5,listen=:1238 -device e1000,netdev=id5,mac=52:54:99:66:99:55  \
# -netdev socket,id=id6,listen=:1239 -device e1000,netdev=id6,mac=52:54:99:66:99:56  \
# -netdev socket,id=id7,listen=:1240 -device e1000,netdev=id7,mac=52:54:99:66:99:57  \
# -netdev socket,id=id8,listen=:1241 -device e1000,netdev=id8,mac=52:54:99:66:99:58  \
# -hda vios-adventerprisek9-m.vmdk \
# -serial telnet:localhost:6662,nowait,server
#
# and then this to initiate connections to the above QeMU instance:
#
#   qemu-system-x86_64 -boot d -nographic -m 512 \
# -netdev socket,id=id1,connect=:1234 -device e1000,netdev=id1,mac=52:54:99:66:99:11  \
# -netdev socket,id=id2,connect=:1235 -device e1000,netdev=id2,mac=52:54:99:66:99:12  \
# -netdev socket,id=id3,connect=:1236 -device e1000,netdev=id3,mac=52:54:99:66:99:13  \
# -netdev socket,id=id4,connect=:1237 -device e1000,netdev=id4,mac=52:54:99:66:99:14  \
# -netdev socket,id=id5,connect=:1238 -device e1000,netdev=id5,mac=52:54:99:66:99:15  \
# -netdev socket,id=id6,connect=:1239 -device e1000,netdev=id6,mac=52:54:99:66:99:16  \
# -netdev socket,id=id7,connect=:1240 -device e1000,netdev=id7,mac=52:54:99:66:99:17  \
# -netdev socket,id=id8,connect=:1241 -device e1000,netdev=id8,mac=52:54:99:66:99:18  \
# -hda vios-adventerprisek9-m.vmdk \
# -serial telnet:localhost:4444,nowait,server
#
# For ESXi, the following steps may help in the creation of your VM for the
# first time:
#
#  1.  File -> New -> Virtual Machine
#  2.  Custom
#  3.  Name -> you choose
#  4.  Datastore -> you choose
#  5.  Virtual Machine Version -> choose latest version (8 for vCenter 5.0.0)
#  6.  Guest operating system -> Other, Other (32 bit)
#  7.  Number of Virtual Sockets -> 1, Number of cores per Virtual Socket -> 1
#  8.  Memory -> 512MB
#  9.  Network Connections
#    Number of NICs -> 1-7
#    Network -> you choose
#    Adapter -> E1000 (only supported adapter)
#
#  10. Connect at Power On
#  11. SCSI -> just hit Next, we don't want this
#    Disk -> Use Existing (for vmdk)
#    Use Existing -> Choose vmdk
#    IDE (0:0)
#    Indpendant
#    Persistent
#
#  12. Finish
#  13. Click on VM in Inventory window on left
#  14. Edit Virtual Machine Settings
#  15. If there is a SCSI device, remove it
#  16. Add a serial port
#    Connect via Network
#    Server (VM Listens)
#    Port URI -> telnet://172.18.67.37:5888 (ESXi host IP and free port)
#    Connect at Power On
#    Yield CPU on Poll
#    Finish
#    OK
#
# Copyright © 2011-2013 by Cisco Systems, Inc.
# All rights reserved.
#
###############################################################################

Thanked by 3 Members:
DESTCCIE2011 , kadm , eye

#3 Vedder2k

Vedder2k

    Member

  • Members
  • PipPip
  • 24 posts
  • 35 thanks

Posted 09 May 2014 - 07:23 PM

Hi ccie4lab, thanks for reposting my blog entries - but please if you are going to do this then just put at the beginning that this post was originally from www.802101.com ?

Thanks

Stuart

Edited by Vedder2k, 09 May 2014 - 07:39 PM.


Thanked by 2 Members:
DESTCCIE2011 , madtangetsu

#4 CallMeBond

CallMeBond

    Junior Member

  • Members
  • PipPip
  • 2 posts
  • 9 thanks

Posted 27 September 2014 - 11:25 AM

View PostVedder2k, on 09 May 2014 - 07:23 PM, said:

Hi ccie4lab, thanks for reposting my blog entries - but please if you are going to do this then just put at the beginning that this post was originally from www.802101.com ?

Thanks

Stuart

How do you run more than one vIOS in GNS3? I tried deleting the first one, and it worked, but after I saved the Project and tried to run it again I get a connection error when I open the console.

Thanks in advance

Thanked by 1 Member:
DESTCCIE2011

#5 jeges

jeges

    The Rocket

  • Honorary members
  • PipPipPip
  • 478 posts
  • 33368 thanks
  • Locationinside your brain

Posted 30 September 2014 - 12:14 PM

View PostCallMeBond, on 27 September 2014 - 11:25 AM, said:

How do you run more than one vIOS in GNS3? I tried deleting the first one, and it worked, but after I saved the Project and tried to run it again I get a connection error when I open the console.

Thanks in advance
Like a simple dynamips instance ... you can add any qemu instance to the topology, the console connection (on m$) can be tricky and completely lost, even if you want to reconnect, it possible wont, btw this is another issue, keep open a telnet/ssh for this case

so, you can put any vios instance as you wanted, somewhere in onepk thread we have talking about this. Be careful with saving, the normal method (just issuing copy run start or wr will success but after you've closed the topology, the 'virtual flash' is gone, this is problem, bcos the vios using its flash card to emulate the nvram location xDDD, my experiences recommend that you must save those flash files (just check the qemu files box during saving your topology) too.

Might be this is enough to keep your configuration, if it isn't just copy the startup-config to the flash:startup-config ;-)
HTH

Thanked by 1 Member:
DESTCCIE2011

#6 hogehoge272727

hogehoge272727

    Junior Member

  • Members
  • PipPip
  • 5 posts
  • 0 thanks

Posted 25 October 2015 - 09:31 PM

thanks

#7 fat100

fat100

    Junior Member

  • Members
  • PipPip
  • 2 posts
  • 1 thanks

Posted 03 March 2016 - 07:03 PM

Hi,

I can run vios correctly in GNS3 as Qemu VM. But everytime I open the project, the config disappeared. Though before closing my project, I made a double check by doing a RELOAD in order to check the config. RELOAD was OK, the config stayed there.
I've also tried to give more RAM: before = 384 after = 512. But the issue wasn't solved.
Any one has a good idea?
Thx.

Thanked by 1 Member:
DESTCCIE2011

#8 lenia

lenia

    Member

  • Members
  • PipPip
  • 10 posts
  • 8 thanks

Posted 25 May 2016 - 02:58 PM

Thank you

Thanked by 2 Members:
DESTCCIE2011 , mark1990

#9 karasuo

karasuo

    Junior Member

  • Members
  • PipPip
  • 2 posts
  • 1 thanks

Posted 19 November 2016 - 12:09 PM

thank

Thanked by 1 Member:
DESTCCIE2011



0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

Organization

Community

Downloads

Test Providers

Site Info


Go to top