diff --git a/gns3server/compute/base_node.py b/gns3server/compute/base_node.py index c536a46e..ec1d8021 100644 --- a/gns3server/compute/base_node.py +++ b/gns3server/compute/base_node.py @@ -514,7 +514,7 @@ class BaseNode: try: yield from self._ubridge_hypervisor.send(command) except UbridgeError as e: - raise UbridgeError("{}: {}".format(e, self._ubridge_hypervisor.read_stdout())) + raise UbridgeError("Error while sending command '{}': {}: {}".format(command, e, self._ubridge_hypervisor.read_stdout())) @locked_coroutine def _start_ubridge(self): diff --git a/gns3server/compute/qemu/qemu_vm.py b/gns3server/compute/qemu/qemu_vm.py index 92a43020..7aeaf446 100644 --- a/gns3server/compute/qemu/qemu_vm.py +++ b/gns3server/compute/qemu/qemu_vm.py @@ -894,6 +894,7 @@ class QemuVM(BaseNode): af, socktype, proto, _, sa = res # let the OS find an unused port for the Qemu monitor with socket.socket(af, socktype, proto) as sock: + sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) sock.bind(sa) self._monitor = sock.getsockname()[1] except OSError as e: diff --git a/gns3server/controller/gns3vm/virtualbox_gns3_vm.py b/gns3server/controller/gns3vm/virtualbox_gns3_vm.py index cad08b71..f491e32f 100644 --- a/gns3server/controller/gns3vm/virtualbox_gns3_vm.py +++ b/gns3server/controller/gns3vm/virtualbox_gns3_vm.py @@ -191,6 +191,7 @@ class VirtualBoxGNS3VM(BaseGNS3VM): try: # get a random port on localhost with socket.socket() as s: + s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) s.bind((ip_address, 0)) api_port = s.getsockname()[1] except OSError as e: diff --git a/gns3server/ubridge/hypervisor.py b/gns3server/ubridge/hypervisor.py index 660c930a..ed618b06 100644 --- a/gns3server/ubridge/hypervisor.py +++ b/gns3server/ubridge/hypervisor.py @@ -62,6 +62,7 @@ class Hypervisor(UBridgeHypervisor): af, socktype, proto, _, sa = res # let the OS find an unused port for the uBridge hypervisor with socket.socket(af, socktype, proto) as sock: + sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) sock.bind(sa) port = sock.getsockname()[1] break