vagrant-kvm
vagrant-kvm copied to clipboard
p9share: guest/host permissions
qemu's virtfs has a difficulty in host/guest owner/group and permissions.
It has three access modes.
1 mapped: Files are created with Qemu user credentials and the client-user's credentials are saved in extended attributes. 2 passthrough: Files on the filesystem are directly created with client-user's credentials. 3 none: It is equivalent to passthrough security model; the only exception is, failure of priviliged operation like chown are ignored. This makes a passthrough like security model usable for people who run kvm as non root.
In default, 'none' aka. 'squash' in configuration.
for squash, user need to take care of owner's and permissions both guest credentials and host qemu's uid/gid. Files and directories should be permitted to r/w for qemu(eg. libvirt-qemu/kvm) and guest(eg. vagrant/vagrant) in Ubuntu.
Need document.
Currently on Fedora 20, I have read only access to the shared directory, I don't know if it's what we want, but we need to document it.
In recent Operating system, qemu/kvm run in its special user: libvirt-qemu or similar user. p9 shared folders are often owned by normal user. It happens that qemu cannot write shared folder because of owner mismatch. libvirt-qemu user cannot write in a directory owned by normal user that permission is usually 755, or 775.