[libvirt-users] How to change virtfs/9p/v9fs umask

Javi Legido javi at legido.com
Wed Jan 22 17:00:28 UTC 2014

Hi there.

My question is regarding virtfs/9p/v9fs [1], not sure what's the
appropiate name :)

Basically I have a KVM + libvirt server sharing a directory with a
guest in mapped mode.

It works fine, but the only issue is with the file permissions of the
files created by the guest inside the host:

-They are 0700 for dirs and 0400 for files
-The files belongs to the same user that runs the "qemu-system-x86_64"
process, which is "libvirt-qemu"


1. There's a way to change the umask of this user (I'm almost sure
that I already tried this and it didn't worked) or to change any
setting to force the permissions to be wider?

2. It's acceptable to run the "qemu-system-x86_64" as root, and switch
to "passthrough" mode?

Below some details of my environment.

==== Host ====

$ uname -r

$ cat /etc/issue
Debian GNU/Linux jessie/sid \n \l

$ sudo dpkg -l | grep libvirt
ii  libvirt-bin                       1.2.0-2
amd64        programs for the libvirt library
ii  libvirt0                          1.2.0-2
amd64        library for interfacing with different virtualization
ii  python-libvirt                    1.2.0-2
amd64        libvirt Python bindings

$ ps ax | grep vm_name
23307 ?        Sl     0:40 qemu-system-x86_64 -enable-kvm -name
vm_name -S -machine pc-1.1,accel=kvm,usb=off -cpu
-m 1024 -realtime mlock=off -smp 2,sockets=2,cores=1,threads=1 -uuid
2387f160-ffa2-3463-1aa3-771594779df3 -nographic -no-user-config
-nodefaults -chardev
-mon chardev=charmonitor,id=monitor,mode=control -rtc base=utc
-no-shutdown -device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2
-drive file=/dev/vg/lv_vm_name,if=none,id=drive-virtio-disk0,format=raw,cache=none
-device virtio-blk-pci,scsi=off,bus=pci.0,addr=0x5,drive=drive-virtio-disk0,id=virtio-disk0,bootindex=1
-fsdev local,security_model=mapped,id=fsdev-fs0,path=/srv/share
-device virtio-9p-pci,id=fs0,fsdev=fsdev-fs0,mount_tag=virtfs_share,bus=pci.0,addr=0x3
-netdev tap,fd=28,id=hostnet0,vhost=on,vhostfd=29 -device
-chardev pty,id=charserial0 -device
isa-serial,chardev=charserial0,id=serial0 -device usb-tablet,id=input0
-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x7

Guest XML snippet:

    <filesystem type='mount' accessmode='mapped'>
      <source dir='/srv/share/>
      <target dir='virtfs_share'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03'



[1] http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/plain/Documentation/filesystems/9p.txt

More information about the libvirt-users mailing list