Skip to content

cat9kv : Unable to connect to qemu monitor (port 4000) #351

@htam-net

Description

@htam-net

Hello

Today, with upgrading to v0.68.0 (from 0.67.0), I can't launch more than one Catalyst 9kv VM/container in containerlab.
And also, minor update of the underlying Debian 12

When more than one, is launched, I get Unable to connect to qemu monitor (port 4000), retrying in a second. Until 60 retries hit and then stops the container/VM.

Here is the cmd executed (for one of them) ... and all are using the 4000 (and 5000) tcp ports for monitor and serial :
vrnetlab DEBUG qemu cmd: qemu-system-x86_64 -enable-kvm -display none -machine pc -monitor tcp:0.0.0.0:4000,server,nowait -serial telnet:0.0.0.0:5000,server,nowait -m 18432 -cpu host -smp cores=4,threads=1,sockets=1 -drive if=ide,file=/cat9kv-universalk9_16G_vga.17.15.01-overlay.qcow2 -overcommit mem-lock=off -boot order=cd -cdrom /config.img -device pci-bridge,chassis_nr=1,id=pci.1 -device virtio-net-pci,netdev=p00,mac=0C:00:c4:49:45:00 -netdev tap,id=p00,ifname=tap0,script=/etc/tc-tap-mgmt-ifup,downscript=no -device virtio-net-pci,netdev=p01,bus=pci.1,addr=0x2 -netdev socket,id=p01,listen=:10001 -device virtio-net-pci,netdev=p02,mac=0C:00:33:d2:56:02,bus=pci.1,addr=0x3 -netdev tap,id=p02,ifname=tap2,script=/etc/tc-tap-ifup,downscript=no -device virtio-net-pci,netdev=dummy1,id=dummy1,mac=0C:00:81:10:5e:00,bus=pci.1,addr=0x3 -netdev tap,ifname=dummy1,id=dummy1,script=no,downscript=no -device virtio-net-pci,netdev=dummy2,id=dummy2,mac=0C:00:15:bd:24:01,bus=pci.1,addr=0x4 -netdev tap,ifname=dummy2,id=dummy2,script=no,downscript=no -device virtio-net-pci,netdev=dummy3,id=dummy3,mac=0C:00:7b:a2:5a:02,bus=pci.1,addr=0x5 -netdev tap,ifname=dummy3,id=dummy3,script=no,downscript=no -device virtio-net-pci,netdev=dummy4,id=dummy4,mac=0C:00:d1:07:23:03,bus=pci.1,addr=0x6 -netdev tap,ifname=dummy4,id=dummy4,script=no,downscript=no -device virtio-net-pci,netdev=dummy5,id=dummy5,mac=0C:00:d0:f7:6e:04,bus=pci.1,addr=0x7 -netdev tap,ifname=dummy5,id=dummy5,script=no,downscript=no -device virtio-net-pci,netdev=dummy6,id=dummy6,mac=0C:00:7f:18:5c:05,bus=pci.1,addr=0x8 -netdev tap,ifname=dummy6,id=dummy6,script=no,downscript=no -device virtio-net-pci,netdev=dummy7,id=dummy7,mac=0C:00:86:7f:54:06,bus=pci.1,addr=0x9 -netdev tap,ifname=dummy7,id=dummy7,script=no,downscript=no

and the docker logs :

2025-06-03 07:35:54,357: base_driver    INFO opening connection to '127.0.0.1' on port '4000'
2025-06-03 07:35:54,358: base_socket    WARNING connection refused trying to open socket to 127.0.0.1 on port 4000 for address family AF_INET
2025-06-03 07:35:54,358: vrnetlab       ERROR Unable to connect to qemu monitor (port 4000), retrying in a second (attempt 1)
2025-06-03 07:35:55,358: base_driver    INFO opening connection to '127.0.0.1' on port '4000'
2025-06-03 07:35:55,359: base_socket    WARNING connection refused trying to open socket to 127.0.0.1 on port 4000 for address family AF_INET
2025-06-03 07:35:55,359: vrnetlab       ERROR Unable to connect to qemu monitor (port 4000), retrying in a second (attempt 2)
[..]
2025-06-03 07:36:53,385: base_driver    INFO opening connection to '127.0.0.1' on port '4000'
2025-06-03 07:36:53,386: base_socket    WARNING connection refused trying to open socket to 127.0.0.1 on port 4000 for address family AF_INET
2025-06-03 07:36:53,386: vrnetlab       ERROR Unable to connect to qemu monitor (port 4000), retrying in a second (attempt 60)
Traceback (most recent call last):
  File "/launch.py", line 228, in <module>
    vr.start()
  File "/vrnetlab.py", line 1039, in start
    vm.work()
  File "/vrnetlab.py", line 913, in work
    self.check_qemu()
  File "/vrnetlab.py", line 927, in check_qemu
    self.start()
  File "/vrnetlab.py", line 393, in start
    raise QemuBroken(
vrnetlab.QemuBroken: Unable to connect to qemu monitor on port 4000

I have tried to add port 4000 on the EXPOSE of the DOCKERFILE for cat9kv and rebuilt the image, with the same result.

If I compare with c8000v, the "unable to connect" stopped after a dozen of retries.

Can you provide guidance to overcome this situation, please ?

NB : I have looked at the code f"tcp:0.0.0.0:40{self.num:02d},server,nowait" but it seems that self.num is always 0 in the case of cat9kv (and also c8000v).

Sincerely yours, Mathieu.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions