I have a macOS VM mostly working on my Ubuntu laptop using libvirt and virtual-machine-manager -- no sound and it's slow as hell, but I'm just using it to run XCode builds for Capacitor and Godot projects, so it's good enough.
But I needed a way to share a folder of files from the Ubuntu host to the guest. For Capacitor, doing Git pushes and pulls on the two systems isn't terrible, but for Godot that's not really a workable practice since the XCode project is exported, not part of the repo.
I found various tutorials but most were missing one thing or the other, so nothing worked. I finally pieced it together so here's what I did.
In VMM go into the VM's settings and under Memory, enable shared memory. Apply that, then at the bottom click "Add Hardware" and add a "Filesystem". Use the Browse Local button to point to a folder in the host OS (the path goes in the "Source path" field). Then enter an identifier in "Target path" -- this is not actually a path, just an identifier. It can be anything, but I used a URL-safe name ("mac-share" in my case) figuring spaces and such might be a problem.
Then change the Driver to "virtio-9p" -- this is the important thing for a macOS guest. For other guest OSs you want just "virtio-fs" but for macOS it needs to be "virtio-9p".
Then boot the VM and open Terminal and enter:
sudo mount_9p mac-share
Now you can access the volume "mac-share" in ~/Volumes/mac-share
It's read-only though, which is better than nothing but not ideal. I don't know if this is solvable -- mount_9p on mac only has one option, -r, which makes the volume read-only. But I'm not using that...