Bug 572546

Summary: unable to create more than 100 vm's with vnc autoport setting
Product: [Fedora] Fedora Reporter: Ruben Kerkhof <ruben>
Component: libvirtAssignee: Chris Lalancette <clalance>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: rawhideCC: berrange, clalance, crobinso, itamar, jforbes, veillard, virt-maint
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2010-07-08 13:02:21 EDT Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Description Ruben Kerkhof 2010-03-11 09:10:46 EST
Description of problem:

We are trying to run more than 100 vm's on one physical host.
While testing this, when creating vm number 100, libvirt returns:

qemudStartVMDaemon:2085 : internal error Unable to find an unused VNC port

Version-Release number of selected component (if applicable):


How reproducible:

Create more than 100 vm's with the setting <graphics type='vnc' autoport = 'yes' />

Actual results:
after starting vm 100:
qemudStartVMDaemon:2085 : internal error Unable to find an unused VNC port

Expected results:
vm should start with an assigned vnc port.

Additional info:
The port range is hardcoded in qemudNextFreeVNCPort:

for (i = 5900 ; i < 6000 ; i++)

It would be nice if this could be extended. As an alternative a setting in /etc/libvirt/libvirt.conf is fine too.
Comment 1 Chris Lalancette 2010-03-11 15:18:30 EST
Yeah, that is a bit unfortunate.  I guess we could go nuts and do 5900 all the way through 65535, but maybe we don't want to open ourselves up to that kind of (possible) abuse.  I think for the time being I'll create a patch that uses 5900 to 6000 by default, but you can override the upper-end with a setting in /etc/libvirt/qemu.conf.  Would that satisfy your request?

Chris Lalancette
Comment 2 Chris Lalancette 2010-03-11 18:05:24 EST
I posted a patch upstream that makes this configurable:


If you get a chance, could you try this patch out and see if it works for you?

Chris Lalancette
Comment 3 Ruben Kerkhof 2010-03-12 14:16:30 EST
I've tried the patch, it works great.

Daniels idea to change the upper limit to 2^16 is probably easier though.

Thanks for your help,

Comment 4 Chris Lalancette 2010-04-06 13:21:49 EDT
I posted a patch just to up the number of VNC ports, and committed it to upstream libvirt now.  I'm going to switch this bug to "rawhide", and change the status to POST.

Chris Lalancette
Comment 5 Chris Lalancette 2010-07-08 13:02:21 EDT
This is now in rawhide with the update to 0.8.2.  I'm going to close this out.

Chris Lalancette