diff --git a/gns3server/crash_report.py b/gns3server/crash_report.py index c22b0126..e38d3a9d 100644 --- a/gns3server/crash_report.py +++ b/gns3server/crash_report.py @@ -24,7 +24,7 @@ try: import raven RAVEN_AVAILABLE = True except ImportError: - # raven is not installed with deb package in order to simplify packagin + # raven is not installed with deb package in order to simplify packaging RAVEN_AVAILABLE = False from .version import __version__ diff --git a/gns3server/modules/iou/iou_vm.py b/gns3server/modules/iou/iou_vm.py index e1faa345..ee8cc1ed 100644 --- a/gns3server/modules/iou/iou_vm.py +++ b/gns3server/modules/iou/iou_vm.py @@ -959,7 +959,7 @@ class IOUVM(BaseVM): initial_config = initial_config.replace("%h", self._name) f.write(initial_config) except OSError as e: - raise IOUError("Can't write initial configuration file '{}'".format(script_file)) + raise IOUError("Can't write initial configuration file '{}': {}".format(script_file, e)) @property def initial_config_file(self): diff --git a/gns3server/modules/virtualbox/virtualbox_vm.py b/gns3server/modules/virtualbox/virtualbox_vm.py index b4b2678c..f369287b 100644 --- a/gns3server/modules/virtualbox/virtualbox_vm.py +++ b/gns3server/modules/virtualbox/virtualbox_vm.py @@ -647,7 +647,11 @@ class VirtualBoxVM(BaseVM): attachment = nic_attachments[adapter_number] if attachment == "null": # disconnect the cable if no backend is attached. - self._modify_vm("--cableconnected{} off".format(adapter_number + 1)) + yield from self._modify_vm("--cableconnected{} off".format(adapter_number + 1)) + if attachment == "none": + # set the backend to null to avoid a difference in the number of interfaces in the Guest. + yield from self._modify_vm("--nic{} null".format(adapter_number + 1)) + yield from self._modify_vm("--cableconnected{} off".format(adapter_number + 1)) nio = self._ethernet_adapters[adapter_number].get_nio(0) if nio: if not self._use_any_adapter and attachment not in ("none", "null", "generic"): @@ -683,10 +687,6 @@ class VirtualBoxVM(BaseVM): if nio.capturing: yield from self._modify_vm("--nictrace{} on".format(adapter_number + 1)) yield from self._modify_vm('--nictracefile{} "{}"'.format(adapter_number + 1, nio.pcap_output_file)) - else: - yield from self._modify_vm("--nic{} null".format(adapter_number + 1)) - yield from self._modify_vm("--cableconnected{} off".format(adapter_number + 1)) - for adapter_number in range(self._adapters, self._maximum_adapters): log.debug("disabling remaining adapter {}".format(adapter_number))