I have setup a qemu Linux guest using virt-manager. I have mounted a host path successfully. The libvirt configuration snippet on the host:

<filesystem type='mount' accessmode='mapped'>
  <source dir='/home/robert/Documents/sources/oss/linux'/>
  <target dir='/linux-src'/>
  <address type='pci' domain='0x0000' bus='0x00' slot='0x08' function='0x0'/>

The fstab line on the guest:

/linux-src /mnt/linux-src 9p defaults 0 0

Accessing and reading works fine, but I'm unable to write to that directory

$ cd /mnt/linux-src
$ touch asd
$ touch: cannot touch 'asd': Permission denied

I am running as the root user in the guest and the files belong to my user (robert) on the host.

What can I do to allow write access to that folder from the guest?

  • have you tried accessmode passthrough ?
    – magor
    Jun 20, 2017 at 9:13
  • 1
    @mazs - using accessmode='passthrough' brings the same result Jun 20, 2017 at 9:21

1 Answer 1


Give the libvirt-qemu group write access on the host:

chgrp libvirt-qemu /home/robert/Documents/sources/oss/linux
chmod -R g+w /home/robert/Documents/sources/oss/linux
  • This kinda works, but (at least for me) the files created from within the guest are now owned by group and user libvirt-qemu in the host, instead of user robert. Aug 6, 2018 at 15:29

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .