From 3c9e8507d17b859fc1492f0122648fefe1a9158b Mon Sep 17 00:00:00 2001 From: grossmj Date: Thu, 9 Jun 2016 19:00:33 -0600 Subject: [PATCH] Handle vmnet interfaces in the cloud on OSX. Fixes #554. --- gns3server/compute/builtin/nodes/cloud.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/gns3server/compute/builtin/nodes/cloud.py b/gns3server/compute/builtin/nodes/cloud.py index afec658f..6728ab45 100644 --- a/gns3server/compute/builtin/nodes/cloud.py +++ b/gns3server/compute/builtin/nodes/cloud.py @@ -165,9 +165,15 @@ class Cloud(BaseNode): interface=port_info["interface"])) else: if sys.platform.startswith("darwin") and port_info["interface"].startswith("en"): + # Wireless adapters are not well supported by the libpcap on OSX raise NodeError("Connecting to a Wireless adapter is not supported.") - yield from self._ubridge_send('bridge add_nio_ethernet {name} "{interface}"'.format(name=bridge_name, - interface=port_info["interface"])) + if sys.platform.startswith("darwin") and port_info["interface"].startswith("vmnet"): + # Use a special NIO to connect to VMware vmnet interfaces on OSX (libpcap doesn't support them) + yield from self._ubridge_send('bridge add_nio_fusion_vmnet {name} "{interface}"'.format(name=bridge_name, + interface=port_info["interface"])) + else: + yield from self._ubridge_send('bridge add_nio_ethernet {name} "{interface}"'.format(name=bridge_name, + interface=port_info["interface"])) elif port_info["type"] == "tap": yield from self._ubridge_send('bridge add_nio_tap {name} "{interface}"'.format(name=bridge_name,