Sample Header Ad - 728x90

How to let Qemu autoselect a listening port for Spice?

1 vote
2 answers
2718 views
I'm switching some VMs from VNC display type to SPICE. VNC display type offers a very handy to= parameter allowing QEMU to automatically use the first free port from a defined range: -display vnc=127.0.0.1:0,to=100 Here QEMU will use ports between 5900 and 6000 for each new VNC display server. What is the cleanest way to achieve such functionality with SPICE display (by the way I'm not using libvirt)? Currently I'm on my way to script a test greping netstat output to find a yet unused port and pass it to: -spice addr=127.0.0.1,port=${unused_port} Without mentioning race conditions, I just find this method quite ugly compared to the VNC one. And since QEMU manpage does not seem very exhaustive (VNC to= parameter doesn't seem mentioned for instance), then I wonder if by any chance there is an equivalent parameter for SPICE?
Asked by WhiteWinterWolf (2961 rep)
Jul 8, 2015, 08:48 AM
Last activity: Mar 12, 2024, 11:22 PM