Skip to content
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

Filepath Conversion issue when running podman machine's in WSL2 and volumes/tmpfs #13707

Closed
dixonwille opened this issue Mar 30, 2022 · 2 comments · Fixed by #13908
Closed

Filepath Conversion issue when running podman machine's in WSL2 and volumes/tmpfs #13707

dixonwille opened this issue Mar 30, 2022 · 2 comments · Fixed by #13908
Labels
kind/bug Categorizes issue or PR as related to a bug. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. remote Problem is in podman-remote windows issue/bug on Windows

Comments

@dixonwille
Copy link

Is this a BUG REPORT or FEATURE REQUEST? (leave only one on its own line)

/kind bug

Description

On a freshly installed VM using podman machine init, I get errors reporting that relative paths are not accepted.

Steps to reproduce the issue:

Case 1: Easiest way to reproduce is below.

  1. podman machine init
  2. podman run --tmpfs /tmp hello-world

Case 2: An alternative to --tmpfs is trying to mount any directory from VM to container (not worried about from host yet).

  1. podman machine init
  2. podman run -v /mnt/c/Users/wdixon/tmp/testing:/somelocation hello-world

Describe the results you received:

Case 1: Error: invalid container path "\\tmp", must be an absolute path
Case 2: Error: statfs /home/user/C:\mnt\c\Users\wdixon\tmp\testing: no such file or directory

Describe the results you expected:

I would expect the paths in both cases not to have backslashes when on the agent and instead use the forward slash.

I was not expecting my volume for host to be prefixed with /home/user/C: either. Not sure if I am missing something in the documentation around how the VMs are setup or not.

Additional information you deem important (e.g. issue happens only occasionally):

Sneaky suspicion that Podman remote client is doing a filepath.Clean or even a filepath.Join in the case of the volume case but I don't know enough about the codebase to be able to navigate quickly through to suggest a fix. https://github.com/containers/podman/blob/main/libpod/container_path_resolution.go seemed promising but couldn't find the exact "invalid container path X must be an absolute path" error message there.

Case 1: Raw Output

time="2022-03-29T22:10:32-04:00" level=info msg="C:\\Program Files\\RedHat\\Podman\\podman.exe filtering at log level trace"
time="2022-03-29T22:10:32-04:00" level=debug msg="Called run.PersistentPreRunE(C:\\Program Files\\RedHat\\Podman\\podman.exe --log-level trace run --tmpfs /tmp hello-world)"
time="2022-03-29T22:10:32-04:00" level=debug msg="SSH Ident Key \"C:\\\\Users\\\\wdixon\\\\.ssh\\\\podman-machine-default\" SHA256:WiFJx7Xd7HxLIxeGLgF8K+AM4/cqhb/ytwBvikzWUPU ssh-ed25519"
time="2022-03-29T22:10:32-04:00" level=debug msg="DoRequest Method: GET URI: http://d/v4.0.2/libpod/_ping"
time="2022-03-29T22:10:32-04:00" level=warning msg="Failed to retrieve default tmp dir: invalid image_copy_tmp_dir value \"/var/tmp\" (relative paths are not accepted)"
time="2022-03-29T22:10:32-04:00" level=debug msg="Loading registries configuration \"/etc/containers/registries.conf\""
time="2022-03-29T22:10:32-04:00" level=debug msg="DoRequest Method: POST URI: http://d/v4.0.2/libpod/images/pull"
time="2022-03-29T22:10:32-04:00" level=debug msg="DoRequest Method: POST URI: http://d/v4.0.2/libpod/containers/create"
Error: invalid container path "\\tmp", must be an absolute path

Case 2: Raw Output

time="2022-03-29T22:08:36-04:00" level=info msg="C:\\Program Files\\RedHat\\Podman\\podman.exe filtering at log level trace"
time="2022-03-29T22:08:36-04:00" level=debug msg="Called run.PersistentPreRunE(C:\\Program Files\\RedHat\\Podman\\podman.exe --log-level trace run -v /mnt/c/Users/wdixon/tmp/testing:/somelocation hello-world)"
time="2022-03-29T22:08:36-04:00" level=debug msg="SSH Ident Key \"C:\\\\Users\\\\wdixon\\\\.ssh\\\\podman-machine-default\" SHA256:WiFJx7Xd7HxLIxeGLgF8K+AM4/cqhb/ytwBvikzWUPU ssh-ed25519"
time="2022-03-29T22:08:36-04:00" level=debug msg="DoRequest Method: GET URI: http://d/v4.0.2/libpod/_ping"
time="2022-03-29T22:08:36-04:00" level=warning msg="Failed to retrieve default tmp dir: invalid image_copy_tmp_dir value \"/var/tmp\" (relative paths are not accepted)"
time="2022-03-29T22:08:36-04:00" level=debug msg="Loading registries configuration \"/etc/containers/registries.conf\""
time="2022-03-29T22:08:36-04:00" level=debug msg="DoRequest Method: POST URI: http://d/v4.0.2/libpod/images/pull"
time="2022-03-29T22:08:36-04:00" level=debug msg="User mount /mnt/c/Users/wdixon/tmp/testing:/somelocation options []"
time="2022-03-29T22:08:36-04:00" level=debug msg="DoRequest Method: POST URI: http://d/v4.0.2/libpod/containers/create"
Error: statfs /home/user/C:\mnt\c\Users\wdixon\tmp\testing: no such file or directory

Output of podman version:

Client:       Podman Engine
Version:      4.0.2
API Version:  4.0.2
Go Version:   go1.18rc1
Git Commit:   342c8259381b63296e96ad29519bd4b9c7afbf97
Built:        Wed Mar  2 15:28:30 2022
OS/Arch:      windows/amd64

Server:       Podman Engine
Version:      4.0.2
API Version:  4.0.2
Go Version:   go1.16.14

Built:      Thu Mar 10 15:26:05 2022
OS/Arch:    linux/amd64

Output of podman info --debug:

host:
  arch: amd64
  buildahVersion: 1.24.1
  cgroupControllers: []
  cgroupManager: cgroupfs
  cgroupVersion: v1
  conmon:
    package: conmon-2.1.0-2.fc35.x86_64
    path: /usr/bin/conmon
    version: 'conmon version 2.1.0, commit: '
  cpus: 24
  distribution:
    distribution: fedora
    variant: container
    version: "35"
  eventLogger: file
  hostname: DIXON-DESKTOP
  idMappings:
    gidmap:
    - container_id: 0
      host_id: 1000
      size: 1
    - container_id: 1
      host_id: 100000
      size: 65536
    uidmap:
    - container_id: 0
      host_id: 1000
      size: 1
    - container_id: 1
      host_id: 100000
      size: 65536
  kernel: 5.10.16.3-microsoft-standard-WSL2
  linkmode: dynamic
  logDriver: journald
  memFree: 32857559040
  memTotal: 33548242944
  networkBackend: netavark
  ociRuntime:
    name: crun
    package: crun-1.4.3-1.fc35.x86_64
    path: /usr/bin/crun
    version: |-
      crun version 1.4.3
      commit: 61c9600d1335127eba65632731e2d72bc3f0b9e8
      spec: 1.0.0
      +SYSTEMD +SELINUX +APPARMOR +CAP +SECCOMP +EBPF +CRIU +YAJL
  os: linux
  remoteSocket:
    exists: true
    path: /run/user/1000/podman/podman.sock
  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: false
  serviceIsRemote: true
  slirp4netns:
    executable: /usr/bin/slirp4netns
    package: slirp4netns-1.1.12-2.fc35.x86_64
      slirp4netns version 1.1.12
      commit: 7a104a101aa3278a2152351a082a6df71f57c9a3
      libslirp: 4.6.1
      SLIRP_CONFIG_VERSION_MAX: 3
      libseccomp: 2.5.3
  swapFree: 8589660160
  swapTotal: 8589934592
  uptime: 29m 34.98s
plugins:
  log:
  - k8s-file
  - none
  - passthrough
  - journald
  network:
  - bridge
  - macvlan
  volume:
  - local
registries:
  search:
  - registry.fedoraproject.org
  - registry.access.redhat.com
  - docker.io
  - quay.io
store:
  configFile: /home/user/.config/containers/storage.conf
  containerStore:
    number: 0
    paused: 0
    running: 0
    stopped: 0
  graphDriverName: overlay
  graphOptions:
    overlay.mount_program:
      Executable: /usr/bin/fuse-overlayfs
      Package: fuse-overlayfs-1.7.1-2.fc35.x86_64
      Version: |-
        fusermount3 version: 3.10.5
        fuse-overlayfs: version 1.7.1
        FUSE library version 3.10.5
        using FUSE kernel interface version 7.31
  graphRoot: /home/user/.local/share/containers/storage
  graphStatus:
    Backing Filesystem: extfs
    Native Overlay Diff: "false"
    Supports d_type: "true"
    Using metacopy: "false"
  imageCopyTmpDir: /var/tmp
  imageStore:
    number: 1
  runRoot: /run/user/1000/containers
  volumePath: /home/user/.local/share/containers/storage/volumes
version:
  APIVersion: 4.0.2
  Built: 1646943965
  BuiltTime: Thu Mar 10 15:26:05 2022
  GitCommit: ""
  GoVersion: go1.16.14
  OsArch: linux/amd64
  Version: 4.0.2

Package info (e.g. output of rpm -q podman or apt list podman):

N/A as I went to Github releases, downloaded the v4.0.2 MSI and installed that way.

Have you tested with the latest version of Podman and have you checked the Podman Troubleshooting Guide? (https://github.com/containers/podman/blob/main/troubleshooting.md)

Yes

Additional environment details (AWS, VirtualBox, physical, etc.):

Host: Windows 11
VM: WSL2 using podman machine init

@openshift-ci openshift-ci bot added the kind/bug Categorizes issue or PR as related to a bug. label Mar 30, 2022
@github-actions github-actions bot added remote Problem is in podman-remote windows issue/bug on Windows labels Mar 30, 2022
@n1hility
Copy link
Member

Volume support is not yet fully implemented but on my TODO after I get back (away this week) I have a preliminary client side approach available here if you want to try it out [1], but we need more for detecting and handling docker api clients on the server side. Although, docker clients do work today if you use a /mnt/c/foo/bar convention.

[1] https://github.com/n1hility/podman/tree/client-win-mounts

@dixonwille
Copy link
Author

I'll check it out thanks for the heads up. Wasn't sure what is/isn't supported considering the WSL2 changes were so recent.

@github-actions github-actions bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Sep 20, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 20, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/bug Categorizes issue or PR as related to a bug. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. remote Problem is in podman-remote windows issue/bug on Windows
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants