Skip to content

Commit

Permalink
Merge pull request #2277 from GNS3/fix/2276
Browse files Browse the repository at this point in the history
Prevent X11 socket file to be modified by Docker container
  • Loading branch information
grossmj authored Aug 27, 2023
2 parents 6a614fb + c2783d3 commit d3d0cc0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion gns3server/compute/docker/docker_vm.py
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,7 @@ async def create(self):
await self._start_vnc()
params["Env"].append("QT_GRAPHICSSYSTEM=native") # To fix a Qt issue: https://github.com/GNS3/gns3-server/issues/556
params["Env"].append("DISPLAY=:{}".format(self._display))
params["HostConfig"]["Binds"].append("/tmp/.X11-unix/:/tmp/.X11-unix/")
params["HostConfig"]["Binds"].append("/tmp/.X11-unix/X{0}:/tmp/.X11-unix/X{0}:ro".format(self._display))

if self._extra_hosts:
extra_hosts = self._format_extra_hosts(self._extra_hosts)
Expand Down
2 changes: 1 addition & 1 deletion tests/compute/docker/test_docker_vm.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ async def test_create_vnc(compute_project, manager):
"Binds": [
"{}:/gns3:ro".format(get_resource("compute/docker/resources")),
"{}:/gns3volumes/etc/network".format(os.path.join(vm.working_dir, "etc", "network")),
'/tmp/.X11-unix/:/tmp/.X11-unix/'
"/tmp/.X11-unix/X{0}:/tmp/.X11-unix/X{0}:ro".format(vm._display)
],
"Privileged": True
},
Expand Down

0 comments on commit d3d0cc0

Please sign in to comment.