GNS3 Qemu Troubleshooting

Many GNS3 users use Qemu emulator to run various network OS installed on Qemu images - for example Olive, ASA, Vyatta and many others. Some users complain about not having a network connections between these devices or a console window appears and disappears  after the short time. In both cases Qemu hosts are not started properly and Qemu images don't work.

This issues are typically caused by entering a wrong parameter in GNS3 setting.  For instance  when user checks a box "Use kvm" in GNS3 settings and CPU doesn't support kvm or kvm is not enabled in BIOS, it ends with warning message "unknown parameter kvm" and Qemu image is not started. Please remember that  kvm is not supported by Windows so you shouldn't have  "Use kvm" checked if GNS3 is installed on Windows.

Another issue mainly occurs on Linux and Mac OS and it is caused by using unpatched Qemu binary. GNS3 create UDP tunnels in order to make connection between Qemu devices  and that is why  Qemu source have to be patched for UDP tunnels, compiled and installed by user. Although many Linux distributions already have Qemu installed in /usr/bin/ directory, this version of Qemu is unlikely to be patched for UDP tunnels. For this reason the Qemu doesn't understand parameter -net type udp and it is halted after its start.

As long as patched Qemu binary is included in GNS3 all-in-one package, the Windows users  don't need to patch, compile and install Qemu by themselves.

Except of the wrong parameters I have already mentioned there can be another problems which  prevent Qemu  starting successfully.  If you find Qemu difficult to start you should consider to do following troubleshooting to find out the reasons why Qemu doesn't work.

1/ Start script from Linux terminal console.  The script is located in a in  the GNS3 root directory, in the directory ./qemuwrapper

sudo /home/brezular/Download/GNS3-files/GNS3/Stable/GNS3-0.7.3-src/qemuwrapper/

Qemu Emulator Wrapper (version 0.7.3)
Copyright (c) 2007-2010 Thomas Pani & Jeremy Grossmann

Unpacking pemu binary.
Qemu TCP control server started (port 10525).
Listenning on all network interfaces

The script has started Qemuwrapper server on TCP port 10525.

2/ Start GNS3 application

Create a new blank project and save it. Drug two Qemu hosts or Junipers from left panel and drop them in to the GNS3 Desktop (Figure 1). You should see a warning message - Qemu is already running on port 10525, it will not be shutdown after you quit GNS3.  It simply means that GNS3 has tried to start Qemu wrapper server on TCP port 10525 but another Qemuwrapper server is running on this port. We started it by ourselves with qemuwrapper script.

It is time to make connection between nodes . Connect them with Ethernet link and  start both Qemu hosts.

Figure 1. Qemu hosts connected through e0 interfaces

3/ Check the output of qemuwrapper script in console window. It should look like this:

Qemu path is now /usr/bin/qemu
Qemu-img path is now /usr/bin/qemu-img
!! QEMU1.console = 3000
!! QEMU1.netcard = e1000
!! QEMU1.image = /home/brezular/Download/GNS3-files/PC/Microcore/Stable/Host/3.4/linux-microcore-3.4.img
!! QEMU1.ram = 48
!! QEMU1.options = -no-acpi -nographic
!! QEMU2.console = 3001
!! QEMU2.netcard = e1000
!! QEMU2.image = /home/brezular/Download/GNS3-files/PC/Microcore/Stable/Host/3.4/linux-microcore-3.4.img
!! QEMU2.ram = 48
!! QEMU2.options = -no-acpi -nographic
command: ['/usr/bin/qemu', '-name', 'QEMU1', '-m', '48', '/tmp/QEMU1/FLASH', '-hdb', '/tmp/QEMU1/SWAP', '-net', 'nic,vlan=0,macaddr=00:aa:00:18:6c:00,model=e1000', '-net', 'udp,vlan=0,sport=20003,dport=20002,daddr=','-net', 'nic,vlan=1,macaddr=00:00:ab:da:3d:01,model=e1000', '-net', 'nic,vlan=2,macaddr=00:00:ab:c3:46:02,model=e1000', '-net', 'nic,vlan=3,macaddr=00:00:ab:e9:c9:03,model=e1000', '-net', 'nic,vlan=4,macaddr=00:00:ab:77:f1:04,model=e1000', '-net', 'nic,vlan=5,macaddr=00:00:ab:f2:3c:05,model=e1000', '-serial', 'telnet::3000,server,nowait', '-no-acpi', '-nographic']
Invalid -net type 'udp'
pid: 30268
Renicing to 19
30268: old priority 0, new priority 19
command: ['/usr/bin/qemu', '-name', 'QEMU2', '-m', '48', '/tmp/QEMU2/FLASH', '-hdb', '/tmp/QEMU2/SWAP', '-net', 'nic,vlan=0,macaddr=00:aa:00:98:21:00,model=e1000', '-net', 'udp,vlan=0,sport=20002,dport=20003,daddr=', '-net', 'nic,vlan=1,macaddr=00:00:ab:09:1d:01,model=e1000', '-net', 'nic,vlan=2,macaddr=00:00:ab:26:50:02,model=e1000', '-net', 'nic,vlan=3,macaddr=00:00:ab:25:86:03,model=e1000', '-net', 'nic,vlan=4,macaddr=00:00:ab:6d:a3:04,model=e1000', '-net', 'nic,vlan=5,macaddr=00:00:ab:53:34:05,model=e1000', '-serial', 'telnet::3001,server,nowait', '-no-acpi', '-nographic']
Invalid -net type 'udp'
pid: 30367
Renicing to 19
30367: old priority 0, new priority 19

The green lines refer to Qemu1 device. They are several parameters there such as RAM , console port, netcard type and path to  the base image. Please, notice QEMU1.options  parameters - no-acpi and -nographic.  If you have any problems with Qemu it is probably a good idea to leave this Qemu option box blank in GNS3 setting. Likewise blue lines refer to QEMU2 device.

As you can see from Figure 1 QEMU1 and QEMU2 are connected together via their eth0 interfaces.  They both use UDP tunnels for traffic transferred between them - QEMU1 sends all the traffic destined for QEMU2 to IP address,  destination UDP port 20002. QEMU2 is listening to traffic from QEMU1 on its source UDP port 20002. Likewise QEMU2 sends traffic destined for QEMU1 to IP address, destination UDP port 20003 and QEMU1 is listening to traffic from QEMU2 on its source port 20003.

If the Qemu had been properly patched for UDP tunnels a network connection would have been working between Qemu hosts.  For this demonstration  unpatched qemu binary in /usr/bin/ directory is used thus Qemu is stopped with  an error message Invalid -net type 'udp'. If I edit .net file and set qemu path to /usr/local/bin/qemu ,  hosts will be started correctly because version of Qemu located in /usr/local/bin/ directory  is patched for UDP tunnels.

4/ Conclusion

You should have now a brief  idea of Qemu  troubleshooting for GNS3.  At least you know how to get an output of qemuwrapper and post it on GNS3 forum.

In addition to stable UDP and multicast patch which is available for download in GNS3 Download section there is continuously  updated  patch for almost each new Qemu version in the  GNS3 Development section.  As I wrote Windows users don't need to patch source by themselves due to the fact that GNS3 all-in-one package contains patched Qemu version.


7 thoughts on “GNS3 Qemu Troubleshooting

  1. I am still having the problems with the -serial telnet:: and no listener on TCP/3000. This is (unfortunately) on Windows 7 64-bit.

    Any suggestions for a Windows user? I've narrowed the problem to either qemu.exe or qemuwrapper.exe. After some failed attempts, qemu.exe starts crashing, too.

  2. Can you please help me with this ? I am trying to run file on mac and it gives me this error :

    speedy:~ abcd$ cd '/Users/abcd/Downloads/' && '/usr/bin/pythonw' '/Users/abcd/Downloads/' && echo Exit status: $? && exit 1
    File "/Users/abcd/Downloads/", line 1

    SyntaxError: invalid syntax

    Without running this, I dont think I can run Qemu. It keeps saying cannot connect to port 10525.

  3. I have all in one installed but still I am getting error connection refused restart in 5 sec...I am using 845 with no issue but 802 give me error connection refused....

  4. Hi Brezular,
    I have the cisco ASA in Ubuntu 14 in GNS3beta3. It comes up with a green light but the console window disappears when I try to connect. There is no qemuwrapper in the new version or I can't find it. Do you have thoughts on how to fix this?

    • evan,
      open a terminal window and issue the command:

      Here is the ouput from Arista switch:

      GNS3 server version 1.0beta3
      Copyright (c) 2007-2014 GNS3 Technologies Inc.
      Running with Python 3.3.2 and has PID 22914
      [I 141020 17:09:58 main:75] current locale is en_US.UTF-8
      [W 141020 17:09:58 config:82] no configuration file could be found or read
      [W 141020 17:09:58 __init__:125] dynamips binary couldn't be found!
      [I 141020 17:09:58 base:131] dynamips module running with PID 22918
      [I 141020 17:09:58 base:84] ZeroMQ client (dynamips) connecting to
      [W 141020 17:09:58 __init__:77] VPCS binary couldn't be found!
      [I 141020 17:09:58 base:131] vpcs module running with PID 22921
      [I 141020 17:09:58 base:84] ZeroMQ client (vpcs) connecting to
      [I 141020 17:09:58 base:131] virtualbox module running with PID 22924
      [I 141020 17:09:58 base:84] ZeroMQ client (virtualbox) connecting to
      [I 141020 17:09:58 base:131] qemu module running with PID 22925
      [I 141020 17:09:58 base:84] ZeroMQ client (qemu) connecting to
      [W 141020 17:09:58 __init__:82] iouyap binary couldn't be found!
      [I 141020 17:09:58 server:223] ZeroMQ server listening to
      [I 141020 17:09:58 base:131] iou module running with PID 22930
      [I 141020 17:09:58 base:84] ZeroMQ client (iou) connecting to
      /usr/lib/python3.3/site-packages/ UserWarning: /root/.python-eggs is writable by group/others and vulnerable to attack when used with get_resource_filename. Consider a more secure location (set with .set_extraction_path or the PYTHON_EGG_CACHE environment variable).
      warnings.warn(msg, UserWarning)
      Starting server on (Tornado v3.2, PyZMQ v14.1.1, ZMQ v4.0.4)
      [I 141020 17:10:23 jsonrpc_websocket:121] Websocket client 01f57c95-bc09-484e-9cfc-4390767a9132 connected
      [I 141020 17:10:23 web:1728] 200 GET /version ( 0.87ms
      [I 141020 17:10:33 __init__:150] this server is local with working directory path to /tmp/gns3-y5yflz-files
      [I 141020 17:10:33 qemu_vm:222] QEMU VM arista1 [id=1]: working directory changed to /tmp/gns3-y5yflz-files/qemu/vm-1
      [I 141020 17:10:33 qemu_vm:385] QEMU VM arista1 [id=1]: number of Ethernet adapters changed to 1
      [I 141020 17:10:33 qemu_vm:127] QEMU VM arista1 [id=1] has been created
      [I 141020 17:10:33 qemu_vm:334] QEMU VM arista1 [id=1] has set the QEMU hda disk image path to /home/brezular/Downloads/GNS3-files/Arista/vEOS-4.14.2F.vmdk
      [I 141020 17:10:33 qemu_vm:385] QEMU VM arista1 [id=1]: number of Ethernet adapters changed to 8
      [I 141020 17:10:33 qemu_vm:454] QEMU VM arista1 [id=1] has set the QEMU options to -boot d -cdrom /home/brezular/Downloads/GNS3-files/Arista/Aboot-veos-serial-2.0.8.iso -enable-kvm -nographic
      [I 141020 17:10:33 qemu_vm:431] QEMU VM arista1 [id=1] has set the RAM to 1024
      Formatting '/tmp/gns3-y5yflz-files/qemu/vm-1/hda_disk.qcow2', fmt=qcow2 size=2147483648 backing_file='/home/brezular/Downloads/GNS3-files/Arista/vEOS-4.14.2F.vmdk' encryption=off cluster_size=65536 lazy_refcounts=off
      [I 141020 17:10:43 qemu_vm:710] /usr/local/bin/qemu-img returned with 0
      [I 141020 17:10:43 qemu_vm:538] starting QEMU: ['/usr/local/bin/qemu-system-x86_64', '-name', 'arista1', '-m', '1024', '-hda', '/tmp/gns3-y5yflz-files/qemu/vm-1/hda_disk.qcow2', '-serial', 'telnet:,server,nowait', '-boot', 'd', '-cdrom', '/home/brezular/Downloads/GNS3-files/Arista/Aboot-veos-serial-2.0.8.iso', '-enable-kvm', '-nographic', '-device', 'e1000,mac=00:00:ab:57:a2:00,netdev=gns3-0', '-netdev', 'user,id=gns3-0', '-device', 'e1000,mac=00:00:ab:ec:3f:01,netdev=gns3-1', '-netdev', 'user,id=gns3-1', '-device', 'e1000,mac=00:00:ab:ae:62:02,netdev=gns3-2', '-netdev', 'user,id=gns3-2', '-device', 'e1000,mac=00:00:ab:04:95:03,netdev=gns3-3', '-netdev', 'user,id=gns3-3', '-device', 'e1000,mac=00:00:ab:fd:9e:04,netdev=gns3-4', '-netdev', 'user,id=gns3-4', '-device', 'e1000,mac=00:00:ab:42:ce:05,netdev=gns3-5', '-netdev', 'user,id=gns3-5', '-device', 'e1000,mac=00:00:ab:d0:90:06,netdev=gns3-6', '-netdev', 'user,id=gns3-6', '-device', 'e1000,mac=00:00:ab:ed:2b:07,netdev=gns3-7', '-netdev', 'user,id=gns3-7']
      [I 141020 17:10:43 qemu_vm:540] logging to /tmp/gns3-y5yflz-files/qemu/vm-1/qemu.log
      [I 141020 17:10:43 qemu_vm:546] QEMU VM instance 1 started PID=23045

Leave a comment

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