lima icon indicating copy to clipboard operation
lima copied to clipboard

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

Open 0xg0nz0 opened this issue 8 months ago • 1 comments

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.

0xg0nz0 avatar Jun 22 '24 18:06 0xg0nz0