Persistent VNC Port Conflict Issue During VM Migration in Proxmox Cluster

Dear Proxmox Team,

I am writing to report a persistent issue we are experiencing with VNC port conflicts during VM migration within our Proxmox cluster environment. This problem significantly impacts our operations, and we believe it warrants a permanent solution.


**Issue Description:**
While attempting to migrate VM (ID: 103362) from one node to another within our Proxmox cluster, we consistently encounter the following error message:


Code:
()
2024-06-21 14:40:46 starting migration of VM 103362 to node 'prx01' (10.55.1.20)
2024-06-21 14:40:46 found local disk 'local-lvm:vm-103362-dmczidgxd4pwKwOo-qcjjPvlazF3SFoul' (attached)
2024-06-21 14:40:46 starting VM 103362 on remote node 'prx01'
2024-06-21 14:40:50 [prx01] kvm: -vnc 0.0.0.0:4,password=on: Failed to find an available port: Address already in use
2024-06-21 14:40:50 [prx01] start failed: QEMU exited with code 1
2024-06-21 14:40:50 ERROR: online migrate failure - remote command failed with exit code 255
2024-06-21 14:40:50 aborting phase 2 - cleanup resources
2024-06-21 14:40:50 migrate_cancel
2024-06-21 14:40:52 ERROR: migration finished with problems (duration 00:00:07)
TASK ERROR: migration problems


**Current Workaround:**

To temporarily resolve this issue, we manually check and configure VNC ports to avoid conflicts before initiating the migration process. While this workaround helps in specific instances, it is not a sustainable or scalable solution, especially in environments with frequent VM migrations.


**Request for Permanent Solution:**

Given the critical nature of this issue, we strongly urge the Proxmox development team to implement a permanent fix. Specifically, we recommend the following:

1. **Automatic VNC Port Management:** Enhance Proxmox to automatically detect and assign available VNC ports during VM migration, preventing conflicts.


**Conclusion:**

This issue disrupts our operations and undermines the efficiency of our virtualized environment. We believe that implementing these improvements will greatly enhance the reliability and user experience of Proxmox.

We appreciate your attention to this matter and look forward to a timely resolution.

Thank you for your support.

Best regards,
 
Also ran into this, PVE version 8.3.4
I created a new vm from cli(see code snippet), and it turns out that it got the same vnc port as the last vm I created before..
Is the availability of vnc ports out of sync? Can I somehow have ports auto allocated or at least be sure the next vm is ok?

Code:
qm create 729 --memory 1024 --name New-VM --sockets 2 --cpu cputype=host --cores 1 --net0 "virtio,bridge=vmbr40,firewall=1" --scsihw virtio-scsi-pci --agent enabled=1

I found this suggestion, to update the vnc args in config to:
args: -vnc unix:/var/run/qemu-server/<VMID>.vnc,password

Can somebody confirm that this will work and not brake everything?
 
Last edited:
@bytegenius You can file a feature request here: https://bugzilla.proxmox.com/
Once you do that, please post the link back here so people can follow it.

I found this suggestion, to update the vnc args in config to:
args: -vnc unix:/var/run/qemu-server/<VMID>.vnc,password

@lost_avocado where did you see this? Can you post a link to it?

How do you get the port number?

is there any way to fix it automatically?

There is no automatic fix. You need to ensure that each VM has a unique port number, as conflicts will occur otherwise.
 
There is no automatic fix. You need to ensure that each VM has a unique port number, as conflicts will occur otherwise.
Why wasn't this already posted in 2024? As far as I can see, this is a user configuration error, not a problem in PVE. Best to use something based on the VMID, this is unique in a cluster.
 
Best to use something based on the VMID, this is unique in a cluster.

Do you mean mapping VMID to the VNC port number somehow?

Or is there another method?
 
Why wasn't this already posted in 2024? As far as I can see, this is a user configuration error, not a problem in PVE. Best to use something based on the VMID, this is unique in a cluster.
this is VNC port problem in cluster with many nodes when migrate, do you understand ?