lima
lima copied to clipboard
Attempting to mount a writable directory under a read-only directory doesn't work
Description
Lima version 0.11.0 Mac OS Monterey
With the default configuration and adding an additional mount:
mounts:
- location: "~"
- location: "/tmp/lima"
writable: true
- location: "~/dev"
writable: true
I would always receive the following message when starting the container:
INFO[0032] [hostagent] Mounting "/Users/gteu/dev"
INFO[0032] [hostagent] fusermount3: user has no write access to mountpoint /Users/gteu/dev
WARN[0064] [hostagent] failed to confirm whether /Users/gteu/dev [remote] is successfully mounted
However, I was able to get the mount to work by making the following modification to lima.yaml (eliminating the home directory read-only mount):
mounts:
- location: "~/dev"
writable: true
- location: "/tmp/lima"
writable: true
This suggests that the home directory read-only directive prevented the sub directory writable directive. This feels like a bug? I believe I read somewhere that sub-directory mounts should override any parent directory settings. If that behavior is intended, some further documentation to indicate that fact would be helpful.
I know that overlapping mounts do not work properly with sshfs (see #302). Have you tried using the 9p mount type to see if it works there?
I got the same problem. Is there any way to do it without changing to other mount type? I need to mount a writable directory to lima for use of Harbor.
Use a disk image that gets mounted in /Volumes/VOLUME_NAME?
I have the same issues.
I switched to virtiofs and now it works fine.
https://github.com/lima-vm/lima/blob/master/docs/vmtype.md#vz