3

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'/>
</filesystem>

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 ? – mazs Jun 20 '17 at 9:13
  • 1
    @mazs - using accessmode='passthrough' brings the same result – Robert Munteanu Jun 20 '17 at 9:21
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. – digitalarbeiter Aug 6 '18 at 15:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.