1

I have problem getting my VM running via libvirt. Here is my setup:

  • I put my qcow2 image and domain XML (named win7.xml) under $HOME/vm, with all files and directories using my user, my group, and permission bits 0644.

  • I uncommented user = "root", group = "root" and dynamic_ownership = 1 lines in /etc/libvirt/qemu.conf, expecting qemu-system-x86_64 will run as root, therefore having full access to the dirs and files under $HOME/vm.

However, invocation of virsh create win7.xml as root was failed:

error: Failed to create domain from win7.xml
error: internal error: early end of file from monitor, possible problem: 2016-10-01T03:36:02.049418Z qemu-system-x86_64: -drive file=/home/naitree/vm/win7/win7.qcow2,format=qcow2,if=none,id=drive-virtio-disk0: Could not open '/home/naitree/vm/win7/win7.qcow2': Permission denied

The following error was logged in /var/log/libvirt/qemu/win7.log:

2016-10-01T03:36:02.049418Z qemu-system-x86_64: -drive file=/home/naitree/vm/win7/win7.qcow2,format=qcow2,if=none,id=drive-virtio-disk0: Could not open '/home/naitree/vm/win7/win7.qcow2': Permission denied
2016-10-01 03:36:02.080+0000: shutting down

It looks like qemu failed to access my VM disk file. But why? Didn't qemu-system-x86_64 run as root? What should be done to make sure libvirt-qemu able to access the disk image residing in $HOME directory?

Additional version informations:

  • libvirt, virsh version: 1.3.3.2
  • QEMU version: QEMU emulator version 2.6.1 (qemu-2.6.1-1.fc24)
  • distro: Fedora 24
  • kernel: 4.7.4-200.fc24.x86_64

2 Answers 2

1

You are most likely being blocked by Selinux, check your /var/log/audit.log

0

Try to give qemu user/group permissions to execute your homedir

setfacl -m u:qemu:--x $HOME

You must log in to answer this question.

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