-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cannot receive inotify on shared directories when using AppleHV #22343
Comments
Not sure about this, see this comment from about 1 year ago lima-vm/lima#615 (comment)
|
A friendly reminder that this issue had no activity for 30 days. |
👀 |
It seems from reading above that this is an issue with virtiofsd, not sure if it is something with the way Podman sets it, or if this is even a podman bug. |
This issue is not caused by podman, but by an upstream dependency (virtiofs) of podman. However, it has affected the users of podman, but I am not sure how costly it would be to fix this issue within podman. |
Can it be fixed by podman? inotify is handled between the kernel and the virtiofsd. Perhaps Podman is not setting a setting correct in the kernel to work with it, but otherwise this is not something that can be fixed by Podman. |
I'm not sure how I can help with this issue but reporting my scenario, which seems close to this one. If I'm running a container that requires notifications (Jekyll), if I create or modify a file in a shared folder from macOS, I do not see any notification event, but I can see the modifications in the container (e.g. For now, I'm using this workaround: edit the files I need immediate rebuild directly in the VM, if not, I'll edit on macOS and simply If there's anything else I can do to help finding the issue, let me know, as fixing this would be a nice improvement in several of my workflows. |
Thanks for sharing your workaround, @rjeffman. As I'm familiarising myself with podman I have a few questions about your workaround:
Hopefully I've been able to phrase my questions in a way that makes sense for someone more familiar with podman… |
It's been a couple of months since this issue was open, is there any plan on fixing the behavior? I do understand that this is caused by a dependency ( |
Issue Description
When the host modifies/deletes a file, the guest/container cannot receive
inotify
, resulting in the file watch inside the container not taking effect. The actual impact is that features like code hot reloading do not work properly.After extensive testing, I have concluded the following:
inotify
cannot be received in the machine’s virtual environment either.virtiofs
. As of 2021, virtiofs has already supportedinotify
, as seen here: https://lwn.net/Articles/874000/Regarding point 4, relevant discussions and code can be found here:
• lima-vm/lima#615
• lima-vm/lima#1913
• https://github.com/abiosoft/colima/blob/main/daemon/process/inotify/events.go
However, the solutions provided by lima and colima are not perfect as they cannot simulate
DELETE
events. They can only simulate creation/modification events.Regarding point 5, I came across a brief introduction in Docker’s blog: https://www.docker.com/blog/deep-dive-into-new-docker-desktop-filesharing-implementation/ (it seems to be for Windows, and I am unsure if the same solution applies to macOS). The approach of Docker seems to be creating an intermediate layer to deceive the virtual machine, in order to successfully simulate the DELETE event using
rm -rf
.Steps to reproduce the issue
15-11.19.15.mp4
Describe the results you received
No
inotify
events received.Describe the results you expected
I can receive
inotify
messages for create/modify/delete operations.podman info output
Version:
v5.0.1
Details
Podman in a container
No
Privileged Or Rootless
None
Upstream Latest Release
Yes
Additional environment details
AppleHV
Additional information
I suspect this is a bug in the Apple virtualization.framework.
/cc @baude @cfergeau
The text was updated successfully, but these errors were encountered: