lima icon indicating copy to clipboard operation
lima copied to clipboard

Attempting to mount a writable directory under a read-only directory doesn't work

Open UnoWho247 opened this issue 3 years ago • 2 comments

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.

UnoWho247 avatar Jun 01 '22 18:06 UnoWho247

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?

jandubois avatar Jun 01 '22 20:06 jandubois

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.

Miro0o avatar Aug 28 '22 06:08 Miro0o

Use a disk image that gets mounted in /Volumes/VOLUME_NAME?

jsoref avatar Jan 03 '23 20:01 jsoref

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

stevo-knievo avatar Apr 02 '23 07:04 stevo-knievo