刘梦可
2016-Oct-27 03:50 UTC
[libvirt-users] command guest-file-open failed to open file - Permission denied
hello, I am using libvirt 1.2.17 on CentOS 7.2 - kernel 3.10.0-327.13.1.el7.x86_64. The command guest-file-open failed to open file with error "Permission denied", the detail is as below: virsh qemu-agent-command instance-00000a9c '{"execute":"guest-file-open", "arguments":{"path":"/home/centos/test","mode":"r"}}' error: internal error: unable to execute QEMU agent command 'guest-file-open': failed to open file '/home/centos/test' (mode: 'r'): Permission denied In the guest, the file '/home/centos/test' exist and the access permissions is 777 as below: -rwxrwxrwx. 1 centos centos 18 Oct 27 11:16 test How can I fix it? Thanks very much!!! -mkliu28
Michal Privoznik
2016-Oct-30 21:25 UTC
Re: [libvirt-users] command guest-file-open failed to open file - Permission denied
On 27.10.2016 11:50, 刘梦可 wrote:> hello, > > I am using libvirt 1.2.17 on CentOS 7.2 - kernel > 3.10.0-327.13.1.el7.x86_64. The command guest-file-open failed to open > file with error "Permission denied", the detail is as below: > > virsh qemu-agent-command instance-00000a9c > '{"execute":"guest-file-open", > "arguments":{"path":"/home/centos/test","mode":"r"}}' > error: internal error: unable to execute QEMU agent command > 'guest-file-open': failed to open file '/home/centos/test' (mode: > 'r'): Permission denied > > In the guest, the file '/home/centos/test' exist and the access > permissions is 777 as below: > -rwxrwxrwx. 1 centos centos 18 Oct 27 11:16 testThis is likely denied because of SELinux. You can check audit log to confirm that. To fix this you need to change the label on the file and to do that properly you need to add a rule. Michal