From 817a053dfc126dac138e7af6dee1420c52e2e2de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Du=C5=A1an=20Dragi=C4=87?= Date: Thu, 29 Nov 2018 00:29:28 +0100 Subject: [PATCH 1/3] docker_vm: fix x11vnc not starting --- gns3server/compute/docker/docker_vm.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gns3server/compute/docker/docker_vm.py b/gns3server/compute/docker/docker_vm.py index a8625895..1facaff7 100644 --- a/gns3server/compute/docker/docker_vm.py +++ b/gns3server/compute/docker/docker_vm.py @@ -548,7 +548,7 @@ class DockerVM(BaseNode): with open(os.path.join(self.working_dir, "vnc.log"), "w") as fd: self._vnc_process = yield from asyncio.create_subprocess_exec("x11vnc", "-forever", - "-nopw" + "-nopw", "-shared", "-geometry", self._console_resolution, "-display", "WAIT:{}".format(self._display), From fc75a6b8d3c722e4794286291597b6fba8aa0455 Mon Sep 17 00:00:00 2001 From: grossmj Date: Fri, 14 Dec 2018 19:53:43 -0600 Subject: [PATCH 2/3] Fix link pause/filters only work for the first interface of Docker containers. Fixes #1482 --- gns3server/handlers/api/compute/docker_handler.py | 5 +++-- gns3server/handlers/api/compute/iou_handler.py | 7 ++----- gns3server/handlers/api/compute/vmware_handler.py | 9 +++++---- 3 files changed, 10 insertions(+), 11 deletions(-) diff --git a/gns3server/handlers/api/compute/docker_handler.py b/gns3server/handlers/api/compute/docker_handler.py index e3a9ee80..9596e0ae 100644 --- a/gns3server/handlers/api/compute/docker_handler.py +++ b/gns3server/handlers/api/compute/docker_handler.py @@ -263,10 +263,11 @@ class DockerHandler: docker_manager = Docker.instance() container = docker_manager.get_node(request.match_info["node_id"], project_id=request.match_info["project_id"]) - nio = container.ethernet_adapters[int(request.match_info["adapter_number"])].get_nio(0) + adapter_number = int(request.match_info["adapter_number"]) + nio = container.ethernet_adapters[adapter_number].get_nio(0) if "filters" in request.json and nio: nio.filters = request.json["filters"] - yield from container.adapter_update_nio_binding(int(request.match_info["port_number"]), nio) + yield from container.adapter_update_nio_binding(adapter_number, nio) response.set_status(201) response.json(request.json) diff --git a/gns3server/handlers/api/compute/iou_handler.py b/gns3server/handlers/api/compute/iou_handler.py index ae661c36..3b3001f8 100644 --- a/gns3server/handlers/api/compute/iou_handler.py +++ b/gns3server/handlers/api/compute/iou_handler.py @@ -301,12 +301,9 @@ class IOUHandler: nio = vm.adapters[adapter_number].get_nio(port_number) if "filters" in request.json and nio: nio.filters = request.json["filters"] - yield from vm.adapter_update_nio_binding( - adapter_number, - port_number, - nio) + yield from vm.adapter_update_nio_binding(adapter_number, port_number, nio) response.set_status(201) - response.json(nio) + response.json(request.json) @Route.delete( r"/projects/{project_id}/iou/nodes/{node_id}/adapters/{adapter_number:\d+}/ports/{port_number:\d+}/nio", diff --git a/gns3server/handlers/api/compute/vmware_handler.py b/gns3server/handlers/api/compute/vmware_handler.py index 06d8a545..e3cad952 100644 --- a/gns3server/handlers/api/compute/vmware_handler.py +++ b/gns3server/handlers/api/compute/vmware_handler.py @@ -279,12 +279,13 @@ class VMwareHandler: vmware_manager = VMware.instance() vm = vmware_manager.get_node(request.match_info["node_id"], project_id=request.match_info["project_id"]) - nio = vm.ethernet_adapters[int(request.match_info["adapter_number"])] + adapter_number = int(request.match_info["adapter_number"]) + nio = vm.ethernet_adapters[adapter_number] if "filters" in request.json and nio: nio.filters = request.json["filters"] - yield from vm.adapter_update_nio_binding(int(request.match_info["adapter_number"]), nio) - response.set_status(201) - response.json(request.json) + yield from vm.adapter_update_nio_binding(adapter_number, nio) + response.set_status(201) + response.json(request.json) @Route.delete( r"/projects/{project_id}/vmware/nodes/{node_id}/adapters/{adapter_number:\d+}/ports/{port_number:\d+}/nio", From ef38ccfefaff0303257caf43f221f67ee9845bba Mon Sep 17 00:00:00 2001 From: grossmj Date: Mon, 17 Dec 2018 22:42:18 -0600 Subject: [PATCH 3/3] Automatically create a symbolic link to the IOU image in the IOU working directory. Fixes #1484 --- gns3server/compute/iou/iou_vm.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/gns3server/compute/iou/iou_vm.py b/gns3server/compute/iou/iou_vm.py index 3d5de28b..6b0e7c30 100644 --- a/gns3server/compute/iou/iou_vm.py +++ b/gns3server/compute/iou/iou_vm.py @@ -517,6 +517,16 @@ class IOUVM(BaseNode): if "IOURC" not in os.environ: env["IOURC"] = iourc_path + + # create a symbolic link to the image to avoid IOU error "failed code signing checks" + # on newer images, see https://github.com/GNS3/gns3-server/issues/1484 + try: + symlink = os.path.join(self.working_dir, os.path.basename(self.path)) + if not os.path.islink(symlink): + os.symlink(self.path, symlink) + except OSError as e: + raise IOUError("Could not create symbolic link: {}".format(e)) + command = yield from self._build_command() try: log.info("Starting IOU: {}".format(command))