Replies: 5 comments 12 replies
|
volumes are always server side, so you must make sure you volume exists on the podman machine wsl instance not on your client. |
|
Somewhere else in some other discussions, people mentioned |
|
My work around to this issue was to delete the WSL |
|
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. |
|
When I need to mount local paths to the containers, I end up unsetting the CONTAINER_HOST to use the local WSL podman instance instead of the shared one that's on the podman-machine (which is another WSL instance). |
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
/mntunix:///mnt/wslbecomesunix:///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-instancepodman run --volume $PWD/inputs/:/data/inputs/ ubuntu:latestDescribe 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 directoryDescribe 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
All reactions