Open pravic opened 3 weeks ago
Does ./hello.conf
actually exists on the server side? Mounts must always exists on the server. My understanding is also that we do not create the source dir in podman if it does not exists so I wonder what would create it in that case. Maybe something special in the remote client is doing that.
For windows there is some special code that maps the windows client path to the correct WSL server path automatically but if you use the normal linux podman-remote it cannot do that.
but if you use the normal linux podman-remote it cannot do that.
@Luap99 As I mentioned, I use Ubuntu under WSL.
Does ./hello.conf actually exists on the server side?
By server side you mean what? touch ./hello.conf
does create an empty file. I also tried with cp some_existing_file /path/to/conf
- no difference: it's still a directory in the container.
Well the server where podman actual runs not the client side WSL instance
Why would that file exist on the podman machine (if you mean podman-machine-default
)? It exists in WSL.
For windows there is some special code that maps the windows client path to the correct WSL server path automatically but if you use the normal linux podman-remote it cannot do that.
So, you are saying that if I mount a file from Windows to a container, then Podman translates that file path into the podman machine (something like c:\file.txt
=> /mnt/c/file.txt
) and then maps it into the container. Right?
And in my case, when I mount a file from a WSL instance to a container, then Podman also translates that file path into the podman machine, however this case works only for directories.
So, you are saying that if I mount a file from Windows to a container, then Podman translates that file path into the podman machine (something like c:\file.txt => /mnt/c/file.txt) and then maps it into the container. Right?
Correct
And in my case, when I mount a file from a WSL instance to a container, then Podman also translates that file path into the podman machine, however this case works only for directories.
No directory or file should not make a difference for resolving a path. However the thing I am not clear on if the linux remote client resolves the relative path on the client or the on the server relative the the service cwd. I would expect podman to error out if the source does not exists so if it does not find the file on the server side it should error out which I assume should happen here unless you somehow make sure the client side file also exists on the server. I guess something strange is happening here, have you tried specifying the full path not a relative one?
have you tried specifying the full path not a relative one?
I don't really remember. I should have but not 100% sure, so I'll check the next time I install Podman.
Issue Description
podman-remote mounts files as directories
Steps to reproduce the issue
Steps to reproduce the issue: after installing
podman-remote
via https://podman-desktop.io/docs/podman/accessing-podman-from-another-wsl-instance:Using the same command on Windows host works fine:
Describe the results you received
Files are mounted as directories.
Describe the results you expected
Files should be mounted as files.
podman info output
podman info
``` host: arch: amd64 buildahVersion: 1.37.3 cgroupControllers: - cpuset - cpu - cpuacct - blkio - memory - devices - freezer - net_cls - perf_event - net_prio - hugetlb - pids - rdma - misc cgroupManager: cgroupfs cgroupVersion: v1 conmon: package: conmon-2.1.12-2.fc40.x86_64 path: /usr/bin/conmon version: 'conmon version 2.1.12, commit: ' cpuUtilization: idlePercent: 98.89 systemPercent: 0.51 userPercent: 0.6 cpus: 16 databaseBackend: sqlite distribution: distribution: fedora variant: container version: "40" eventLogger: journald freeLocks: 2044 hostname: NZXT idMappings: gidmap: null uidmap: null kernel: 5.15.153.1-microsoft-standard-WSL2 linkmode: dynamic logDriver: journald memFree: 31295909888 memTotal: 33621884928 networkBackend: netavark networkBackendInfo: backend: netavark dns: package: aardvark-dns-1.12.2-2.fc40.x86_64 path: /usr/libexec/podman/aardvark-dns version: aardvark-dns 1.12.2 package: netavark-1.12.2-1.fc40.x86_64 path: /usr/libexec/podman/netavark version: netavark 1.12.2 ociRuntime: name: crun package: crun-1.17-1.fc40.x86_64 path: /usr/bin/crun version: |- crun version 1.17 commit: 000fa0d4eeed8938301f3bcf8206405315bc1017 rundir: /run/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^20240906.g6b38f07-1.fc40.x86_64 version: | pasta 0^20240906.g6b38f07-1.fc40.x86_64 Copyright Red Hat GNU General Public License, version 2 or laterPodman in a container
No
Privileged Or Rootless
None
Upstream Latest Release
Yes
Additional environment details
Host: Windows 10 19045 Podman Desktop: 1.13.3 podman-remote: tried both 4.9.1 and 5.2.5 WSL v2 WSL containers: Ubuntu 20.04.6 and Ubuntu 24.04.1
Additional information
Docker Desktop integration with WSL works perfectly - it creates a symlink: