Skip to content

Fixes #1074 Generate random IP addresses for port forwarding

This merge request lowers the chance of a race condition with finding free port numbers for the virtualbox port fowarding. It uses the fact that binding to port 0 forces the kernel to allocate a random high port number, and the kernel prefers ones that have not been recently used.

This random port is not bound by any other process at the time, or we wouldn't have received it. Do check it against the used ports as listed by vboxmanage list vms -l in case some virtual machines are not currently running.

Merge request reports