Skip to content

Reading the content of an overlay volume mount fails on Hyper-V #26210

Open
@l0rd

Description

@l0rd

Issue Description

While working on #25988 I noticed that the content of an overly volume cannot be accessed from within a container running when running in an Hyper-V VM.

> podman run -ti --rm -v "C:\Users\mario\git\podman:/podman:O" fedora bash
[root@e605389e49de /]# cat /podman/Makefile
cat: /podman/Makefile: Invalid argument
[root@e605389e49de /]# ls /podman/version
ls: cannot access '/podman/version/version.go': Invalid argument
rawversion  version.go

The issue is Hyper-V specific, overlay volume mounts work fine on WSL.

Steps to reproduce the issue

Steps to reproduce the issue

  1. Checkout PR Fix overlay volumes on Windows #26200 and build podman
  2. $env:CONTAINERS_MACHINE_PROVIDER="hyperv"; ./bin/windows/podman machine init --now
  3. ./bin/windows/podman run -v <localpath>:/test fedora ls /test/

Describe the results you received

The error Invalid argument is returned when accessing files from the volume.

Describe the results you expected

It should be possible to read/write files in the overlay volume mount.

podman info output

Client:
  APIVersion: 5.5.0
  Built: 1747237549
  BuiltTime: Wed May 14 17:45:49 2025
  GitCommit: 0dbcb51477ee7ab8d3b47d30facf71fc38bb0c98
  GoVersion: go1.24.2
  Os: windows
  OsArch: windows/arm64
  Version: 5.5.0
host:
  arch: arm64
  buildahVersion: 1.40.0
  cgroupControllers:
  - cpu
  - io
  - memory
  - pids
  cgroupManager: systemd
  cgroupVersion: v2
  conmon:
    package: conmon-2.1.12-3.fc41.aarch64
    path: /usr/bin/conmon
    version: 'conmon version 2.1.12, commit: '
  cpuUtilization:
    idlePercent: 99.87
    systemPercent: 0.09
    userPercent: 0.04
  cpus: 6
  databaseBackend: sqlite
  distribution:
    distribution: fedora
    variant: coreos
    version: "41"
  eventLogger: journald
  freeLocks: 2047
  hostname: localhost.localdomain
  idMappings:
    gidmap:
    - container_id: 0
      host_id: 1000
      size: 1
    - container_id: 1
      host_id: 100000
      size: 1000000
    uidmap:
    - container_id: 0
      host_id: 1000
      size: 1
    - container_id: 1
      host_id: 100000
      size: 1000000
  kernel: 6.12.13-200.fc41.aarch64
  linkmode: dynamic
  logDriver: journald
  memFree: 1258450944
  memTotal: 2040147968
  networkBackend: netavark
  networkBackendInfo:
    backend: netavark
    dns:
      package: aardvark-dns-1.15.0-1.20250526101309455613.main.6.gabf96b2.fc41.aarch64
      path: /usr/libexec/podman/aardvark-dns
      version: aardvark-dns 1.16.0-dev
    package: netavark-1.15.0-1.20250526101337151503.main.16.g40515a5.fc41.aarch64
    path: /usr/libexec/podman/netavark
    version: netavark 1.16.0-dev
  ociRuntime:
    name: crun
    package: crun-1.21-1.20250522190826627867.main.128.gb973373b.fc41.aarch64
    path: /usr/bin/crun
    version: |-
      crun version UNKNOWN
      commit: 63c54f3f09ca4cd41a1e847723755e77592a3b9a
      rundir: /run/user/1000/crun
      spec: 1.0.0
      +SYSTEMD +SELINUX +APPARMOR +CAP +SECCOMP +EBPF +CRIU +LIBKRUN +WASM:wasmedge +YAJL
  os: linux
  pasta:
    executable: /usr/bin/pasta
    package: passt-0^20250121.g4f2c8e7-2.fc41.aarch64
    version: |
      pasta 0^20250121.g4f2c8e7-2.fc41.aarch64-pasta
      Copyright Red Hat
      GNU General Public License, version 2 or later
        <https://www.gnu.org/licenses/old-licenses/gpl-2.0.html>
      This is free software: you are free to change and redistribute it.
      There is NO WARRANTY, to the extent permitted by law.
  remoteSocket:
    exists: true
    path: unix:///run/user/1000/podman/podman.sock
  rootlessNetworkCmd: pasta
  security:
    apparmorEnabled: false
    capabilities: CAP_CHOWN,CAP_DAC_OVERRIDE,CAP_FOWNER,CAP_FSETID,CAP_KILL,CAP_NET_BIND_SERVICE,CAP_SETFCAP,CAP_SETGID,CAP_SETPCAP,CAP_SETUID,CAP_SYS_CHROOT
    rootless: true
    seccompEnabled: true
    seccompProfilePath: /usr/share/containers/seccomp.json
    selinuxEnabled: true
  serviceIsRemote: true
  slirp4netns:
    executable: /usr/bin/slirp4netns
    package: slirp4netns-1.3.1-1.fc41.aarch64
    version: |-
      slirp4netns version 1.3.1
      commit: e5e368c4f5db6ae75c2fce786e31eef9da6bf236
      libslirp: 4.8.0
      SLIRP_CONFIG_VERSION_MAX: 5
      libseccomp: 2.5.5
  swapFree: 0
  swapTotal: 0
  uptime: 3h 11m 52.00s (Approximately 0.12 days)
  variant: v8
plugins:
  authorization: null
  log:
  - k8s-file
  - none
  - passthrough
  - journald
  network:
  - bridge
  - macvlan
  - ipvlan
  volume:
  - local
registries:
  search:
  - docker.io
store:
  configFile: /var/home/core/.config/containers/storage.conf
  containerStore:
    number: 1
    paused: 0
    running: 0
    stopped: 1
  graphDriverName: overlay
  graphOptions: {}
  graphRoot: /var/home/core/.local/share/containers/storage
  graphRootAllocated: 106769133568
  graphRootUsed: 4284325888
  graphStatus:
    Backing Filesystem: xfs
    Native Overlay Diff: "true"
    Supports d_type: "true"
    Supports shifting: "false"
    Supports volatile: "true"
    Using metacopy: "false"
  imageCopyTmpDir: /var/tmp
  imageStore:
    number: 2
  runRoot: /run/user/1000/containers
  transientStore: false
  volumePath: /var/home/core/.local/share/containers/storage/volumes
version:
  APIVersion: 5.6.0-dev
  BuildOrigin: 'Copr: rhcontainerbot/podman-next'
  Built: 1748217600
  BuiltTime: Mon May 26 00:00:00 2025
  GitCommit: f4a01979332768c93a6cfeaca9110c694c560b96
  GoVersion: go1.23.9
  Os: linux
  OsArch: linux/arm64
  Version: 5.6.0-dev

Podman in a container

No

Privileged Or Rootless

Rootless

Upstream Latest Release

Yes

Additional environment details

Additional environment details

Additional information

That's not the only problem of host folders mounted in Hyper-V VMs #25686

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugCategorizes issue or PR as related to a bug.machineremoteProblem is in podman-remotestale-issuetriagedIssue has been triagedwindowsissue/bug on Windows

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions