Beginning with kvm-80, there’s a new vnc port auto allocation feature using new socket helper functions. The new vnc code adds support for ipv6 and for automatically allocating an unused vnc display port. All these features were included with the last qemu merge. I will demonstrate usage of this new feature.

Using the new vnc auto allocation is handled by a new option specified by "to=" which specifies an upper limit for the display number to try. When this option is used, scanning for the display number starts at the display number given in the display specification and ends at the display number specified by to=. As an example, let’s say that you would like to specify vnc display ports ranging from 1 to 4 inclusively then you would start your kvm guest with the following command :
qemu-system-x86_64 –hda windows.img -vnc localhost:1,to=4 -daemonize -usbdevice tablet
This will search for available vnc display ports beginning at 1 , ending at 4 and will use the first available display. The qemu documentation states that in order to see the actual display allocated you can issue the “info vnc” command from the monitor. However, the following output is displayed which doesn’t tell you this information.

I suspect that this minor bug of not showing the actual allocated display will be fixed in the next release.
Comments
Post new comment