- Thanks for the converter, but the actual implementation of this so that a default missing image displays iteslf, is a bit over my head. I have tried a few times looking around and with best guesses, but I cant figure out how to implement it.
- The official guide and reference for GNS3.
Originally only emulating Cisco devices using software called Dynamips, GNS3 has now evolved and supports many devices from multiple network vendors including Cisco virtual switches, Cisco ASAs, Brocade vRouters, Cumulus Linux switches, Docker instances, HPE VSRs, multiple Linux appliances and many others. As the GNS3 VM is used in the article, GNS3 will check the md5sum and size of the file against the values listed in the.gns3a template. If those are matches, GNS3 will upload a copy of that file to the GNS3 VM. If the file was successfully uploaded to the GNS3 VM, you’ll see a green box in the upper-right corner of the GNS3 GUI indicated that.
The primary disk is accessible within IOSv asflash: (or flash0:), a second disk as flash2:,a third disk as flash1: (no typing error!!!).I haven't tested, but the fourth disk should be flash3:.The disks must have one partition with fat format.
If any flash device / disk contains a file namedios_config.txt and has a valid checksum file named ios_config_checksumthen an existing NVRAM is ignored anda new config is created from the ios_config.txt.This config is activated as a running config andalso stored in the NVRAM as a startup-config.Afterwards the ios_config.txt is cleared,so it won't be used on the next boot.
The checksum file ios_config_checksum must contain themd5 checksum of ios_config.txt (32 ascii characters)plus an optional linefeed.
You need to access the command line of the linux system of the GNS3 VM.While this can be done via the 'Shell' function of the console menuit's much more convenient to use putty/ssh to connect to the GNS3 VM.Then you can use cut-and-paste.Furthermore you should setup winscp/scp tosave the resulting image back to your PC.
In this receipt I use mtools to work with dos formatted disk images.It can also be done with loop mounting the disk image,but that needs root privileges.That means you have to be very careful with the permissions.The mtools are pure user mode applications andare much easier to work with (IMHO).So lets install them:
We need an empty dos formatted disk image.While there are many tools to achieve that,I'm using IOSv to create it.That way there will be no issues with disk format compatibility.It's a bit complex, but we need to create it only once.For lazy guys I have included my empty disk imagein the sample disk image (see the end of the page).
First create a new IOSv router in a temporary project.Then add an empty disk image to it:
Cisco Iosv 15.6
- right-click on the IOSv router and select 'Configure'
- select the HDD tab andcreate a new disk image for HDB (Primary Slave) by clicking 'Create...'
- stay with the defaults in 'Binary and format' and 'Qcow2 options'
- In 'Size and location' set the 'File location:' to 'dummy.qcow2'and the 'Disk size:' to '1 MiB'
- Finish
- set the disk interface of HDB to the same as HDA, best is 'virtio'
- apply with 'OK'
Now start the IOSv router,if the initial configuration dialog is shown, abort that with 'no'.Wait until the router is fully booted.The nice thing about IOSv is,that it automatically formats unformatted disks for use as a flash drive.So our just created empty disk image is now DOS formatted and ready to use.Therefore stop the router.
Now we need to determine, where GNS3 has stored our disk image.For that right click on the IOSv router and select 'Show in file manager'.You will get a popup like this:
Select the directory (as shown in the above image) andcopy that to the clipboard.
In the linux CLI of the GNS3 VM we will now copy and convert the HDB disk.Furthermore we delete the temporary dummy disk image:
Now we can delete the IOSv router in the GNS3 project, it has done it's job.
Of course, you now need a startup configuration.I use the ios_base_startup-config.txt as a base,only deleting the 'hostname %h' line, as the %h substitution won't work here.Save your config as 'ios_config.txt'.
Now we have finally all needed parts andcan create the startup configuration image:
So what's this '@@63S' stuff???mcopy works with DOS partitions,but our IOSv_startup_config.img is a disk image starting with a MBR.So we have to tell the mtools,that the partition starts with an offset of 63 sectors.
Cisco Ios Save Config
In the IOSv template we now add theIOSv_startup_config.img as HDB (with the same disk interface as HDA!!!).All newly created IOSv router will now start with this config.
Gns3 Iosv Startup Config.img
I've created an example disk image (IOSv_startup_config.img)with a startup_config based on the dynamips startup config.
Cisco Startup Config
Together with the empty disk image it's included inIOSv_startup_config.zip.