Bug 857358
| Summary: | [virtFS]commands "ls" got Permission denied in guest's virtFS directory | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | [Community] Virtualization Tools | Reporter: | Xu Wang <xuwan> | ||||||||||
| Component: | libvirt | Assignee: | Libvirt Maintainers <libvirt-maint> | ||||||||||
| Status: | CLOSED WORKSFORME | QA Contact: | |||||||||||
| Severity: | medium | Docs Contact: | |||||||||||
| Priority: | medium | ||||||||||||
| Version: | unspecified | CC: | crobinso, cshastri, cwei, dyuan, gsun, miurahr, mjenner, mzhan, pzhang, rbalakri, zpeng | ||||||||||
| Target Milestone: | --- | ||||||||||||
| Target Release: | --- | ||||||||||||
| Hardware: | x86_64 | ||||||||||||
| OS: | Linux | ||||||||||||
| Whiteboard: | |||||||||||||
| Fixed In Version: | Doc Type: | Bug Fix | |||||||||||
| Doc Text: | Story Points: | --- | |||||||||||
| Clone Of: | Environment: | ||||||||||||
| Last Closed: | 2016-03-23 22:41:19 UTC | Type: | Bug | ||||||||||
| Regression: | --- | Mount Type: | --- | ||||||||||
| Documentation: | --- | CRM: | |||||||||||
| Verified Versions: | Category: | --- | |||||||||||
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||||||||
| Cloudforms Team: | --- | Target Upstream Version: | |||||||||||
| Embargoed: | |||||||||||||
| Attachments: |
|
||||||||||||
|
Description
Xu Wang
2012-09-14 08:26:06 UTC
Created attachment 612773 [details]
libvirt log
Created attachment 612774 [details]
qemu log of guest p9fs
Created attachment 612775 [details]
operations in guest
(In reply to comment #0) > libvirt-0.10.1-2.el6.x86_64 > qemu-stable-1.0.git Please reproduce with a Red Hat qemu binary. RHEL qemu-kvm doesn't support 9pfs yet, move to upstream component. This bug has been moved to upstream component. Host and Guest Kernel : 3.9.5-301.fc19.x86_64
libvirtd --version
libvirtd (libvirt) 1.1.1
qemu-system-x86_64 --version
QEMU emulator version 1.5.91, Copyright (c) 2003-2008 Fabrice Bellard
This issue is also seen on the Upstream Libvirt commit a7f94a40bb2554c56d0c6bea98a5843690dc3933.
If we mount the virtfs in the guest and try to cat some of the files from the host directory then it throws error as permission denied.
But, if we boot the guest with qemu (commit b9ac5d923b820a0f0152a2df56067e55ce34f487) then it works fine.
xml:
----
<domain type='kvm'>
<name>Fedora19</name>
<uuid>6cede796-e295-294e-5198-37448a5fe057</uuid>
<memory unit='KiB'>3072000</memory>
<currentMemory unit='KiB'>3072000</currentMemory>
<vcpu placement='static'>1</vcpu>
<os>
<type arch='x86_64' machine='pc-i440fx-1.6'>hvm</type>
<boot dev='hd'/>
</os>
<features>
<acpi/>
<apic/>
<pae/>
</features>
<clock offset='utc'/>
<on_poweroff>destroy</on_poweroff>
<on_reboot>restart</on_reboot>
<on_crash>restart</on_crash>
<devices>
<emulator>/usr/bin/qemu-system-x86_64</emulator>
<disk type='file' device='disk'>
<driver name='qemu' type='qcow2' cache='none'/>
<source file='/var/lib/libvirt/images/Fedora19.qcow2'/>
<target dev='vda' bus='virtio'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
</disk>
<disk type='block' device='cdrom'>
<driver name='qemu' type='raw'/>
<target dev='hdc' bus='ide'/>
<readonly/>
<address type='drive' controller='0' bus='1' target='0' unit='0'/>
</disk>
<controller type='usb' index='0'>
<address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
</controller>
<controller type='pci' index='0' model='pci-root'/>
<controller type='ide' index='0'>
<address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
</controller>
<filesystem type='mount' accessmode='passthrough'>
<source dir='/tmp'/>
<target dir='file'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>
</filesystem>
<interface type='network'>
<mac address='52:54:00:80:3c:03'/>
<source network='default'/>
<model type='rtl8139'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
</interface>
<serial type='pty'>
<target port='0'/>
</serial>
<console type='pty'>
<target type='serial' port='0'/>
</console>
<input type='mouse' bus='ps2'/>
<graphics type='vnc' port='-1' autoport='yes'/>
<video>
<model type='vga' vram='9216' heads='1'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
</video>
<memballoon model='virtio'>
<address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
</memballoon>
</devices>
</domain>
There is a work around for it. When a host directory to be shared is `/share` , running following command on host makes things working. ```bash sudo semanage fcontext -a -t virt_content_t "/share(/.*)?" sudo restorecon -R /share ``` IMO it is neccesary to fix /* XXX fixme process def->fss if relabel == true */ part of src/security/security_selinux.c Closing due to workaround in Comment #10 |