Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Podman mount host volume return 'Error: statfs: no such file or directory' in Mac OS

Tags:

mount

podman

Recently switched from Docker Desktop to Podman, everything work smoothly except when I want to mount host volume into container. e.g.

➜  ~ podman run --name nginx -v ~/bin/nginx/nginx.conf:/etc/nginx/nginx.conf:ro -d -p 8080:80 nginx
Error: statfs /Users/rb/bin/nginx/nginx.conf: no such file or directory

➜  ~  ls -lt ~/bin/nginx/nginx.conf                                                                 
-rw-r--r--  1 rb staff  490 Apr 23 14:31 /Users/rb/bin/nginx/nginx.conf

The host file ~/bin/nginx/nginx.conf do exist, so what's the problem here?

like image 794
mainframer Avatar asked Sep 03 '25 17:09

mainframer


1 Answers

Try the following:

  1. Restart of VM:

    podman machine stop; podman machine start
    

    As @rafagarci mentioned in comments, sometimes new start failed and you should run these commands again a few times.

    Then mount (-v) works fine.

  2. If restart doesn't help then try to recreate your podman machine:

    podman machine stop
    podman machine rm
    podman machine init # you may specify parameters for your VM
    podman machine start
    

    In documentation you may find parameters for podman machine init command.

like image 80
Maxim Suslov Avatar answered Sep 06 '25 19:09

Maxim Suslov