-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Cannot mount local folder with HyperV #21036
Comments
Could this be an SELinux issue? Add :Z to volume mount. |
Closing as I can not reproduce |
Reopening as I face it again and adding :Z does not help |
Is there a directory /mnt/c/Users/Jeff in the VM? @n1hility @ashley-cui @baude is this where we are mounting the default users homedir? |
the /mnt folder exists but it is empty |
What happens on a Mac is we automatically mount the home directory into the VM, so I would assume something similar is being attempted or should be attempted on Windows with HyperV. In containers.conf look at [Machine] table to see if there is a volumes entry like:
|
I don't see such an entry in containers.conf |
Might be an oversight in our HyperV support. @ashley-cui @baude @n1hility Should this be setup for Windows? |
@jeffmaury you could try to set this in the config and stop and start the machine. Might need to recreate it to see if the volume shows up. I don't do Windows, so I am not sure what is and is not supported. Obviously the core developers might not be responsive since Red Hat is closed for winter break. |
If I had the volumes in the machine section, then I have this:
|
A friendly reminder that this issue had no activity for 30 days. |
Hello, I'm sorry to barge in like this. I just wanted to ask whether this issue is being worked on, or if not, whether it is planned to be worked on. That feature would be a game changing experience for Windows users, I am sure of it. It was mentioned that Mac also supported mounting local directories as volumes on a VM, so I am just wondering what can be done in the case of Hyper-V. Thank you in advance! |
Have you tried out podman 5.0 yet? If this does not work, the best way to get a feature in is to open a PR with the feature. |
I've been waiting for the official release but will try fiddling with the release candidates. On the side, I get that if you want something, you should do it yourself, yet if it were Youki that caused me problems, I would've tried opening a PR, but sadly I am not proficient when it comes to Golang, or experienced at all for that matter. |
@ashley-cui Is this fixed in 5.0? |
TL;DRIt worked on 5.0, but needs more love to become more straight forward. Long versionTo update on the issue, on 5.0.0-rc6 it does work when my [containers]
[engine]
[machine]
provider = "hyperv"
volumes = ["\\\\localhost\\c$\\:/mnt/c"]
[network]
[secrets]
[configmaps]
[farms] The problems now are that My current best-effort solution was to create a scheduled task which runs at system start-up as the "Administrators" group and As you can see, I also tried passing the |
For me it's is still broken on Windows as my home folder is mounted inside the VM as /Users/%USERNAME% but when running
so it seems it is still trying to use the WSL mappings |
In that case, you would probably want to still map it with the full path, Also, if the problem persists, maybe try recreating the VM (or create another one and set it as default), as it produces JSON file configurations which, I found out by observations, are then used by the gvproxy/Plan 9 Protocol server. I am not sure whether Podman does update them on changes in I hope that helps. |
Yes but as there are defaults provided, checking if they are correct as it's not required for WSL |
@Luap99 IMO easiest / simplest is to just mirror the WSL convention, it's a good layout that avoids collisions, and you solve problems with the remote client code having to figure out which backend it's talking to. |
I'm using podman 5.0.3 on windows, and wanting to check if mounting local windows folder was supported with the hyperv provider.
But the /var/mnt/c folder is not readable... Update: and now the /var/mnt/c/toto is mounted and readable. |
I have opened a PR to address this problem (containers/common#2100). I have followed @n1hility suggestion so that, by default, Hyper-V machines volume mount is consistent with the WSL convention (e.g. Machine e2e volume test work on Hyper-V with this fix and I have opened a separate PR to re-enable it #23401. |
Closing as that's fixed in main branch and the e2e CI test has been re-enabled. |
Reopening as I am facing the problem with 5.2.3 |
@jeffmaury the fix is not included in 5.2.3, it will be in 5.3.0. In general Podman patch releases contain only the commits that are backported to the specific version branch (in this case v5.2). There was no particular request to backport the fix for this issue to 5.2.3 so it hasn't been included. |
Issue Description
If I try to mount a local folder in a container with HyperV machine, it is rejected:
Steps to reproduce the issue
Steps to reproduce the issue
podman run -it -rm -v %CD%:/jeff busybox
Describe the results you received
Describe the results you received
Describe the results you expected
Error is raised
podman info output
Podman in a container
No
Privileged Or Rootless
None
Upstream Latest Release
Yes
Additional environment details
Additional environment details
Additional information
Additional information like issue happens only occasionally or issue happens with a particular architecture or on a particular setting
The text was updated successfully, but these errors were encountered: