VirtioFS: sed -i from GNU sed 4.4 fails with "Permission denied" on bind mounts (gRPC FUSE works)
还没有人认领这个 Issue。
评估
- 难度
- 5/5
- 预计耗时
- 一周以上
- 新手友好度
- 12/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
- 技术栈
- docker, macos
调研方向
This is a tracker issue on docker/desktop-feedback, so no source file or test is pointed at the fix; the only reproducer is the docker run -v "$PWD":/w ubuntu:18.04 sh -c 'echo a > /w/f; sed -i s/a/b/ /w/f' command. Start by reproducing on a macOS host with VirtioFS sharing and comparing against gRPC FUSE, then narrow what sed 4.4 does beyond the C and Python mkostemp() cases that succeed. Done means that command exits 0 and f contains b under VirtioFS, which likely needs a change in Docker Desktop's file-sharing layer rather than in this repo.
由索引模型根据 Issue 内容生成。
描述
Bug report
On macOS with VirtioFS file sharing, in-place editing with GNU sed 4.4 (the version in Ubuntu 18.04) fails on any bind-mounted directory:
sed: couldn't open temporary file /w/sedx4aGxI: Permission denied
The same command works in the container's own filesystem, with newer sed versions on the same bind mount, and with gRPC FUSE file sharing.
This looks like the issue reported in docker/for-mac#6990 (open since Docker Desktop 4.23), which has no minimal reproducer. The one below needs only a public image.
Reproduce
Run in any directory on the Mac:
docker run --rm -v "$PWD":/w ubuntu:18.04 sh -c 'echo a > /w/f; sed -i s/a/b/ /w/f && echo ok'
- Expected:
ok, andfcontainsb. - Actual:
sed: couldn't open temporary file /w/sedXXXXXX: Permission denied, exit status 4.
Results
| Image | sed | Bind mount (VirtioFS) | Container /tmp |
|---|---|---|---|
ubuntu:18.04, linux/arm64 |
4.4 | fails | ok |
ubuntu:18.04, linux/amd64 (Rosetta) |
4.4 | fails | ok |
ubuntu:22.04, linux/amd64 |
4.8 | ok | ok |
| Debian 12 based image, linux/amd64 | 4.9 | ok | ok |
On a second Mac (macOS 26), the same failure occurs with VirtioFS, and the command works after switching file sharing to gRPC FUSE.
What we found
- An
LD_PRELOADshim inside sed shows glibc'smkostemp()returningEACCESfor the temporary file sed creates next to the edited file. - The same
mkostemp()call (same template,umask(077), input file held open) succeeds on the same bind mount from a small C program and from Python, linked against the same glibc 2.27. We did not find what sed 4.4 does differently. - Ruled out: SELinux (
is_selinux_enabled()returns 0), file and directory ownership, and amd64 emulation (native arm64 fails too). - The bind mount does not support extended attributes (
listxattrreturns "Operation not supported").
Impact
Any build that uses Ubuntu 18.04 images (common for embedded SDKs pinned to old toolchains) and runs sed -i on bind-mounted sources fails on macOS with the default file sharing. The only workaround we have is switching to gRPC FUSE, which is slower and applies to every project.
Environment
- Docker Desktop 4.99.0 (245822), engine 29.9.3, kernel 7.0.14-linuxkit
- macOS 27.2 (26B123), Apple silicon (arm64)
- Virtualization framework: Apple Virtualization; file sharing: VirtioFS (default)
- Also reproduced on a second Mac with macOS 26 (Docker Desktop version not recorded)
Platform
macOS
Version information
Client:
Version: 29.9.3
API version: 1.56
Go version: go1.26.10
Git commit: 5457199
Built: Tue Nov 3 21:41:57 2026
OS/Arch: darwin/arm64
Context: desktop-linux
Server: Docker Desktop 4.99.0 (245822)
Engine:
Version: 29.9.3
API version: 1.56 (minimum version 1.40)
Go version: go1.26.10
Git commit: 70efc0e
Built: Tue Nov 3 21:41:25 2026
OS/Arch: linux/arm64
Experimental: false
containerd:
Version: v2.4.2
GitCommit: b7a25261e029d68978bbf290df0a62fc819b3c51
runc:
Version: 1.5.2
GitCommit: v1.5.2-0-g29dd3dc2
docker-init:
Version: 0.19.0
GitCommit: de40ad0
Client:
Version: 29.9.3
Context: desktop-linux
Debug Mode: false
Plugins:
agent: Docker AI Agent Runner (Docker Inc.)
Version: v1.153.0
Path: /Users/alessandro/.docker/cli-plugins/docker-agent
ai: Docker AI Agent - Ask Gordon (Docker Inc.)
Version: v1.33.0
Path: /Users/alessandro/.docker/cli-plugins/docker-ai
buildx: Docker Buildx (Docker Inc.)
Version: v0.38.1
Path: /Users/alessandro/.docker/cli-plugins/docker-buildx
compose: Docker Compose (Docker Inc.)
Version: v5.7.0
Path: /Users/alessandro/.docker/cli-plugins/docker-compose
debug: Get a shell into any image or container (Docker Inc.)
Version: 0.49.0
Path: /Users/alessandro/.docker/cli-plugins/docker-debug
desktop: Docker Desktop commands (Docker Inc.)
Version: 4.99.0
Path: /Users/alessandro/.docker/cli-plugins/docker-desktop
dhi: CLI for managing Docker Hardened Images (Docker Inc.)
Version: v0.0.10
Path: /Users/alessandro/.docker/cli-plugins/docker-dhi
extension: Manages Docker extensions (Docker Inc.)
Version: v0.2.32
Path: /Users/alessandro/.docker/cli-plugins/docker-extension
init: Creates Docker-related starter files for your project (Docker Inc.)
Version: v1.4.1
Path: /Users/alessandro/.docker/cli-plugins/docker-init
mcp: Docker MCP Plugin (Docker Inc.)
Version: v0.44.3
Path: /Users/alessandro/.docker/cli-plugins/docker-mcp
model: Docker Model Runner (Docker Inc.)
Version: v1.2.9
Path: /Users/alessandro/.docker/cli-plugins/docker-model
offload: Docker Offload (Docker Inc.)
Version: v0.7.36
Path: /Users/alessandro/.docker/cli-plugins/docker-offload
pass: Docker Pass Secrets Manager Plugin (beta) (Docker Inc.)
Version: v0.3.2
Path: /Users/alessandro/.docker/cli-plugins/docker-pass
sandbox: "docker sandbox" is deprecated, use Docker Sandboxes instead (Docker Inc.)
Version: v0.13.0
Path: /Users/alessandro/.docker/cli-plugins/docker-sandbox
scout: Docker Scout (Docker Inc.)
Version: v1.28.0
Path: /Users/alessandro/.docker/cli-plugins/docker-scout
Server:
Containers: 1
Running: 0
Paused: 0
Stopped: 1
Images: 13
Server Version: 29.9.3
Storage Driver: overlayfs
driver-type: io.containerd.snapshotter.v1
Logging Driver: local
Cgroup Driver: cgroupfs
Cgroup Version: 2
Plugins:
Volume: local
Network: bridge host ipvlan macvlan null overlay
Log: awslogs fluentd gcplogs gelf journald json-file local splunk syslog
CDI spec directories:
/etc/cdi
/var/run/cdi
Discovered Devices:
cdi: docker.com/gpu=webgpu
Swarm: inactive
Runtimes: io.containerd.runc.v2 runc
Default Runtime: runc
Init Binary: docker-init
containerd version: b7a25261e029d68978bbf290df0a62fc819b3c51
runc version: v1.5.2-0-g29dd3dc2
init version: de40ad0
Security Options:
seccomp
Profile: builtin
cgroupns
Kernel Version: 7.0.14-linuxkit
Operating System: Docker Desktop
OSType: linux
Architecture: aarch64
CPUs: 12
Total Memory: 7.748GiB
Name: docker-desktop
ID: 110bed11-9336-422f-879a-d82a2a6ce1ab
Docker Root Dir: /var/lib/docker
Debug Mode: false
HTTP Proxy: http.docker.internal:3128
HTTPS Proxy: http.docker.internal:3128
No Proxy: hubproxy.docker.internal
Labels:
com.docker.desktop.address=unix:///Users/alessandro/Library/Containers/com.docker.docker/Data/docker-cli.sock
Experimental: false
Insecure Registries:
hubproxy.docker.internal:5555
127.0.0.0/8
::1/128
Live Restore Enabled: false
Firewall Backend: iptables
Diagnostics ID
No response
- 主要语言
- 没有语言数据
- 星标
- 53
- 派生
- 24
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
docker/desktop-feedback 的其他 Issue
-
Codex sandbox template seeds MCP gateway config with keys Codex does not recognize (type, headers)未关闭platform/macos
难度 1/5 1-3 小时 新手友好度 82/100
docker/desktop-feedback#721 ·
-
kind/enhancement
难度 2/5 1-3 小时 新手友好度 68/100
docker/desktop-feedback#259 ·
-
kind/bug platform/windows
难度 4/5 3-5 天 新手友好度 45/100
docker/desktop-feedback#862 ·
-
kind/bug platform/windows
难度 5/5 一周以上 新手友好度 45/100
docker/desktop-feedback#861 ·
-
kind/bug platform/macos
难度 4/5 3-5 天 新手友好度 48/100
docker/desktop-feedback#860 ·
查看 docker/desktop-feedback 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 70/100
milind-soni/OpenMausBot#6495 ·
维护者通常 1 天内回复
-
bug triage
难度 2/5 1-3 小时 新手友好度 75/100
维护者通常 1 天内回复
-
enhancement
难度 2/5 1-3 小时 新手友好度 63/100
telegramdesktop/tdesktop#31653 ·
维护者通常 1 天内回复
-
enhancement ui/ux
难度 2/5 1-3 小时 新手友好度 68/100
jbigler/railswitch#243 ·
维护者通常 1 天内回复
-
技能库不能筛选仅可更新的未关闭bug
难度 2/5 1-3 小时 新手友好度 63/100
xingkongliang/skills-manager#678 ·
维护者通常 1 天内回复