From 527d4bb3eadbda0185fa617c8ff3f32ac5f5932b Mon Sep 17 00:00:00 2001 From: grossmj Date: Wed, 8 Jun 2022 00:05:24 +0800 Subject: [PATCH] Run Xtigervnc with MIT-SHM extension disabled for Docker VNC console support. Fixes #2071 --- gns3server/compute/docker/docker_vm.py | 7 +++++-- tests/compute/docker/test_docker_vm.py | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/gns3server/compute/docker/docker_vm.py b/gns3server/compute/docker/docker_vm.py index 464d7e85..e27ef526 100644 --- a/gns3server/compute/docker/docker_vm.py +++ b/gns3server/compute/docker/docker_vm.py @@ -584,6 +584,7 @@ class DockerVM(BaseNode): if tigervnc_path: with open(os.path.join(self.working_dir, "vnc.log"), "w") as fd: self._vnc_process = await asyncio.create_subprocess_exec(tigervnc_path, + "-extension", "MIT-SHM", "-geometry", self._console_resolution, "-depth", "16", "-interface", self._manager.port_manager.console_host, @@ -595,8 +596,9 @@ class DockerVM(BaseNode): else: if restart is False: self._xvfb_process = await asyncio.create_subprocess_exec("Xvfb", - "-nolisten", - "tcp", ":{}".format(self._display), + "-nolisten", "tcp", + "-extension", "MIT-SHM", + ":{}".format(self._display), "-screen", "0", self._console_resolution + "x16") @@ -606,6 +608,7 @@ class DockerVM(BaseNode): "-forever", "-nopw", "-shared", + "-noshm", "-geometry", self._console_resolution, "-display", "WAIT:{}".format(self._display), "-rfbport", str(self.console), diff --git a/tests/compute/docker/test_docker_vm.py b/tests/compute/docker/test_docker_vm.py index 37b7794a..fcc84a7f 100644 --- a/tests/compute/docker/test_docker_vm.py +++ b/tests/compute/docker/test_docker_vm.py @@ -1343,7 +1343,7 @@ async def test_start_vnc(vm): with asyncio_patch("asyncio.create_subprocess_exec") as mock_exec: await vm._start_vnc() assert vm._display is not None - assert mock_exec.call_args[0] == ("/bin/Xtigervnc", "-geometry", vm.console_resolution, "-depth", "16", "-interface", "127.0.0.1", "-rfbport", str(vm.console), "-AlwaysShared", "-SecurityTypes", "None", ":{}".format(vm._display)) + assert mock_exec.call_args[0] == ("/bin/Xtigervnc", "-extension", "MIT-SHM", "-geometry", vm.console_resolution, "-depth", "16", "-interface", "127.0.0.1", "-rfbport", str(vm.console), "-AlwaysShared", "-SecurityTypes", "None", ":{}".format(vm._display)) mock_wait.assert_called_with("/tmp/.X11-unix/X{}".format(vm._display))