[vfio-users] permission denied on /dev/vfio/1 gpu passthrough kvm

Tiago Seco tiago.seco at gmail.com
Thu Jan 4 10:22:18 UTC 2018


Hello,

I had initially posted this on the gentoo forums, but since the thread
is getting little traction, perhaps here is a better place to ask the
question:

I'm trying to achieve PCI-express GPU passthrough to a Window 10 VM,
however, when trying to start the virtual machine (as root) with the
hardware attached, this is what I get:

virsh # start win10-clone
error: Failed to start domain win10-clone
error: internal error: process exited while connecting to monitor:
2018-01-03T16:58:47.761436Z qemu-system-x86_64: -chardev
pty,id=charserial0: char device redirected to /dev/pts/4 (label
charserial0)
2018-01-03T16:58:47.786124Z qemu-system-x86_64: -device
vfio-pci,host=01:00.0,id=hostdev0,bus=pci.0,addr=0x2: vfio error:
0000:01:00.0: failed to open /dev/vfio/1: Permission denied


The file however, exists:

# file /dev/vfio/1
/dev/vfio/1: character special (250/0)
# ls -l /dev/vfio/1
crw------- 1 root root 250, 0 Jan  3 16:51 /dev/vfio/1


I followed the steps detailed in
https://wiki.installgentoo.com/index.php/PCI_passthrough for host
preparation, and in
https://wiki.archlinux.org/index.php/PCI_passthrough_via_OVMF#Setting_up_the_guest_OS
for setting up the guest.

Before running virsh, I:

/etc/init.d/libvirtd stop
/etc/init.d/libvirt-guests stop
./vfio-bind 0000:01:00.0 0000:01:00.1
/etc/init.d/libvirtd start
/etc/init.d/libvirt-guests start


I've tried playing around with /etc/libvirt/qemu.conf, namely with the
"group", "user", and "dynamic_ownership" settings - even though I'm
running everything as root - and with "cgroup_device_acl" (by adding
"/dev/vfio/1" to the list).
I cannot figure out what the problem in my setup is or what to try
next. Is there anyone that can shine some light on this?


System information, scripts used, and qemu USE flags can be found
here: https://pastebin.com/XuGtDmSm

Thank you!




More information about the vfio-users mailing list