-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Issue with podman machine init and option --volume on macOS (virtfs support is disabled, says qemu) #13256
Comments
See #8016 (comment) Formula: https://github.com/afbjorklund/homebrew-core/blob/qemu-9p-darwin/Formula/qemu.rb EDIT: Update link to patch (.diff and not .patch), and use the branches from willcohen |
There are no other drivers at the moment. I planned on doing one for sshocker, but it was better to run as a command. Theoretically one could add drivers for NFS and for SMB, but I don't think anyone has volunteered to do it yet. Eventually we are hoping for a virtio-fs driver for darwin (using vsock), but that could be well in the future ( EDIT: On the Podman community cabal, it was revealed that there might be virtio-fs for darwin already this year (2022) The engineers are busy rewriting it in Rust, but after that it should be possible to use it with Podman 4.x something |
Thanks a lot @afbjorklund that looks promising. I will try that formula and report back. |
This comment was marked as outdated.
This comment was marked as outdated.
@afbjorklund I get this issue with your patch when installing your formula for qemu with virtfs (build-from-source):
I did not have the time to investigate in details but at first sight the files to patch should be present in the upstream branch: https://gitlab.com/wwcohen/qemu/-/tree/9p-darwin/hw/9pfs but there were some commits a week ago, so could it be that the patch is no longer compatible? Should I try to use the upstream branch on gitlab without your patch? |
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
Oh thanks! I am building from git right now using branch v6.2.0-9p-darwin ( |
Any misapplies are all mine, I just copied from git-branches-on-gitlab and patches-on-mailing-list over to regular qemu github... The latest patches (for qemu 7.0) are linked here, think it's up to "v7" now: NixOS/nixpkgs#122420 (originals were from 2018) |
Latest version of the backport branch, updated to the latest v7 patch set, is here: https://gitlab.com/wwcohen/qemu/-/commits/v6.2.0-9p-darwin Note that this still isn't to be considered 100% final. The branch is still subject to change pending any remaining feedback during the upstreaming process. Edit: Patch for the v7 patchset is here: https://github.com/willcohen/qemu/compare/v6.2.0..0024dfc24f88410fe9d85ef8e4a27cbc7283b87a.patch I'll update my branch at https://github.com/willcohen/qemu/tree/v6.2.0-9p-darwin with subsequent versions (v8, etc) as they happen. |
Thanks! I changed my brew formula to use your backport branch, qemu/qemu@v6.2.0...willcohen:0024dfc24f88410fe9d85ef8e4a27cbc7283b87a It still builds an insane number of architectures, so takes "a while" and is a 190M tgz...
|
Thansk @willcohen ! I was successful in building your branch v6.2.0-9p-darwin this morning, using a modifed brew formula (without any patch). (I had a compile error yesterday regarding an undeclared symbol but after a new pull this morning it went away, which is consistent with your comment above). |
I forgot the most important: with podman 4.0.0-dev (also rebuilt this morning) the --volume option works like a charm. But before closing this, I should point out that the podman documentation is only describing the latest unreleased version, which can be confusing to many people, as more and more users are migrating from Docker to podman (at least this is the case in my company). It would be good to be able to switch the documentation from "latest" to the current stable version (3.x). At least it had the nice side-effect of my discovering the new |
The confusing documentation is a known issue: |
Found the issue with the patch, it wasn't renaming the file - which was an issue on darwin, but not on linux. Fixed: https://github.com/afbjorklund/homebrew-core/blob/qemu-9p-darwin/Formula/qemu.rb
Should also work with |
Is this something I need to correct for v9? |
It was just how git creates patches, you need to use
It seems like the failure to rename wasn't fatal on Linux, but did kill the build on Darwin ? |
Did get a build error with the latest version, not sure if I need to update something ?
|
Okay. Will check. The check for the function changed with v8 so I’ll make sure I didn’t mess anything up before I resubmit. Many thanks! |
Oh — quick first question. What version of macOS are you on? |
% sw_vers
ProductName: macOS
ProductVersion: 12.2.1
BuildVersion: 21D62 Compiled (and ran) OK with workaround: diff --git a/os-posix.c b/os-posix.c
index 84be7c74ce..11d04af4fa 100644
--- a/os-posix.c
+++ b/os-posix.c
@@ -347,7 +347,7 @@ int qemu_mknodat(int dirfd, const char *filename, mode_t mode, dev_t dev)
int preserved_errno, err;
if (!pthread_fchdir_np) {
error_report_once("pthread_fchdir_np() is not available on this macOS version");
- return -ENOTSUPP;
+ return -1; // ENOTSUPP;
}
if (pthread_fchdir_np(dirfd) < 0) {
return -1;
But it's a lot smaller with: |
Ah. It's a typo on master versus a patch version. It is supposed to be |
@willcohen was test driving the patch today ... can qemu do anything for us to help with the difference on uid/guid between the mac and the linux vm where the mount is made. |
I’ve seen this mentioned a few places but haven’t fully wrapped my head around it. To my knowledge the uid is just passed through directly. Is the idea here that qemu could reassign the number en route so it looks like one thing on the host and one thing on the guest? Is it always going to be predicable on the coreos side, so that hypothetically it’d be something we’d want to see invoked on the command line when starting up qemu? |
I believe it would be predictable but it is always nice to allow it to be made by entry. |
For existing qemu functionality, the closest thing I can find in https://wiki.qemu.org/Documentation/9psetup is to use I submitted |
@willcohen would you mind providing a link to your v9 submission? |
I tested both the 6.2.0 version and the 7.0.0 (well, "to be") and besides the file rename in the patch and the typo they worked fine. Fixing the qemu formula to cope with these changes was not so hard either, and after that it worked just like the linux version ? system "mv hw/9pfs/9p-util.c hw/9pfs/9p-util-linux.c" unless build.head?
inreplace "os-posix.c", "-ENOTSUPP", "-ENOTSUP" if build.head? I don't think there should be any more unrelated changes done to it, mapping uid and gid sounds like a separate new feature ? It seemed perfectly predictable, the files were owned by nobody (or 501) in the VM and had nice xattr attached on the host: % touch /tmp/podman/foo
% podman run -it -v /mnt/host:/mnt busybox touch /mnt/bar
% ls -l@ /tmp/podman/
total 0
-rw-------@ 1 m1 wheel 0 27 Feb 18:30 bar
user.virtfs.gid 4
user.virtfs.mode 2
user.virtfs.uid 4
-rw-r--r-- 1 m1 wheel 0 27 Feb 18:30 foo
|
Okay. I’ll try to look a little more into this. For what it’s worth, with the v9 patch the ENOTSUP typo shouldn’t be an issue anymore and I think you can remove it from the formula. The typo was in my older version of the branch on top of master, not in upstream HEAD itself. |
@afbjorklund do you know what's wrong with It seems like willcohen/qemu@c99f2b9 should be addressing it just fine. |
Sorry, which error ? Patch didn't understand when both patching and renaming at the same time... So it only did the patching, but left the old file name. Had to help it. Moral: never rename stuff |
The |
Right. Just to confirm, this should mean that it only matters for people running, say, |
Right, normally it would build from a release tarball But it is also some special to how brew runs patch, because if you run
This was why I couldn't reproduce the build failures, had to try it myself using the actual |
I didn't look closer at why it was renamed... But you are right, it doesn't make sense since only
|
@willcohen : it doesn't matter what the value is, the meson.build won't "compile" if the file is missing.
|
Got it -- then I'll tentatively assume that this is a backport-only issue affecting only those applying these generated patches, and it won't be an issue after 6.2. |
It seems to be working now. I installed podman from Brew (my terminal history below)
but later had to tear it down to add the volume with:
Initially the volume did not show on the first boot ...but rebooting the default generated
|
/kind bug
(4.0.0-dev version)
Description
I tested the current 4.0.0-dev version on a Mac using
brew install --head podman
(after unlinking the 3.4.4 version).My objective was to try the forthcoming feature with the option
--volume
. Unfortunately in so doing I encountered the following error:Question: how can I enable virtfs support in qemu? I have the latest stable version of qemu installed via
brew
:Or is there maybe another supported driver than virtfs for macOS that can be passed to
--volume-driver
?Steps to reproduce the issue:
brew install --head podman
podman machine init experimental --volume /Users/foo:/mnt/foo
podman machine start experimental
Output of
podman version
:Output of
podman info --debug
:Cannot be executed due to above issue. However when creating and starting a different machine without the
--volume
option, I get this error (though this might be unrelated to the above and can be ignored for the moment):Any help appreciated on this!
The text was updated successfully, but these errors were encountered: