lima-vm / lima-vm/lima

Unreliable permissions for lima with vz and writable virtiofs home directory mount

Open
#2,437 1 comment 5 reactions 0 assignees View on GitHub
component/vz
Dominant language
Go
Stars
21.9k
Forks
957
Avg merge
2d 6h
Merged PRs (30d)
53

Description

### Description

An example -- note it's *not* just uv pip install that is non-deterministic, but here you can see the same command run twice fails initially and then succeeds the second time (under the hood what happens is chmod +x failed):

```
vscode ➜ /workspaces/diabolica (1-setup-monorepo) $ uv pip install -r requirements.txt
Resolved 120 packages in 91ms
error: Failed to install: jsonpointer-3.0.0-py2.py3-none-any.http.whl (jsonpointer==3.0.0)
Caused by: failed to set permissions for file `/workspaces/diabolica/.venv/bin/jsonpointer`
Caused by: Operation not permitted (os error 1)
vscode ➜ /workspaces/diabolica (1-setup-monorepo) $ uv pip install -r requirements.txt
Resolved 120 packages in 70ms
Installed 5 packages in 57ms
+ juliacall==0.9.20
+ seaborn==0.13.2
+ semver==3.0.2
+ six==1.16.0
+ soupsieve==2.5
```

This is with vz and virtiofs enabled & a writable home mount and limactl 0.22.0:

```
mountType: "virtiofs"
mounts:
- location: "~"
writable: true
- location: "/tmp/lima"
writable: true
vmType: vz
```

Otherwise it's a plain Docker template for the Lima VM.

The Lima VM is running in latest VSCode as an Ubuntu 24.04 guest on MacOS. Versions:

- host: ```Darwin athansor.local 23.5.0 Darwin Kernel Version 23.5.0: Wed May 1 20:12:58 PDT 2024; root:xnu-10063.121.3~5/RELEASE_ARM64_T6000 arm64```
- guest: ```Linux 828b105a1c3b 6.8.0-35-generic #35-Ubuntu SMP PREEMPT_DYNAMIC Tue May 21 07:52:29 UTC 2024 aarch64 aarch64 aarch64 GNU/Linux```

Before launching the devcontainer (SSH into Lima VM):

```
$ mount | grep gonzo
mount0 on /Users/gonzo type virtiofs (rw,relatime)
```

And inside the devcontainer:

```
mount0 on /workspaces/diabolica type virtiofs (rw,relatime)
```

I do not see this issue with Docker Desktop with the exact same configuration. I have a hunch that the write-through from the Docker container to the VM to the underlying MacOS filesystem is a bit unstable, leading to this non-deterministic behavior.

Lima VM is brilliant, and I'd love to switch fully over, but this is a blocker.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.