podman icon indicating copy to clipboard operation
podman copied to clipboard

Permission denied is returned when trying to access some host folders mounted in Hyper-V machines

Open l0rd opened this issue 9 months ago • 0 comments

Describe the problem

In Hyper-V machines, by default, the host C:\ drive is mounted in /mnt/c and accessible from a container using a volume (podman run -v C:\anysubfolder ...).

However trying to access some folders such as %HOME% results in a permission denied error:

> podman run -it --rm -v %HOME%:/jeff fedora:41 bash
[root@806658ac8ff1 /]# ls /jeff
ls: reading directory '/jeff/': Permission denied

Other details

Accessing a subfolder of an access denied folder works fine:

[root@806658ac8ff1 /]# ls /jeff/git
...no error...

On a WSL machine the access denied error isn't returned. WSL uses drvfs mounts, Hyper-V uses v9fs (both use the p9 protocol from Plan9).

This behavior is observable on a regualar v5.4.1 Podman installation on Windows. This issue is related to https://github.com/containers/podman/issues/21036 (see comment)

l0rd avatar Mar 26 '25 10:03 l0rd