Attempting to provision a synced folder by 9p, I find the following error message when creating the machine:
/home/user/.vagrant.d/gems/2.7.4/gems/fog-libvirt-0.9.0/lib/fog/libvirt/requests/compute/vm_action.rb:7:in `create': Call to virDomainCreateWithFlags failed: internal error: qemu unexpectedly closed the monitor: 2022-01-11T13:13:41.684974Z qemu-system-x86_64: -device virtio-9p-pci,id=fs0,fsdev=fsdev-fs0,mount_tag=7570cc6d848c322dd078d6e22d7437c,bus=pci.0,addr=0x5: cannot initialize fsdev 'fsdev-fs0': failed to open '/path/to/share': Permission denied (Libvirt::Error)
The message is proceeded by a long stack trace from Ruby.
Following is the configuration line from the Vagrant
file:
config.vm.synced_folder "/path/to/share", "/srv",
type: "9p", accessmode: "mapped", mount: false
The host directory is owned by the user invoking Vagrant, and the objective is to expose it on the guest as being owned by user vagrant
, with new files creating on either side reflecting the same mapping.
I tested both with mount
enabled and disabled, with no noticeable difference. Frankly, I am confused about the meaning of this value.
The guest is built from debian/bullseye64
. The host is Linux Mint 20.3. All relevant packages on the host are installed from the distribution, except Vagrant itself, which comes from the vendor’s Ubuntu repository, and the plugin, which was added using the plugin
command executed by the user, because the vagrant-libvirt
package from the vendor is not causing the plugin to be detected by Vagrant.