Tuesday, April 12, 2011

Finally Working GNS3 ASA/ASDM6.31 on Ubuntu 10 & 11

I was struggling to tftp asdm-631.bin file to a running ASA and keep getting an error message
right after uploading 2MB! So, I found a way to transfer it offline!

On your machine that runs GNS3,

$ sudo -i

(find the GNS3 tmp file for your ASA)
Turn off ASA1 (I assumed you are working on ASA1)

# cd /opt/GNS3/tmp/ASA1
# rename/delete the current FLASH (you will loose all the modifications!)
# qemu-img create FLASH 256M

# qemu-img info /opt/GNS3/tmp/ASA1/FLASH

Turn it on and let the FLASH get initialized and then turn it back off.

# losetup /dev/loop0 FLASH
# kpartx -av /dev/loop0
# ls -alF /dev/mapper/
# mkdir test
# mount /dev/mapper/loop0p1 test/
# cp /root/asdm-631.bin test/lina-data/1/soft/
# umount test/
# sync
# kpartx -d /dev/loop0
# losetup /dev/loop0 -d

Start ASA1 and you should be able to see ASDM file on your flash!
and can be configure your ASA for ASDM access.



Ref:
------------------------------------------------------------------------------------------------------
http://goo.gl/1I1rA (mount a qemu image)
http://goo.gl/C6JcS (how to emulate ASA8.0(2) without proxy!)
http://goo.gl/c3aRl (patch compile qemu0.13+UDP patch)
http://goo.gl/90STb (recompile kernel / set HZ=1000)

Original Issue:
------------------------------------------------------------------------------------------------------
Accessing tftp://10.10.10.1/asdm631.bin...!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Writing file disk0:/asdm631.bin...
Losing too many ticks!
TSC cannot be used as a timesource.
Possible reasons for this are:
You're running with Speedstep,
You don't have DMA enabled for your hard disk (see hdparm),
Incorrect TSC synchronization on an SMP system (see dmesg).
Falling back to a sane timesource now.

9 comments:

  1. Hi, I tried doing this but got errors with these lines:
    # mount /dev/mapper/loop0p1 test/
    # cp /root/asdm-631.bin test/lina-data/1/soft/

    Please help in any way you can.

    ReplyDelete
  2. First make sure you have a running ASA, then
    turn it off, delete the FLASH file (or move it somewhere else).

    After creating the FLASH file with qemu-img create FLASH 256M, you need to turn ASA on to initialize the FLASH.

    then try the rest. Let me know.

    ReplyDelete
  3. qemu-img info FLASH

    (I turned on the ASA)

    losetup /dev/loop0 FLASH

    (After the losetup command I get the output below:
    losetup: /dev/loop0: device is busy)

    kpartx -av /dev/loop0
    ls -alf /dev/mapper/
    mkdir test
    mount /dev/mapper/loop0p1 test/
    (After the mount command I get the output below:
    mount: special device /dev/mapper/loop0p1 does not exist)

    ReplyDelete
  4. Thats my suggestions:

    1- Turn off GNS3
    2- if you have created /dev/loop0 before, you need
    to deleted first, before you can created again:

    root@ipng:/srv/GNS3/tmp/ASA1# losetup -d /dev/loop0

    ReplyDelete
  5. You're the genius man. It finally worked. Thank you so much!!!!

    ReplyDelete
  6. To answer your question. It should be there by default. Can you check and confirm?

    ReplyDelete
  7. got it working, i'd tried creating FLASH in qcow2 format, that seems to have been the problem

    ReplyDelete
  8. Can't thank you enough for this.

    One problem I had with your instructions was I was running GNS3 with my userid (not root). So I had to chown & chgrp the FLASH file to my userid after creating it with qemu-img. After I did this your instructions worked perfectly.

    Thanks a million!

    ReplyDelete