colima: Cannot chown or chmod bind mounted files/dirs
Hello and thank you for the awesome project!
Iβm running into an inconsistency between docker for mac and lima. With docker for mac, I can successfully chown & chmod bind mounted files/dirs within a container.
If I attempt this with colima I get chown: file.txt: Permission denied
About this issue
- Original URL
- State: open
- Created 5 years ago
- Reactions: 14
- Comments: 32 (4 by maintainers)
This is how I solved it. I had to write mounts for
~twice: with absolute path and with~.Put this into your
/Users/<username>/.lima/_config/override.yaml:colima deletecolima start --mount-type 9pVersions:
It canβt work by path
/Users/<username>/.lima/_configin my version , then i chose another path/Users/<username>/.colima/_lima/_configand it works ,for reference onlyYes! Changing the VM type to macOS Virtualization.Framework as recommended here worked for me:
@Stokestack thanks for this pointer!
Same use case.- Resolved it following @bofm 's comment in three easy steps:
1. Stop colima and create
override.yamlfile2. Edit the template
3. Then start colima editing the configuration file before start:
Tried your docker-compose.yaml example:
This works but I had override.yaml defined at this path as well
/Users/<username>/.lima/_configso make sure you delete this one before defining one at/Users/<username>/.colima/_lima/_configpath else it wonβt allow colima to even startAlso worked for me. Thanks!
Has anyone been able to solve it?
My use case:
The logs are:
The error is:
Simple example:
Console:
I confirm that changing Colimaβs VM type worked for me without having to change anything else (so I did not do any of the steps contained in the highest upvoted comment much more above). Thanks @ruslanvs.
Not sure itβs always true. I had the same issue (vm-type is correct but mount-type doesnβt) and you cannot change --mount-type later w/o deleting env (colima delete)
@danielsepulvedab FYI: doing
--vm-type=vzautomatically does--mount-type=virtiofsas well. Double-checked my config to make sure. And it makes sense: it is specified thatvirtiofsis specifically for thevzVM type. So IMO youβre better off specifying the VM type and leave the mount type to get auto-adjusted.in my case I noticed that ~/.config/colima/default/colima.yaml had a
vmTypeofvzas default but themountTypewas set tosshfsdespite the default being indicated asvirtiofsand then it started to work
This works
Getting this issue on some popular images, which will attempt to correct host-mounted volume file ownership/permissions during their entrypoint scripts