[Solved] How to Connect GNS3 to VirtualBox: Virtual Network Lab with GNS3

By | June 20, 2014

We were discussing about physical networking with GNS3. GNS3 is the wonderful software for virtual networking computing. Last article, we had a discussion on virtual LAN network by interfacing GNS3 to local PC via Microsoft Loopback adapter. In this tutorial I would like to share how to configure GNS3 to connect VirtualBox virtual machines. As we know GNS3, the best virtual network software, supports oracle VirtualBox, hence it is easy to work around VirtualBox virtual machines (VMs) as comparing to vmWare VMs. Even though we could Interface GNS3 to vmWare with some tweaks that I will cover later. By interfacing GNS3 to connect VirtualBox you may realize the real network scenarios as a practical feel.

Now, let’s see the steps for connect GNS3 to VirtualBox Virtual Machines.


Before you Begin

Please make sure that you have the knowledge of the following and have equipped with specified tools and hardware.

Preliminary Knowledge

Tools required

  • Cisco IOS: GNS3 works with real Cisco Internet Operating System, you need to have a Cisco IOS for setting up virtual network labs. Distributing Cisco IOS is illegal so I could not support you for that, just Google it.
  • Oracle VM VirtualBox: There are many Virtualization software are available, but Oracle VirtualBox is FREE and GNS3 supports it directly! Download Oracle VirtualBox

My Hardware:

  • Intel Core i3 Windows 7 PC
  • 8GB RAM

I recommend these hardware configurations to learn virtual networking concepts because virtual machine networking requires at least 2 VMs to be up and run. Anyway you may also proceed even with 4GB RAM.
No you are ready to go….!

How to Connect Gns3 to VirtualBox VMs

VMs acts as virtual network client for GNS3 network topology.The step by step procedure to connect GNS3 to VirtualBox as follows.
Step 1: Setting up of VMs
Make sure you installed VirtualBox VMs, for me I have 4 VMs installed. Among these I will connect Win7_1 and Win7_2 to GNS3.
Step 2:
Run GNS3, Edit → Preferences → VirtualBox

In the General Settings tab click ‘Test Settings’ button, you will see a message ‘VBoxwrapper and VirtualBox API have successfully started’.
Step 3:
Select ‘VirtualBox Guest’ tab, you may find all VMs in the VM List. Select suitable one after setting an Identifier Name. Set required VMs and the click Save button.


Step 4:
Browse VirtualBox guest to the work space.
If you have more than one VM, you will be asked to select one among those.
Step 5: GNS3 Network scenario with VirtualBox
Build a simple scenario with VirtualBox guest. For me, I done with two VMs and one router.
Step 6: Run Simulation
Now let’s run our Network. Before running the simulation open VirtualBox side by side with GNS3. [Only open VirtualBox, do not run any VMs]. Then click Start button to begin simulation.

After starting the simulation the we can see all of the VMs that you added in the example scenario will run automatically.
Step 7: Set Static IP for VMs
Once the VMs are started change the IP of virtual machines. In my example I assigned and to the VMs
Step 8: Cisco Router Configuration for VirtualBox Interface.
Now configure the router and assign IP address to each port. Configuration commands are followed.

R1#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
R1(config)#interface fastEthernet 0/0
R1(config-if)#ip address
R1(config-if)#no shutdown
*Jun 17 14:15:11.947: %LINK-3-UPDOWN: Interface FastEthernet0/0, changed state to up
*Jun 17 14:15:12.947: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up
R1(config)#interface fastEthernet 0/1
R1(config-if)#ip address
R1(config-if)#no shutdown
*Jun 17 14:15:30.303: %LINK-3-UPDOWN: Interface FastEthernet0/1, changed state to up
*Jun 17 14:15:30.739: %SYS-5-CONFIG_I: Configured from console by console
*Jun 17 14:15:31.303: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to up
R1#copy running-config startup-config
Destination filename [startup-config]?
Warning: Attempting to overwrite an NVRAM configuration previously written
by a different version of the system image.
Overwrite the previous NVRAM configuration?[confirm]
Building configuration...

Step 9: Ping test and verification
Try to ping from the router to the VMs and vice versa.

[Pinging from router CLI to VMs]

[Pinging from VMs to router]

Troubleshooting: Unable to ping from VirtualBox to Router

IT Technician With Server Cables

Sometimes you can’t ping between VirtualBox VM and router. This is because your firewall blocking ICMP traffic. To get rid of from the issue disable firewall in the VirtualBox VMs or allow the networks 10.0.0./8 and Actually disabling firewall is not a proper way, but times being do it. I will be sharing detailed troubleshooting guide for Windows firewall and other third party antivirus firewall.

Keep visiting SPT for more computer networking tutorials and how to guides. Don’t forget to like our Facebook page.

16 thoughts on “[Solved] How to Connect GNS3 to VirtualBox: Virtual Network Lab with GNS3

  1. foysal chowdhury


    hi ,thank you
    great help for me that doc.but one think i need for better solution .
    when i connect the VB pc .at that time i can not login the VBox seesion.

    please give me solution.

    thank you

    foysal chowdhury

    1. Admin Post author

      Hi foysal,
      Could you please figure out what kind of error message you are getting?


  2. slight

    When GNS3 changes the network adapter on my VBox VM’s to Generic Driver and UDPTunneling, my VM’s won’t open. I get this error:
    Failed to open a session for the virtual machine XXXXXXX.
    UDPTunnel: Failed to start the UDP tunnel server

    Also, I am using Windows as my host environment. Any thoughts?

  3. slight

    Here is the error GNS3 gives:
    Server error [-3200] from SOBlue: Could not open the pipe \\.\pipe\VBOX\XXXXX: [Errno 2] No such file or directory: ‘\\\\.\\pipe\\VBOX\\XXXXXX’

  4. Deven

    Hi there, Thank you for the step-by-step guide.
    I am trying to connect two or more VirtualBox VMs with a cisco IOU, in a same subnet within GNS3. I can successfully ping between Cisco IOU(Layer2 switch, simulation) and the router. But I am not getting anything when trying to ping VMs. Subnet I am using is /22
    Cisco router
    Cisco IOU(vlan 1)
    VM DC (cannot ping)

    VMs are connected to correct vlan, which is vlan 1.
    When I connect one of the VMs directly to the router, bypassing Cisco IOU, I do get successful pings from both sides (router and the VM).

    When I omit VMs and just connect Router and Cisco IOU, I do get successful pings from both sides again.

    But when I put together everything connected.( Router to Cisco IOU to VMs) I just get successful pings from router and IOU, back and forth.

    Please assist me , thanks in advance.

  5. radlad

    After testing on GNS3, i get “VirtualBox is not installed.”, yet it is installed. The working directory is ths appdata/local/temp like yours. What else should I check to connect GNS3 with VirtualBox?

  6. joe

    how would you get this to work if you did not want your virtual machines to receive the ip address statically? I have my topology to where the router is handing out the addresses via dhcp.

  7. maedeh

    Hi tanks for your web
    could you please help me ,in gns3 1.2.3 how could i connet vbox to gns

  8. maedeh

    maybe no one is there
    i have the same question az radled

    After testing on GNS3, i get “VirtualBox is not installed.”, yet it is installed. The working directory is ths appdata/local/temp like yours. What else should I check to connect GNS3 with VirtualBox?

    plz help me

  9. Muhammad Altaf


    After testing on GNS3, i get “VirtualBox is not installed.”, yet it is installed. The working directory is ths appdata/local/temp like yours. What else should I check to connect GNS3 with VirtualBox?
    plz help me


  10. arun

    I am using GNS 3 ver 1.3.9 and vbx when i try to run gns 3 it give me error
    => Error while creating project: Client version 1.3.9 differs with server version 1.3.3
    i have downloaded the latest vm appliance from sourceforge.net but still i am getting this error

  11. mohammed wazeer

    Hi Admin,

    I new to this field, I want to test GNS3 through script. for your document understood few points. 1) Install GNS3 and Oracle VM Box, 2) configure VM ip 3) design the topology in GNS3 and mapped respective vm. 4) Doubts: Manually its ok but I need to configure through script (tcl/ python) . Requesting you to please send me the solutions.

    Mohammed Wazeer

  12. Khalilullah

    New to Networking world, I found your activities overwhelming. Good Job


Leave a Reply

Your email address will not be published. Required fields are marked *