Open ssbarnea opened 2 months ago
That was the first thing I tried once i discovered the issue. Yep, it does not mount:
$ podman --log-level=debug run -it -v $PWD:$PWD bash bash INFO[0000] podman filtering at log level debug DEBU[0000] Called run.PersistentPreRunE(podman --log-level=debug run -it -v /Volumes/code/p:/Volumes/code/p bash bash) DEBU[0000] SSH Ident Key "/Users/ssbarnea/.config/containers/podman/machine/machine" SHA256:mPYRAtUq5IqO9+5xiW1+SX4xKCY+gKT+zM9Lx67C9h0 ssh-ed25519 DEBU[0000] DoRequest Method: GET URI: http://d/v5.2.2/libpod/_ping DEBU[0000] Loading registries configuration "/etc/containers/registries.conf" DEBU[0000] Found credentials for brew.registry.redhat.io in credential helper containers-auth.json in file /Users/ssbarnea/.config/containers/auth.json DEBU[0000] Found credentials for registry.redhat.io in credential helper containers-auth.json in file /Users/ssbarnea/.config/containers/auth.json DEBU[0000] DoRequest Method: POST URI: http://d/v5.2.2/libpod/images/pull DEBU[0000] User or group ID mappings not available: open /proc/self/uid_map: no such file or directory DEBU[0000] User or group ID mappings not available: open /proc/self/uid_map: no such file or directory DEBU[0000] User mount /Volumes/code/p:/Volumes/code/p options [] DEBU[0000] DoRequest Method: GET URI: http://d/v5.2.2/libpod/images/bash/json DEBU[0000] DoRequest Method: POST URI: http://d/v5.2.2/libpod/containers/create Error: statfs /Volumes/code/p: no such file or directory DEBU[0000] Shutting down engines FAIL: 125
Based on my research it seems that by default podman machine is not created with volume mounts needed for properly mount code from macos.
$ podman machine list
NAME VM TYPE CREATED LAST UP CPUS MEMORY DISK SIZE
podman-machine-default* applehv 11 days ago Currently running 5 2GiB 100GiB
ssbarnea@m1: ~/other/ansible-dev-tools feat/devspaces
$ podman machine inspect
[
{
"ConfigDir": {
"Path": "/Users/ssbarnea/.config/containers/podman/machine/applehv"
},
"ConnectionInfo": {
"PodmanSocket": {
"Path": "/var/folders/32/1xrphgzd4xv777syxjtkpdw80000gn/T/podman/podman-machine-default-api.sock"
},
"PodmanPipe": null
},
"Created": "2024-09-16T14:44:13.466193+01:00",
"LastUp": "2024-09-26T17:11:06.325768+01:00",
"Name": "podman-machine-default",
"Resources": {
"CPUs": 5,
"DiskSize": 100,
"Memory": 2048,
"USBs": []
},
"SSHConfig": {
"IdentityPath": "/Users/ssbarnea/.config/containers/podman/machine/machine",
"Port": 62790,
"RemoteUsername": "core"
},
"State": "running",
"UserModeNetworking": true,
"Rootful": false,
"Rosetta": true
}
]
I am going to follow their recommendation and test the podman machine init --volume /Users --volume /Volumes
which may seem as generic approach. If it works we should really consider making this implicit on macos. As I explained if user keeps code on another partition, podman machine will not be usable.
I know that they could in theory use other location for mounting, but that is highly unlikely, due to how macos works.
Results: it works.
@baude Should we rename this issue to mark changing default volume mount on macos? -- That is quite important especially from UX point of view, as we do want a setup that "just works".
A friendly reminder that this issue had no activity for 30 days.
This post has saved me from ripping all my hair out.
I had to add the /tmp directory to it as well, but this worked for me.
podman machine init --volume /Users --volume /Volumes --volume /tmp
Issue Description
Steps to reproduce the issue
Steps to reproduce the issue
Describe the results you received
Describe the results you expected
Podman should be able to mount local partitions.
podman info output
Podman in a container
No
Privileged Or Rootless
None
Upstream Latest Release
Yes
Additional environment details
$ uname -a Darwin m1 23.6.0 Darwin Kernel Version 23.6.0: Mon Jul 29 21:14:30 PDT 2024; root:xnu-10063.141.2~1/RELEASE_ARM64_T6000 arm64
Additional information
It should be noted that the partition that I am an APFS Volume created with case-sensitive switch on, because that is recommended for keeping code that works on linux (default APFS is case insensitive).
I am not sure yet if that case-insensitive is the cause for failure or any kind of partition would trigger the same bug.
Initially I believed it was the fact that this partition is symlinked to
~/code
location and that this might confuse PWD, but I tried resolving the path and the issue is still present.statfs reports it as not being able to find it.
I also destroyed and recreated the podman machine as part of debugging, no change in behavior. Out of curiosity I also tested docker behavior, but docker does not seem to have any problem mounting it.