SPICE support in Xen
SPICE is a protocol for virtual desktops which allows a much richer connection than display-only protocols like VNC.
Xen 4.4
Xen Project 4.4 adds support for additional SPICE functionality, including vdagent, clipboard sharing, and USB redirection.
The following notes were added to the wiki on request of Fabio Fantoni, who added most of the SPICE support to Xen
Restrictions
The SPICE [protocol is currently only supported on HVM guests.
QEMU Upstream
To use SPICE you will need an upstream version of qemu built with SPICE support enabled. In many cases, you may be able to use upstream qemu packages from Linux distributions (recent Debian, Ubuntu, etc. will work) : these have SPICE support already built-in.
Alternatively, can compile upstream qemu from the xen source tree. However, you will need to apply a small patch to enable SPICE and USB Redirection to the build parameters. See:
> tools/Makefile > @@ -201,6 +201,8 @@ subdir-all-qemu-xen-dir: qemu-xen-dir-find > --datadir=$(SHAREDIR)/qemu-xen \ > --localstatedir=/var \ > --disable-kvm \ > + --enable-spice \ > + --enable-usb-redir \ > --disable-docs \ > --disable-guest-agent \ > --python=$(PYTHON) \
XL Configuration
You can use XL configuration parameters to enable SPICE support and control its advanced functions. Please check man xl.cfg or check out xl.cfg(5).
Know Problems
- Linux domUs with recent kernel need pci=nomsi set for kernel boot parameters to ensure that vdagent is working. This is a know problem with virtio devices on Xen which has not yet been solved. All other cases and things works out of box based on my tests. We are not entirely sure which kernel versions are affected, except that kernel >= 3.2 exhibits the problem, while kernel <= 2.6.32 does not. -Feel free to update this section if you have more accurate information.
Ongoing work
Work on the following patches to improve SPICE support and integration in Xen is ongoing:
- qxl vga (libxl patch complete and seems good but qxl is not working because other changes are needed on xen and/or qemu)
- Basic SPICE support on PV guests (patch is working but needs serious improvements)
- Add SPICE parameters to xenstore and handle those acquired with qmp (only the qmp part is currently working)
- Automatic SPICE port selection similar to the support available in VNC (blocked, awaiting reply from qemu community)
The latest work in progress and discussions can be found on xen-devel and any patches (including partial and drafts) can be found on Fabio Fantoni's github repository.