elbarna
elbarna

Reputation: 771

libvirt and spice opengl..no way?

I want to run opengl with spice on libvirt/qemu

I'm on slackware 14.2,libvirt is latest 3.8 and qemu is latest 2.10

I have edit those files

/etc/libvirt/qemu.conf

cgroup_device_acl = [
     "/dev/dri/renderD128"
]




 /etc/cgrules.conf

<video>
  <model type='virtio' heads='1' primary='yes'>
    <acceleration accel3d='yes'/>
  </model>
</video>

I'm on group video,and permission are ok I think

 ls -lhd /dev/dri/*
crw-rw----+ 1 root video 226,   0 ott 15 18:39 /dev/dri/card0
crw-rw----  1 root video 226, 128 ott 15 18:39 /dev/dri/renderD128

Machine is configured to run with gl

but when I start...

LANG=C virsh start pol64
error: Failed to start domain pol64
error: internal error: process exited while connecting to monitor: Could not access KVM kernel module: Operation not permitted
2017-10-15T18:00:13.714865Z qemu-kvm: failed to initialize KVM: Operation not permitted

Of course cgmanager and libvirt were restarted

Upvotes: 0

Views: 3532

Answers (1)

elbarna
elbarna

Reputation: 771

Solution found. First..wich user run qemu? In my configuration is "qemu". In my case we have to add the qemu user to video group(video group own the dri/drm device)

sudo usermod -aG video qemu
getfacl /dev/dri/renderD128

# file: dev/dri/renderD128
# owner: root
# group: video
user::rw-
group::rw-
other::---

Then we have to edit /etc/libvirt/qemu.conf and add or modify the acl

cgroup_device_acl = [
    "/dev/null", "/dev/full", "/dev/zero",
    "/dev/random", "/dev/urandom",
    "/dev/ptmx", "/dev/kvm", "/dev/kqemu",
    "/dev/rtc","/dev/hpet", "/dev/vfio/vfio",
    "/dev/dri/renderD128"
]

Then restart libvirt

/etc/rc.d/rc.libvirt restart

The vm must be configured with spice,dri device(do not select auto) and opengl,the opengl works only with "local" configuration,so no tls/server.

Upvotes: 1

Related Questions