You are not logged in.

#1 2016-07-17 00:35:15

superiorplatypus
Member
Registered: 2016-07-17
Posts: 1

Trying to settup VM will PCI passthrough - Could not access KVM kernel

Hi, I'm trying to setup a PCI passthrough so a Windows guest VM can access my Video Card.

I've done my best to follow the guide. But when it comes time to begin the installation with virt-manager I run into an error.

I can't find the error I'm encountering in the guide, or online.

Unable to complete install: 'internal error: process exited while connecting to monitor: Could not access KVM kernel module: Permission denied
failed to initialize KVM: Permission denied'

Traceback (most recent call last):
  File "/usr/share/virt-manager/virtManager/asyncjob.py", line 88, in cb_wrapper
    callback(asyncjob, *args, **kwargs)
  File "/usr/share/virt-manager/virtManager/create.py", line 2288, in _do_async_install
    guest.start_install(meter=meter)
  File "/usr/share/virt-manager/virtinst/guest.py", line 461, in start_install
    doboot, transient)
  File "/usr/share/virt-manager/virtinst/guest.py", line 396, in _create_guest
    self.domain = self.conn.createXML(install_xml or final_xml, 0)
  File "/usr/lib/python2.7/site-packages/libvirt.py", line 3777, in createXML
    if ret is None:raise libvirtError('virDomainCreateXML() failed', conn=self)
libvirtError: internal error: process exited while connecting to monitor: Could not access KVM kernel module: Permission denied
failed to initialize KVM: Permission denied

P.S. Is there a way to format code in this forum?

Last edited by superiorplatypus (2016-07-17 00:36:13)

Offline

#2 2016-07-29 23:17:42

tanders12
Member
Registered: 2010-12-17
Posts: 13

Re: Trying to settup VM will PCI passthrough - Could not access KVM kernel

I'm having the same problem. So far I haven't been able to find a solution. Are you a member of the kvm group and does that group have read/write permissions for /dev/kvm?

Offline

#3 2017-08-04 00:15:34

s4Ne
Member
Registered: 2017-08-04
Posts: 3

Re: Trying to settup VM will PCI passthrough - Could not access KVM kernel

The last time I used libvirt it worked out of the box. Now I'm stuck at the exact same problem. Any advice?

@OP: yes, use BB Tags [code.] and [/code.], but remove the dots.

EDIT:
After further investigation I found this forum thread.
They are mentioning a file called /etc/udev/rules.d/65-kvm.rules. Seems to be missing on my system.

Last edited by s4Ne (2017-08-04 00:21:13)

Offline

#4 2017-08-04 00:19:32

loqs
Member
Registered: 2014-03-06
Posts: 13,466

Re: Trying to settup VM will PCI passthrough - Could not access KVM kernel

@s4Ne I suspect your issue will have a different cause.
What is the output of

$ getent group kvm

Offline

#5 2017-08-04 00:22:57

s4Ne
Member
Registered: 2017-08-04
Posts: 3

Re: Trying to settup VM will PCI passthrough - Could not access KVM kernel

@loqs:

$ getent group kvm
kvm:x:999:s4ne

Just realized that we are in 2017... sorry for reviving this old thread.

Last edited by s4Ne (2017-08-04 00:24:31)

Offline

#6 2017-08-04 00:27:54

loqs
Member
Registered: 2014-03-06
Posts: 13,466

Re: Trying to settup VM will PCI passthrough - Could not access KVM kernel

https://bugs.archlinux.org/task/54943
kvm is expected to have gid 78 but systemd 234 gives it a dynamic id or other patches need to be applied to deal with kvm not having that gid.
Also because the issue is caused by a change in systemd 234 it could not have been the cause of the superiorplatypus issue in 2016 due to 234's recent release.

Offline

#7 2017-08-04 00:38:31

s4Ne
Member
Registered: 2017-08-04
Posts: 3

Re: Trying to settup VM will PCI passthrough - Could not access KVM kernel

Thanks for helping me out, I hope they will fix it soon...

Offline

#8 2017-08-09 13:05:31

marmistrz
Member
Registered: 2016-01-05
Posts: 108

Re: Trying to settup VM will PCI passthrough - Could not access KVM kernel

I tried what was suggested in the issue, but had no luck.

chown -R 0:kvm /var/lib/libvirt/qemu doesn't persist after a reboot.
Commenting out the kvm group in basic.conf doesn't help.

When using the default CPU configuration I get

Unable to complete install: 'unsupported configuration: CPU mode 'custom' for x86_64 kvm domain on x86_64 host is not supported by hypervisor'

When I enabled "Copy host CPU configuration"

 Unable to complete install: 'internal error: process exited while connecting to monitor: 2017-08-09T13:03:38.002488Z qemu-system-x86_64: -object secret,id=masterKey0,format=raw,file=/var/lib/libvirt/qemu/domain-4-generic/master-key.aes: Unable to read /var/lib/libvirt/qemu/domain-4-generic/master-key.aes: Failed to open file “/var/lib/libvirt/qemu/domain-4-generic/master-key.aes”: Permission denied'

Do you have any ideas what I'm doing wrong?

Offline

#9 2017-08-09 15:49:23

loqs
Member
Registered: 2014-03-06
Posts: 13,466

Re: Trying to settup VM will PCI passthrough - Could not access KVM kernel

I would suggest changing group=78 to group=kvm in /etc/libvirt/qemu.conf or change the gid of the kvm group to 78 in /etc/group and rerun the chown command.

Offline

#10 2017-08-10 08:55:22

marmistrz
Member
Registered: 2016-01-05
Posts: 108

Re: Trying to settup VM will PCI passthrough - Could not access KVM kernel

Thanks, it did the trick!

Offline

#11 2017-08-10 15:07:06

loqs
Member
Registered: 2014-03-06
Posts: 13,466

Re: Trying to settup VM will PCI passthrough - Could not access KVM kernel

marmistrz wrote:

Thanks, it did the trick!

Which suggestion worked for you?

Offline

#12 2017-09-07 01:29:12

chr0mag
Member
Registered: 2017-02-02
Posts: 91

Re: Trying to settup VM will PCI passthrough - Could not access KVM kernel

loqs wrote:
marmistrz wrote:

Thanks, it did the trick!

Which suggestion worked for you?

Recently encountered this bug as well. Changing group=78 to group=kvm in /etc/libvirt/qemu.conf worked for me.

Offline

Board footer

Powered by FluxBB