28 September 2016

JunOS SRX on GNS3 (running JunOS vSRX FireFly inside remote GNS3VM)

Things have come a long way with GNS3 ( I was an early user since waaaaay back, and also contributed as a crowd funder when it got a new lease of life a couple years ago - if something helps your career, and hobby, share what you can afford ).

I recently upgraded to the latest version (1.5.2), to try some Juniper labs. And it is much easier now.

TLDR; You still have the readonly VMDK image issue, but once you've converted the image to qcow2, it just works, and the console just works :)

1) Get the GNS3 Client up and running and run the GNS3VM somewhere on the same layer-2 network (I have the GNS3VM running on an ESXi host (with ESXi Nested Virtulisation enabled), and run the GUI/Client on my Mac).

2) Get a copy of JunOS FireFly (.ova) - I'm sure you can figure it out.

3) Extract the .ova file (If you don't have a copy of Linux, you can always use your new GNS3VM! - I.e. copy the .ova file using SCP to somewhere on the GNS3VM and run these commands on there)

tar -xvf junos-vsrx-12.1X46-D25.7-domestic.ova


4) The disk type for the FireFly images is "streamOptimized" which is read only. We need to change this to QCOW2 to make R/W as QEMU cannot cope otherwise.


qemu-img convert -O qcow2 junos-vsrx-12.1X46-D25.7-domestic-disk1.vmdk junos-vsrx-12.1X46-D25.7-domestic.img

5) Back in GNS3 Client; GNS3 -> Preferences -> QEMU -> QEMU VMs
  5.1) Click "New"
  5.2) Choose "Run the QEMU VM on the GNS3 VM" (assumes you have added GNS3VM to the GNS3 Client).
  5.3) Give the VM a name, related to the Image version etc.
  5.4) Give at leat 2GB of RAM (whilst getting things stable its best to satisfy the requirements, dont set lower than 512MB per VM).
  5.5) Browse to the .img file you extracted in step 3 and click "Next"
(If you used your GNS3VM to run the tar and qemu-img commands, you will need to copy the .img file back to your client so you can upload the .img file here into GNS3 using the Client).

6) Edit your JunOS instance as needed (adding more interfaces etc), and save.

7) Drag the new JunOS Instance onto your GNS3 map, click "Start", click "Console" and enjoy :)


No comments:

Post a Comment