Skip to content
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

Error when using --volume on podman machine init on Mac #13001

Closed
scottwlyft opened this issue Jan 24, 2022 · 5 comments
Closed

Error when using --volume on podman machine init on Mac #13001

scottwlyft opened this issue Jan 24, 2022 · 5 comments
Labels
kind/bug Categorizes issue or PR as related to a bug. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.

Comments

@scottwlyft
Copy link

Is this a BUG REPORT or FEATURE REQUEST? (leave only one on its own line)

/kind bug

Description

I am trying to use the new --volume option added as part of 4.0.0 in podman machine init. I'm am getting this error from qemu virtfs support is disabled.

Steps to reproduce the issue:

On my 2019 Macbook Pro running MacOS 11.6.2

  1. brew install --HEAD podman

  2. podman machine init --now --volume ~/src:/src

Describe the results you received:

The machine init command shows this output

Extracting compressed file
Image resized.
Machine init complete
[/usr/local/opt/podman/libexec/gvproxy -listen-qemu unix:///var/folders/v_/q5jt09w11bb7shlgxd78cqqh0000gp/T/podman/qemu_podman-machine-default.sock -pid-file /var/folders/v_/q5jt09w11bb7shlgxd78cqqh0000gp/T/podman/podman-machine-default.pid -ssh-port 64669 --debug]
DEBU[0000] Using search domains: [lyft.net]
INFO[0000] waiting for clients...
DEBU[0026] [/usr/local/bin/qemu-system-x86_64 -m 2048 -smp 1 -fw_cfg name=opt/com.coreos/config,file=/Users/scottw/.config/containers/podman/machine/qemu/podman-machine-default.ign -qmp unix://var/folders/v_/q5jt09w11bb7shlgxd78cqqh0000gp/T/podman/qmp_podman-machine-default.sock,server=on,wait=off -netdev socket,id=vlan,fd=3 -device virtio-net-pci,netdev=vlan,mac=5a:94:ef:e4:0c:ee -device virtio-serial -chardev socket,path=/var/folders/v_/q5jt09w11bb7shlgxd78cqqh0000gp/T/podman/podman-machine-default_ready.sock,server=on,wait=off,id=podman-machine-default_ready -device virtserialport,chardev=podman-machine-default_ready,name=org.fedoraproject.port.0 -machine q35,accel=hvf:tcg -cpu host -virtfs local,path=/Users/scottw/src,mount_tag=vol0,security_model=mapped-xattr -drive if=virtio,file=/Users/scottw/.local/share/containers/podman/machine/qemu/podman-machine-default_fedora-coreos-35.20220116.2.0-qemu.x86_64.qcow2]
INFO[0000] new connection from  to /var/folders/v_/q5jt09w11bb7shlgxd78cqqh0000gp/T/podman/qemu_podman-machine-default.sock
Waiting for VM ...
qemu-system-x86_64: -virtfs local,path=/Users/scottw/src,mount_tag=vol0,security_model=mapped-xattr: There is no option group 'virtfs'
qemu-system-x86_64: -virtfs local,path=/Users/scottw/src,mount_tag=vol0,security_model=mapped-xattr: virtfs support is disabled
Error: dial unix /var/folders/v_/q5jt09w11bb7shlgxd78cqqh0000gp/T/podman/podman-machine-default_ready.sock: connect: no such file or directory
ERRO[0003] cannot receive packets from , disconnecting: cannot read size from socket: EOF
ERRO[0003] cannot read size from socket: EOF

Describe the results you expected:

I expect the machine to start successfully with the ~/src dir mounted inside the VM.

Additional information you deem important (e.g. issue happens only occasionally):

Output of podman version:

podman version 4.0.0-dev

Output of podman info --debug:

The VM was not started so no machine output

Cannot connect to Podman. Please verify your connection to the Linux system using `podman system connection list`, or try `podman machine init` and `podman machine start` to manage a new Linux VM
Error: unable to connect to Podman. failed to create sshClient: Connection to bastion host (ssh://core@localhost:64669/run/user/1000/podman/podman.sock) failed.: dial tcp 127.0.0.1:64669: connect: connection refused

Package info (e.g. output of rpm -q podman or apt list podman):

N/A

Have you tested with the latest version of Podman and have you checked the Podman Troubleshooting Guide? (https://github.com/containers/podman/blob/main/troubleshooting.md)

Yes

Additional environment details (AWS, VirtualBox, physical, etc.):

2019 Macbook Pro running MacOS 11.6.2

Qemu version installed via brew:

> /usr/local/bin/qemu-system-x86_64 --version
QEMU emulator version 6.2.0
Copyright (c) 2003-2021 Fabrice Bellard and the QEMU Project developers
@openshift-ci openshift-ci bot added the kind/bug Categorizes issue or PR as related to a bug. label Jan 24, 2022
@rhatdan
Copy link
Member

rhatdan commented Jan 25, 2022

@baude PTAL

@afbjorklund
Copy link
Contributor

afbjorklund commented Jan 25, 2022

"qemu-system-x86_64: ... virtfs support is disabled"

You need a custom patched version of QEMU, unfortunately the support for Mac is not available upstream yet.

See NixOS/nixpkgs#122420 for patches

Maybe the error message could be better ?

The workaround is to skip the -v flag to init, and then use something else (sshocker ?) to access host files.


A similar error can happen if it is missing

qemu-system-x86_64: -virtfs local,path=/home/anders/src,mount_tag=vol0,security_model=mapped-xattr: cannot initialize fsdev 'vol0': failed to open '/home/anders/src': No such file or directory

But otherwise, it is supposed to mount OK.

$ ./bin/podman machine init --now --volume ~/src:/src
Extracting compressed file
Image resized.
Machine init complete
INFO[0000] waiting for clients...                       
INFO[0000] new connection from @ to /run/user/1000/podman/qemu_podman-machine-default.sock 
Waiting for VM ...
Mounting volume... /home/anders/src:/src
Machine "podman-machine-default" started successfully
$ uname
Linux

@scottwlyft
Copy link
Author

Thanks for the pointers, guess we'll just need to wait for the qemu change to be merged. May be worth adding to the podman docs that for the -v option the host must be Linux. I'm sure there are lots of folks waiting for this support on MacOS to get rid of Docker Desktop so it would be good to make that clear in the release notes. I'll also give sshocker a try.

@afbjorklund
Copy link
Contributor

May be worth adding to the podman docs that for the -v option the host must be Linux.

It's not really true, though. But it could be worth documenting that "virtfs" support is needed.

@cron410
Copy link

cron410 commented Apr 5, 2022

This seems to be working for me now. #13256 (comment)

@github-actions github-actions bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Sep 20, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 20, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/bug Categorizes issue or PR as related to a bug. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.
Projects
None yet
Development

No branches or pull requests

4 participants