Mounting volumes between host (MacOs BigSur) and podman VM
Asked Answered
O

2

5

In my company we switched to Podman due to docker latest change in policies. My colleagues who use Windows with WSL2 switched seamlessly. Me, who uses MacOs BigSur v.11.6.2 face the following issue:

$ podman machine init -v /Users:/mnt/Users
$ podman machine start

I get the following error

$ Starting machine "podman-machine-default"
$ INFO[0000] waiting for clients...                       
$ INFO[0000] new connection from  to /var/folders/4z/9v__6yld4d7fzmbxm8trl1sh0000gn/T/podman/qemu_podman-machine-default.sock 
$ Waiting for VM ...
$ qemu-system-x86_64: -virtfs local,path=/Users/Dimitrii_Meritsidi/Documents/spbh_exus/git/cdp_airflow_local_environment,mount_tag=vol0,security_model=mapped-xattr: There is no option group 'virtfs'
$ qemu-system-x86_64: -virtfs local,path=/Users/Dimitrii_Meritsidi/Documents/spbh_exus/git/cdp_airflow_local_environment,mount_tag=vol0,security_model=mapped-xattr: virtfs support is disabled

I have read that MacOs Bigsur doesn't support virtfs. What are the possible solutions here? I have found probable workaround with Vmware Fusion, however it is also on paid subscription. The reason I need to use this mounting is because we use docker-compose.yml with volumes for launching local airflow.

Ongoing answered 3/2, 2022 at 12:57 Comment(2)
According to this GitHub comment, a QEMU version that includes virtfs support is required to get this to workEncephalogram
Thanks, I have seen that tread and comment.. I tried to follow it but it didn't work. It has a few discrepancies. I guess we have to make for stable qemu with virtfs support or at least unambiguous instruction.Ongoing
R
13

To allow volume mounts on MacOS, podman machine needs to be created with access to the folder from which you are going to attempt to mount sub-folders, so it would have access to it.

Is likely that most MacOS users would only want to mount from within their home directory, so machine should be created like below:

podman machine init --now --cpus=4 --memory=4096 -v $HOME:$HOME
Rhondarhondda answered 10/10, 2022 at 9:50 Comment(2)
Is there any way of doing this after the machine has been initialized?Cottonweed
According to what @Rhondarhondda said in the guide, you need to remove the machine first and redo the whole machine init. It worked for me.Relativistic
M
5

try

podman machine init --volume /Users --volume /Volumes
Mulry answered 17/3, 2022 at 9:41 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.