support spice

Bug #903962 reported by Serge Hallyn
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
libvirt (Ubuntu)
Fix Released
Medium
Unassigned

Bug Description

Now that precise has qemu-kvm-spice in universe, it would be nice to be able to use spice with libvirt.

To do so, I had to do a few things:

1. rm /usr/bin/kvm; ln -s /usr/bin/qemu-system-x86_64-spice /usr/bin/kvm

2. add to /etc/apparmor.d/abstractions/libvirt-qemu the lines:

     /usr/bin/qemu-system-i386-spice rmix,
     /usr/bin/qemu-system-x86_64-spice rmix,
     /run/shm/spice.* rwixm,
     /run/shm rw,

3. Edited the graphics and vga sections of a libvirt VM's .xml to read:

    <graphics type='spice' port='5900' tlsPort='-1' autoport='yes'/>
    <video>
      <model type='qxl' vram='65536' heads='1'/>
      <alias name='video0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
    </video>

Tags: patch

Related branches

Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

The apparmor modification seems fine to go ahead and make and ship with libvirt. Jamie/John, could you comment if you disagree? The xml modification will probably beg for virt-manager update later on.

But as for /usr/bin/kvm. Should the qemu-kvm-package override the /usr/bin/kvm symlink from qemu-kvm (even though qemu-kvm is in main and qemu-kvm-spice in universe)? How would that work?

Changed in libvirt (Ubuntu):
importance: Undecided → Medium
status: New → Confirmed
Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

I think qemu-kvm and qemu-kvm-spice should update-alternatives to provide /usr/bin/kvm.

Revision history for this message
Jamie Strandboge (jdstrand) wrote :

These changes seem fine:
     /usr/bin/qemu-system-i386-spice rmix,
     /usr/bin/qemu-system-x86_64-spice rmix,

This is not correct:
     /run/shm rw,

It should perhaps be:
     /run/shm/ r,

This one concerns me:
     /run/shm/spice.* rwixm,

It should at a minimum be this:
     owner /run/shm/spice.* rwixm,

But the bigger question is why are we giving execute permissions to something we are allowing writes to? This is not ideal.

Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

Thanks, Jamie, I don't recall whether I added those because syslog said I needed it, or whether I threw in all that I thought I might need.

Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

For getting libvirt to call kvm-spice, one simple way would be to patch src/qemu/qemu_capabilities.c at qemuCapsInitGuest() so that kvm_bins adds "kvm-spice" before "kvm".

Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

With this patch attached, and using the xml definition in http://people.canonical.com/~serge/spice.xml , I was able to use spice through libvirt with the qemu-kvm-spice package installed.

Jamie, I'm temporarily assigning this to you to vet my changes one more time. (Note that in my last upload I inadvertently added the /run/shm/spice permission without 'owner' prepended after all!).

Changed in libvirt (Ubuntu):
assignee: nobody → Jamie Strandboge (jdstrand)
tags: added: patch
Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

Then again, as it follows the recommendations in comment #3, I'll go ahead and push. Sorry for the noise.

Changed in libvirt (Ubuntu):
assignee: Jamie Strandboge (jdstrand) → nobody
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package libvirt - 0.9.7-2ubuntu12

---------------
libvirt (0.9.7-2ubuntu12) precise; urgency=low

  * enable use of libvirt with kvm-spice (LP: #903962):
    . src/qemu/qemu_capabilities.c: search for 'kvm-spice' before
      'kvm' (debian/patches/ubuntu/enable-kvm-spice.patch)
    . debian/apparmor/libvirt-qemu:
      * prepend 'owner' to /run/shm/spice.* rule
      * add more needed spice perms
  * move cgroup-lite | cgroup-bin to depends, now that cgroup-lite is in
    main.
 -- Serge Hallyn <email address hidden> Tue, 10 Jan 2012 12:06:13 +0100

Changed in libvirt (Ubuntu):
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.