Setting up GNS3 - Step by Step


djgizmo

6 posts in this topic Last Reply

Recommended Posts

I've spent the last 2 days trying to learn everything I can how to setup GNS3 on Unraid VM.   

 

  1.  Get a drink, this could take a while. 
  2. Shutdown all of your VMs.  Yes, this is needed. 
  3. Install User Scripts if you don't have it already.
    1. Once installed, go to settings > User Scripts
    2. Add 2 new scripts - One "Enable Nested VMs" and another one, "Disable Nested VMs"
    3. Go here and grab the snippets for these.  
      1. if you have AMD cpu, you'll need to adjust the scripts.  Read the snippets, takes 2 seconds to adjust for AMD.
    4. Once done, run the Enable Nested VMs script via RUN IN BACKGROUND.   It'll take about 5-10 seconds to run.  click show log to verify that it was successful. 
      1. Look for... 
        Nested vms are enabled for intel cpus
        Script Finished blah blah blah

         

      2. Warning - if you have a Windows VM and AV on it, turning on these nesting settings can cause issues.  My suggestion, turn off the AV for the vm. 

  4. Download the GNS3 VMware workstation VM. (Yes, I know other posts have said download the virtual box one, but just humor me)
    1. Open the zip, extra the OVA file. 
    2. Using Winrar or 7zip, open the OVA file, and extract the .vmdk files
    3. rename and remove any spaces out of the name of the vmdk files
  5. Login via ssh to your unraid box. I use mobaXterm to make this process easier as you'll need to get the domains folder and upload the .vmdk files we just extracted.
    1. path to the domains share
  6. Open your unraid gui and start creating an Ubuntu vm. 
    1. Change your initial memory to whatever you think is best.  I used 4096 for my box. 
    2. Machine - Q35-2.12
    3. Bios - SeaBIOS
    4. leave the rest the default.   Make sure your Network Bridge is set (your VM needs an interface)
    5. Click Create, but do not start it. 
    6. This will create the folder under the domains share. 
  7. open the newly created folder in SSH (mine was GNS3), and then upload/scp files to this folder. 
  8. Once these have been uploaded, we HAVE to convert them to raw.  Yes, unraid does support vmdk, but in my experience over the past 48 hours has shown me, that not all things work the way they should.  
    1. use these commands to convert them.  Obviously, adjust your file names to what your files are named.
    2. qemu-img convert -f vmdk -O raw GNS3VM-disk1.vmdk GNS3VM-disk001.img
      qemu-img convert -f vmdk -O raw GNS3VM-disk2.vmdk GNS3VM-disk002.img

       

      This WILL expand the files... ALOT.   Mine expanded to 117Gbits from 339MB.   Thanks GNS3 for over killing the vmdk space :eyeroll:

       

    3. delete the other .img file that was created when you created the vm.  

  9.  Back in the Unraid gui, edit the newly created GNS3 vm. 

    1. Primary vDisk Location - change to manual - path to your newly created disk001.img is (mine ended up being /mnt/user/domains/GNS3/GNS3VM-disk001.img)

    2. Add another vDisk location - change to manual - repeat - (/mnt/user/domains/GNS3/GNS3VM-disk002.img)

    3. Change BOTH of these to SATA.  If you leave this as VirtIO, the vm will start to boot, but won't finish booting (the lizard will never get the bug)

    4. Once you change to SATA, save the changes and boot the vm, and connect to it via the VNC console.  You might see an Ubuntu screen first, press enter and continue the boot.  

    5. Voila!  GNS3 vm has booted.  However, it's might be complaining about KVM support (Nested Virtualization).  Did you do Step 3?

    6. If GNS3 isn't complaining about KVM and it showing "KVM support available: True" then you're set to setup the network portion.

      1. Configure the network as you see fit.  I personally statically assign all my vms, but if you have DHCP on your bridged network, it'll already have an IP. 

    7. Finish that drink!

 

P.S. Attached is my XML for this VM if you need to break it down for some reason. 

 

 

 

You'll need to reconfigure the GNS3 client app to use the VM.  

 

 

Open GNS3, edit, preferences, server, un-tick Enable local server, enter the IP of your GNS3 vm.  I had to uncheck auth, but too tired to experiment anymore. 

Done.  

 

NOTE:   If you've created any specific devices from templates... you'll probably have to recreate those as the devices you've saved were pointing a local VM (VMWare Workstation or Virtual Box).   As a MIkrotik guy, this made me sad as I had 10 versions of RouterOS saved which had to be recreated. 

GNS3_XML.xml

Edited by djgizmo
added XML file and added GNS3 config detail
Link to post
  • 1 year later...
  • 2 months later...
  • 1 month later...
On 12/30/2019 at 1:59 AM, A75G said:

Thank you for the guide been using it for months now it really helped me on my certs.

One question is there way to reduce the size of the IMG because my SSD isn't keeping up with it?

  

You can reduce the size by converting to a QCOW2 image instead.  It is MUCH smaller than the .img file above.  The command for that is this

 

qemu-img convert -f vmdk -O qcow2 ./GNS3_VM-disk1.vmdk ./GNS3VM-disk1.qcow2

 

I've been running GNS3 for about 2 years now with this method.

Here are my file sizes for reference

1.5G    ./GNS3VM-disk1.qcow2
42M     ./GNS3VM-disk2.qcow2
532M    ./GNS3_VM-disk1.vmdk
1.9M    ./GNS3_VM-disk2.vmdk

 

As far as the settings for the VM, the only thing I changed was the bios stays SeaBIOS but the Machine is i440fx-4.2.  Also the Primary vDisk Bus is now SCSI instead of SATA.

 

Let me know if you get stuck!

Edited by xhaloz
Link to post

Don't forget to change the format on the VM xml / GUI to qcow2 as well. It's very easy to forget after you finished the qemu-img convert.

You don't need SCSI to use qcow2 but you should use it to allow the drive to show up correctly to Windows as thin provisioned.

Note that you want to install the driver first before changing your drive bus or you may end up with endless bluescreen at VM boot (if that happens, switch back to SATA and it should boot normal again for you to install the driver).

 

And note that raw img is also thin provisioned, just that the size you see is the max size and not the used size.

Link to post
  • 6 months later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.