[xenial] No write access to VirtFS (9p) in qemu VM run by libvirt
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
libvirt (Ubuntu) |
Fix Released
|
High
|
Unassigned | ||
Xenial |
Confirmed
|
High
|
Unassigned |
Bug Description
Using virt-manager and libvirtd, I added a VirtFS filesystem passthrough to an existing qemu virtual machine also running Ubuntu.
The XML code generated by libvirt looks like this:
<filesystem type='mount' accessmode=
<source dir='/p9test'/>
<target dir='p9_mapped'/>
<alias name='fs0'/>
<address type='pci' domain='0x0000' bus='0x02' slot='0x06' function='0x0'/>
</filesystem>
Inside the VM, I am able to mount the filesystem passthrough like this:
mount -t 9p -o trans=virtio,
After mounting, it is possible to read the contents of the passthrough, but it is not possible to write into the directory. E.g. 'touch /mnt/test' results in the error:
touch: cannot touch ‘/mnt/test’: Permission denied
Using the other p9 access modes 'passthrough' and 'squash' also does not work. Read is possible, write isn't.
ProblemType: Bug
DistroRelease: Ubuntu 16.04
Package: libvirt-bin 1.3.1-1ubuntu6
ProcVersionSign
Uname: Linux 4.4.0-13-generic x86_64
ApportVersion: 2.20-0ubuntu3
Architecture: amd64
CurrentDesktop: Unity
Date: Fri Mar 18 22:12:34 2016
SourcePackage: libvirt
UpgradeStatus: Upgraded to xenial on 2016-02-06 (41 days ago)
modified.
modified.
tags: |
added: 9p removed: p9 |
summary: |
- [xenial] No write access to VirtFS (p9) in qemu VM run by libvirt + [xenial] No write access to VirtFS (9p) in qemu VM run by libvirt |
Changed in libvirt (Ubuntu): | |
importance: | Undecided → Medium |
Thanks for reporting this bug.
Who is /mnt/test owned by? what do
ls -ld /mnt/test
ls -l /mnt/test
show? Libvirt launches qemu as the libvirt-qemu user, which is permissions of the shared directory qemu.conf
probably not allowed to create files there. If that is the case, then
ou can either change the ownership/
or change the user which qemu runs as, which is specified in
/etc/libvirt/