Start all vms in a group, problem on RDP
A web-based front-end to VirtualBox written in PHP
Brought to you by:
imoore76
Just begun to use the grouping function of the phpvirtualbox interface.
Starting all the group vms using the context menu on the group title results in all vms to be assigned with the same RDP listening port.
Each vm is configured for a port range of 9000-9100. Starting vms one-by-one it works, assigning a different port for each vm.
I'm using vbox 5.0.0 and phpVirtualBox 5.0-1.
Don't know if the same apply on older versions.
phpVirtualBox doesn't choose RDP ports. VIrtualBox itself does this. I imagine all of them are starting up at the same time and seeing the same port free. This would probably happen in the VirtualBox GUI as well.
Many thanks Ian for your explanation. I will check deeply and try to find a solution.
I confirm that the standard VirtualBox GUI is not affected by this problem.
The main reason I think is because phpVirtualBox starts all the group's machine at the same time.
The standard GUI starts them one-by-one.
Best Regards,
Davide
Ok, sorry for flooding this thread but I found a workaround that works.
In js/phpvirtualbox.js in the startVMs function I did the following change:
// Loop
window.setTimeout(function(){ runVMsToStart(vms); }, 500);
instead of:
// Loop
runVMsToStart(vms);
I know it's just a workaround. If the speed of the server or the web browser changes it's possible that still some vms gets the same RDP port.
Some sort of feedback from ajax is needed in order to fix it in the best way. It doesn't look to be too much complicated (I think can be done inside the .done section of _startVM).
Thanks for your work.
Davide
OK, thank you for chasing it down. I'll get something similar added to the next version.
Thanks to you Ian.
This should be resolved in 5.0-3