Replies: 4 comments 7 replies
-
volumes are always server side, so you must make sure you volume exists on the podman machine wsl instance not on your client. |
Beta Was this translation helpful? Give feedback.
-
Somewhere else in some other discussions, people mentioned |
Beta Was this translation helpful? Give feedback.
-
My work around to this issue was to delete the WSL |
Beta Was this translation helpful? Give feedback.
-
I have managed to get this working by using the following solution with podman-desktop 1.19.2, podman-machine 5.5.1 (wsl2) ubuntu 24.04 (wsl2).
cat <<EOF | sudo tee /etc/systemd/system/mnt-wsl-instances-${WSL_DISTRO_NAME/-/}.mount
[Unit]
Description=WSL Instances
[Mount]
What=/
Where=/mnt/wsl/instances/${WSL_DISTRO_NAME/-/}
Type=none
Options=defaults,bind,X-mount.mkdir
[Install]
WantedBy=multi-user.target
EOF
sudo systemctl daemon-reload
sudo systemctl enable mnt-wsl-instances-${WSL_DISTRO_NAME/-/}.mount --now
sudo ln -s /mnt/wsl/instances/ubuntu/home/nicj /home/nicj
I use my home folder as it is where I store all my files but as long as you create a symlink on the podman-machine that is the same location as the files on the main wsl instance you can use any folders you like. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Issue Description
I have followed the instructions at https://podman-desktop.io/docs/podman/accessing-podman-from-another-wsl-instance,
*note the name is wrong above and because I mount my wsl2 distribution from / rather than
/mnt
unix:///mnt/wsl
becomesunix:///wsl
.I can also run and enter a container like so
However, when I run
I get
But this directory does exist
ls $PWD/inputs/
returns the list of files in this directory.How can I mount volumes from another WSL2 instance?
Steps to reproduce the issue
Steps to reproduce the issue
https://podman-desktop.io/docs/podman/accessing-podman-from-another-wsl-instance
podman run --volume $PWD/inputs/:/data/inputs/ ubuntu:latest
Describe the results you received
Describe the results you received
I received the error message
Error: statfs /home/alexiswl/cwltool-podman-test/inputs: no such file or directory
Describe the results you expected
To run the container with the volume mounted
podman info output
Podman in a container
No
Privileged Or Rootless
Rootless
Upstream Latest Release
Yes
Additional environment details
No response
Additional information
No response
Beta Was this translation helpful? Give feedback.
All reactions