spice

Notes from a kubuntu user

The notes that were here have been expanded and moved to:

http://azertech.net/spice111

Thanks again for your excellent service! --Sam

original text from package maintainer

We are currently pushing the packages needed for spice-enabled qemu from ppa:serge-hallyn/spice2.
However, there are newer spice packages upstream, and packages of them at https://launchpad.net/~bderzhavets/+archive/spice-7/.

1. Packages from this PPA are supposed to work only on 64-bit boxes (amd64)

Original tar ball was built based on compressing "qemu-kvm" folder been obtained via git clone git://git.kernel.org/pub/scm/virt/kvm/qemu-kvm.git.

Due to date of clonning git branch - May 18 2011 master branch has been already patched.

Thus debian build based on any snapshot of upstream QEMU-KVM later then 05/03/2011 doesn't require original four Fedora 15 "QXL" patches. Just debian/rules fragment running ./configure must include "--enable-spice". No more changes for files in debian folder of standard QEMU-KVM packages build are required. The most recent build is Release 0.15.0 (08/10/2011) of spice enabled qemu-kvm packages has been done in PPAs https://launchpad.net/~bderzhavets/+archive/spice-7/ and https://launchpad.net/~bderzhavets/+archive/qemu-git

$ git clone git://git.kernel.org/pub/scm/virt/kvm/qemu-kvm.git
$ cd qemu-kvm
$ git checkout -b stable-0.15 origin/stable-0.15
$ cd ..

Copy to building directory:

$ cp -R qemu-kvm ../BUILD/qemu-kvm-mmddyy

Current status of branch stable-0.15 may be viewed here :- http://git.kernel.org/?p=virt/kvm/qemu-kvm.git;a=shortlog;h=refs/heads/stable-0.15

Upstream patches related to the feature : http://git.kernel.org/?p=virt/kvm/qemu-kvm.git;a=search;h=refs/heads/stable-0.15;s=Gerd+Hoffmann;st=author

2011-05-03

spice: drop obsolete iothread locking

2011-05-03

spice: don't call displaystate callbacks from spice...

2011-05-03

spice: don't create updates in spice server context.

For Natty the best source for qemu-kvm-spice build is probably http://cgit.freedesktop.org/spice/qemu/log/?h=qemu-kvm-0.14.0-spice.

View http://lists.freedesktop.org/archives/spice-commits/2011-May/000636.html.

Debian build based on mentioned above git tree is in PPA https://launchpad.net/~bderzhavets/+archive/spice2

2. Spice-Gtk-0.7 (released on 07/18/11) has been done for Oneiric as two builds. First one with python, gobject-introspection enabled and --with-gtk="2.0"(GTK2). Second one --with-introspection and --with-gtk="3.0"(GTK3).

This builds actually are the core builds in PPA, which bring RH’s technologies to Ubuntu 11.10.

Notice, that option --with-audio=”pulse” is also used by both builds and appears to be working fine.

View in PPA https://launchpad.net/~bderzhavets/+archive/spice-7/+packages

Build with GTK2 : spice-gtk-0.7.1-1ubuntu9

Built packages

  • libspice-client Spice GTK+ Library , libspice-client-dev Spice GTK+ Library (development files)

Build with GTK3 : spice-gtk3-0.7.1-1ubuntu4

Built packages

  • libspicegtk3-client Spice GTK+ Library , libspicegtk3-client-dev Spice GTK+ Library (development files) , spicegtk3-client Virtual Desktop Interface Client using the Spice Protocol

Build spice-gtk3-0.7.1-1ubuntu4 depends on libspice-client.

Both builds have been tested to install (with no conflicts) via Synaptic Manager and to work on Ubuntu 11.10 alpha3. Corresponding Qemu-kvm (spice enabled) build was based on branch stable-0.15 of git.kernel.org/pub/scm/virt/kvm/qemu-kvm.git tree as of 08/10/11.

Install software from PPA :-

$ sudo apt-add-repository ppa:bderzhavets/spice-7
$ sudo apt-get update
$ sudo apt-get install qemu-kvm qemu qemu-common \
libspice-client libspice-client-dev \
libspicegtk3-client libspicegtk3-client-dev \
spice libspice-protocol-dev spicegtk3-client

To install Libvirt and virtinst related tools

$ sudo apt-get install virtinst virt-viewer virt-manager

The most recent version of stable Spice Server 0.8.2 has been uploaded to https://launchpad.net/~bderzhavets/+archive/qemu-git https://launchpad.net/~bderzhavets/+archive/spice-7

********************
Please be aware
********************
(A) Switching to QXL in VirtManager 0.9.0 automatically allocates 64M vram for QXL videomode
virsh dumpxml VF15 shows :-
<video>
<model type='qxl' vram='65536' heads='1'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
</video>
It doesn't work, giving just black screen.
Update XML profile as follows
<video>
<model type='qxl' vram='32768' heads='1'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
</video>
Now
# virsh delete VF15
# virsh define VF15-new.xml
It allows VF15 to behave normal in Spice VM's session
Would you have any problems with X-Server after redefining the domain, restart VirtManager.
At least it works for me in meantime.
*********************************************************************************************
As of 08/13/11 patched version of Oneiric's Libvirt allocating by default
32M vram for QXL device uploaded to PPAs https://launchpad.net/~bderzhavets/+archive/qemu-git
and https://launchpad.net/~bderzhavets/+archive/spice-7

Now installs and runtime may be run via Spice sessions in QXL video mode via VirtManager 0.9.0 and
via spicec. XML updates using virsh commands are no longer required.
Please be advised, that QXL virtual video device works only for Spice sessions.
It doesn't affect your your VNC sessions. Patch has been done to Libvirt change the only one thing
amount of VRAM (decrease 64M to 32M) allocated for QXL device in Spice session.
**********************************************************************************************
Would you have problem with adding my PPAs , like this :-
Executing: gpg --ignore-time-conflict --no-options --no-default-keyring --secret-keyring /tmp/tmp.CuZyZy4MSK
--trustdb-name /etc/apt/trustdb.gpg --keyring /etc/apt/trusted.gpg --primary-keyring /etc/apt/trusted.gpg --keyserver hkp://keyserver.ubuntu.com:80/ --recv 5
gpg: "5" not a key ID: skipping
Run "sudo apt-get update" . It will show you value of PUBLIC KEY to be imported . Then run :
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys XXXXXXXXXXXXXXX
XXXXXXXXXXXXXX is a value been shown by "apt-get update" on your box
sudo apt-get update
*******************************************************************************************
Debian Unstable Spice Server (been built with embedded libcelt051) has been
ported to Ubuntu 11.10.
Debian Unstable version of Spice-Gtk-0.7 has been ported to Ubuntu 11.10 (08/20/11).
dget -x http://mentors.debian.net/debian/pool/main/s/spice-gtk/spice-gtk_0.7-2.dsc
dpkg-source -x spice-gtk_0.7-2.dsc
It requires rebuild to enable gobject-introspection,which was done in PPA
"Build Spice-Gtk-0.7 via Debian Unstable with gobject-introspection enabled"
View :-
https://launchpad.net/~bderzhavets/+archive/test-deb
https://launchpad.net/~bderzhavets/+archive/test-deb2
View for step by step procedure description here :-
http://bderzhavets.wordpress.com/2011/08/20/rebuild-spice-gtk-0-7-via-debian-unstable-with-gobject-introspection-enabled/
Qemu-kvm 0.15.0 was built with changed dependencies in the same PPA
Packages from https://launchpad.net/~bderzhavets/+archive/test-deb2 installed
with no conflicts on Oneiric daily build 08/17/11.
Spice sessions (via VirtManager) in QXL mode (32M vram) for install and for runtime have been run.
Test with 64M vram for QXL device in Spice session with native libvirt 0.9.2-4ubuntu11 ( no patches )
gave negative result. Black screen
Upgrade Libvirt up to 0.9.3 via https://launchpad.net/~serge-hallyn/+archive/virt
still requires 32M limit for vram allocated for QXL device in spice session
*******************************************************************************************
Finally (09/05/11), Debian released spice-gtk-0.7-3 with introspecton enabled.
It has been built on Oneiric with no issues.
View : https://launchpad.net/~bderzhavets/+archive/test-deb4
*******************************************************************************************
The most recent snapshot for seabios supporting 64M vram for QXL device
uploaded to ppa:bderzhavets/test-deb2,ppa:bderzhavets/test-deb1
Another option use PPA "Seabios 0.6.2 patched to allocate 64M for QXL device"
https://launchpad.net/~bderzhavets/+archive/seabios62. It contains package
seabios-0.6.2-qxl-0ubuntu1 , which is, actually, seabios 0.6.2 patched in the same way as corresponding
seabios-0.6.2.fc16.src.rpm on F16
View for details : http://www.mail-archive.com/qemu-devel@nongnu.org/msg73569.html
With seabios-0.6.2-0ubuntu1 32M vram QXL patch will be required.
In case, new stable seabios release will be out in time 64M vram for QXL device in spice session won't be a problem
*******************************************************************************************
As ongoing development PPA "Spice 0.9.1 been built with embedded libcelt051 for Oneiric"
may be considered.
To test - install packages from PPA "Qemu-kvm-0.15.0 +noroms (spice enabled),
Spice Server&Client 0.8.2,Spice-Gtk-0.7-2 (via Debian)"
https://launchpad.net/~bderzhavets/+archive/spice-test.
Then attach to system https://launchpad.net/~bderzhavets/+archive/spice-test2
and run :-
$ sudo add-apt-repository ppa:bderzhavets/spice-test2
$ sudo apt-get update
$ sudo apt-get upgrade
Then Spice Server and Client on your system will be upgraded up to 0.9.1
********************************************************************************************
Two following PPAs seem to be a final draft for Oneiric
Qemu-kvm-0.15.0+noroms(spice enabled), Spice Server&Client 0.8.2, Spice-Gtk-0.7-2 (via Debian)
https://launchpad.net/~bderzhavets/+archive/spice-test
Qemu-kvm-0.15.0+noroms(spice enabled), Spice Server&Client 0.9.1, Spice-Gtk-0.7-2(via Debian)
https://launchpad.net/~bderzhavets/+archive/spice-test3
********************************************************************************************
Spice-Gtk-0.7.4X, LibUsbredir 0.3.1, Qemu-kvm-0.15.0 +noroms(spice enabled), Spice Server&Client 0.9.1
Packaged version version of Spice-Gtk-0.7.4X is built up on current snapshot of
git://anongit.freedesktop.org/spice/spice-gtk with GTK2 and GTK3 as two separate builds
following debian's Spice-Gtk-0.7-2 packaging schema.
Version of Spice-Gtk-0.7.4X been built include usb redirection
support and works stable with Spice 0.9.1 on Oneiric.
Libusb-1.0-2:1.0.9-3ubuntu9 is built up on git://people.freedesktop.org/~jwrdegoede/libusb
(pre 1.0.9). Usbredir-0.3.1-1ubuntu5 is built up on official release usbredir-0.3.1.tar.gz
Details here :
http://bderzhavets.wordpress.com/2011/09/30/spice-gtk-0-7-4x-via-git-clone-gitanongit-freedesktop-orgspicespice-gtk-libusbredir-0-3-1-qemu-kvm-0-15-0-noromsspice-enabled-spice-serverclient-0-9-1/
Running autogen.sh with exported environment variable NOCONFIGURE allows to
perform it in one build via Debian's 0.7-2 building schema. View
https://launchpad.net/~bderzhavets/+archive/lib-usbredir7/+packages
*********************************************************************************************
Set up Qemu&Spice USB Redirection on Ubuntu 11.10 (Oneiric)
View :-
https://launchpad.net/~bderzhavets/+archive/lib-usbredir15
https://launchpad.net/~bderzhavets/+archive/lib-usbredir16
Details may be viewed here :-
http://bderzhavets.wordpress.com/2011/10/09/usb-redirection-on-ubuntu-11-10-oneiric/
Qemu&Spice USB Redirection and Libvirt 0.9.6 on Ubuntu 11.10 (Oneiric)
https://launchpad.net/~bderzhavets/+archive/lib-usbredir19
installed on top regular Oneiric may be considered as Ubuntu's alternative for Fedora 16
UPDATE on 10/28/2011 Virt-manager 0.9.0 supporting USB redirection XML has been built in PPA
https://launchpad.net/~bderzhavets/+archive/virtual-3
View also PPA Qemu-kvm 0.15.1 & Spice USB Redirection support for Ubuntu Oneiric
https://launchpad.net/~bderzhavets/+archive/0151-usbredir
Please, be aware of unstable virt-manger behavior at domains shutdown it disconnects from Qemu.
This has random frequency even after applying recent patches to VirtManager and might be
considered as Libvirt 0.9.6 misbehavior reacting on events order when domain issues shutdown.
Similar bug already reported to RH's bugzilla.
**********************************************************************************************
Experimental build libvirt 0.9.7 in
PPA https://launchpad.net/~bderzhavets/+archive/experimental
via git://anonscm.debian.org/pkg-libvirt/libvirt.git
tip commit e49612bea22c681aff95c974d36d009a5ae08a21
for Precise seems to fix the bug.
VirtManager behaves tolerant regarding domain shuts down ( up to 7 )
Limited testing has been done on daily build 11/10/11.
Following PPAs
https://launchpad.net/~bderzhavets/+archive/0151-usbredir
https://launchpad.net/~bderzhavets/+archive/lib-usbredir19 - this PPA already has libvirt 0.9.7-2 been built
via Debian Unstable
https://launchpad.net/~bderzhavets/+archive/seabios163
allow spice upgrade up to 0.10.0 via PPA
https://launchpad.net/~bderzhavets/+archive/spice-010-oneiric
Users should be able to run spice server on 32-bit Oneiric.
Due to delay with official release libusb 1.0.9 builds in PPA
Qemu-kvm 0.15.1 & Spice 0.10.0 & Spice-Gtk-0.7.81 USB redirection for Precise (v.4)
https://launchpad.net/~bderzhavets/+archive/libusbredir-30
are based on git://git.libusb.org/libusb.git - 1.0.9-rc1 libusb-1.0.9-rc1 release candidate
View the most recent build based on Qemu-kvm 1.0 in PPA
Qemu-kvm 1.0 & Spice 0.10.0 & Spice-Gtk-0.7.81 USB redirection for Ubuntu Precise (v.6)
https://launchpad.net/~bderzhavets/+archive/lib-usbredir38
************************************************************************************************
Consider virsh domain management as stable solution in meantime
Regarding VirtFS support , it was activated in following PPAs per user's requests.
https://launchpad.net/~bderzhavets/+archive/0151-usbredir
https://launchpad.net/~bderzhavets/+archive/seabios163
If you need it somewhere else (i mean for my qemu-kvm builds ) feel free contact me via Launchpad
*********************************************************************************************
SECTIONS BELLOW IN MEANTIME ARE ACTUAL ONLY FOR NATTY
*********************************************************************************************

3. There is one issue at login prompt - mouse pointer might dissapear. The blind click on account bar makes it highlited.Press "Enter" and log in domain. Mouse pointer should be back either during password input or after login in VM's gnome desktop environment. After upgrade virtinst and virt-manager up to virtinst_0.500.6-1 and correspondently virt-manager_0.8.7-1. Fedora 15, 14 guests
1. May be installed in spice session in "QXL" video mode.
2. Don't have any problems with mouse pointer at login prompt.
Moreover, Ubuntu Desktop 11.04 been installed via upgraded Virt-Manager as "Linux" & "Fedora 15"
1. May be installed in spice session in "QXL" video mode.
2. Doesn't have any problems with mouse pointer at login prompt.
Upgrade was done via https://launchpad.net/ubuntu/oneiric/+source/virt-manager/0.8.7-1ubuntu1
Issue has been fixed. File $PWD/virtinst-0.500.6/virtinst/osdict.py has to be patched to add new entry "INPUT: USB_TABLET" to Ubuntu 11.04 section :-

  • "ubuntunatty": {
    • "label": "Ubuntu 11.04 (Natty Narwhal)", "distro": "ubuntu", "devices" : {
      • DISK : VIRTIO_DISK,
        NET : VIRTIO_NET,
        INPUT: USB_TABLET, <= Added

      }},


4. To fix the issue patched version virtinst-0.500.6-1ubuntu4 was uploaded to https://launchpad.net/~bderzhavets/+archive/git-spice/. Remove installed virtinst and virt-manager (0.8.6) and install virtinst-0.500.6-1ubuntu4 from mentioned PPA.
Build Virt-manager 0.8.7-1 from source https://launchpad.net/ubuntu/oneiric/+source/virt-manager and install via "dpkg -i virt-manager_0.8.7-1ubuntu2_all.deb"
Original source for virtinst package was picked up at https://launchpad.net/ubuntu/oneiric/+source/virtinst/0.500.6-1ubuntu1 and one patch for virtinst/osdict.py added.
Sections for Ubuntu 11.04,11.10 are updated in patched version of osdict.py as described above.
Windows doesn't experience this problem at all.
With patched virtinst package you should be able to install recent Fedora 15,14 and Ubuntu 11.04 via spice sessions ( "QXL" video mode ) initiated by virt-manager, successfuly complete guest install and log into domain with no problems with mouse pointer.
Notice, that this changes are not connected with QEMU-KVM upstream patches commited on 05/03/2011. Changes been done to original spice-gtk-0.6 package may be viewed at https://launchpadlibrarian.net/72410927/spice-gtk_0.6-0ubuntu1_0.6-0ubuntu4.diff.gz
View this blog entry for details :-
http://bderzhavets.wordpress.com/2011/05/23/set-up-spice-gtk-0-6-on-ubuntu-11-04-natty-narwhal/
5. To setup spicevmc channel on Natty i've rebuilt "qemu-kvm-0.14.0+noroms-0ubuntu7" in PPA https://launchpad.net/~bderzhavets/+archive/spice2.
All F15 patches :-
0001-qxl-spice-display-move-pipe-to-ssd.patch
0002-qxl-implement-get_command-in-vga-mode-without-locks.patch
0003-qxl-spice-remove-qemu_mutex_-un-lock_iothread-around.patch
0004-hw-qxl-render-drop-cursor-locks-replace-with-pipe.patch
0005-char-Split-out-tcp-socket-close-code-in-a-separate-f.patch
0006-char-Add-a-QemuChrHandlers-struct-to-initialise-char.patch
0007-iohandlers-Add-enable-disable_write_fd_handler-funct.patch
0008-char-Add-framework-for-a-write-unblocked-callback.patch
0009-char-Update-send_all-to-handle-nonblocking-chardev-w.patch
0010-char-Equip-the-unix-tcp-backend-to-handle-nonblockin.patch
0011-char-Throttle-when-host-connection-is-down.patch
0012-virtio-console-Enable-port-throttling-when-chardev-i.patch
0013-spice-qemu-char.c-add-throttling.patch
0014-spice-qemu-char.c-remove-intermediate-buffer.patch
0015-chardev-Allow-frontends-to-notify-backends-of-guest-.patch
0016-virtio-console-notify-backend-of-guest-open-close.patch
0017-spice-chardev-listen-to-frontend-guest-open-close.patch
0018-spice-qemu-char-Fix-flow-control-in-client-guest-dir.patch
have been applied
Installed VF15 KVM guest via :-
virt-install --connect qemu:///system --virt-type kvm --os-type=linux --os-variant=fedora15 \
--name VM15VMC --ram 2048 --disk path=/dev/sda5 --graphics spice --video qxl --channel spicevmc \
--cdrom /usr/tmp/Fedora-15-x86_64-DVD.iso --vcpus 2
Due to absence Virt-Manager's ability to create channels, e.g it's missing required F15 patches. Then in guest environment :
# sudo yum update
# sudo yum install spice-vdagent.
It provides an option cut text in VM Spice screen and paste in KVM Server Ubuntu 11.04 desktop environment and vice versa ....
Debian qemu-kvm packages providing spicevmc support have been also tested OK on Oneiric ( Libvirt 0.9.2)

********************************************************************************
UPDATE on 06/18/2011. Build qemu-kvm-060911-0ubuntu5 from
PPA https://launchpad.net/~bderzhavets/+archive/spice-gtk/+packages
"Packages in Spice-Gtk-0.6 on Ubuntu 11.04 and Ubuntu 11.10"
already supports spicevmc channel. It's original tarball is based on
git clone git://git.kernel.org/pub/scm/virt/kvm/qemu-kvm.git on 06/20/2011.

Some of upstream patches related to the feature :

http://git.kernel.org/?p=virt/kvm/qemu-kvm.git;a=search;s=Hans+de+Goede;st=author

2011-06-06

spice-qemu-char: Fix flow control in client -> guest...

2011-04-28

spice-chardev: listen to frontend guest open / close

2011-04-28

virtio-console: notify backend of guest open / close

2011-04-28

chardev: Allow frontends to notify backends of guest..

http://git.kernel.org/?p=virt/kvm/qemu-kvm.git;a=search;s=Alon+Levy;st=author

2011-01-24

spice: add chardev (v5)

5->6. Install Natty KVM guest as follows :-

virt-install --connect qemu:///system --virt-type kvm \
--os-type=linux --os-variant=ubuntunatty \
--name UbuntuVMC --ram 2048 --disk path=/dev/sdb7 \
--graphics spice --video qxl --channel spicevmc \
--cdrom /usr/tmp/ubuntuDesk11.04.iso --vcpus 2

When done install spice-vdagent for Natty via https://launchpad.net/~bderzhavets/+archive/spice2

Create file /etc/xdg/autostart/spice-vdagent.desktop

[Desktop Entry]
Name=Spice vdagent
Comment=Agent for Spice guests
Exec=/usr/bin/spice-vdagent
Terminal=false
Type=Application
Categories=
X-GNOME-Autostart-Phase=Initialization
X-GNOME-AutoRestart=true

Then start as service or via /etc/rc.local

# mkdir -p /var/run/spice-vdagentd/
# /usr/sbin/spice-vdagentd &

Current Build is just for testing.

All actions above should be incapsulated in debian package.

If feature doesn't work :-

boris@boris-virtual-machine:~$ ps -ef|grep spice-
root      1044     1  0 18:25 ?        00:00:00 /usr/sbin/spice-vdagentd
boris     1439  1379  0 18:25 pts/0    00:00:00 grep --color=auto spice-
boris@boris-virtual-machine:~$ /usr/bin/spice-vdagent &
[1] 1445

Details of setup new service on Natty may be viewed here :-

http://bderzhavets.wordpress.com/2011/06/13/setup-spicevmc-channel-on-ubuntu-11-04-and-ubuntu-11-10/

Current versions of spice-vdagent install service and spice-vdagent.desktop file automatically and require guest restart for activation or manual gdm restart and starting service.

7. As of 07/04/2011 Packages virt-manager-0.8.7-2ubuntu7 and virtinst-0.500.6-2ubuntu9 installed via PPA https://launchpad.net/~bderzhavets/+archive/spice-gtk support spicevmc channel on Oneiric.

Packages virt-manager-0.8.7-4ubuntu7 and virtinst-0.500.6-5ubuntu9 support spicevmc channel on Natty.

8. Windows 7 KVM install with unstable version qemu-kvm ( 0.14.5 )

Either virt-manager or virt-install cannot attach floppy virtio-win-1.1.16.vfd to load viostor.sys during install on device defined as "Virtio". Same driver may be installed via CD image virtio-win-1.1.16.iso. Link for rpm download http://rghost.net/3412907

$sudo alien -d virtio-win-1.1.16-0.el6.noarch.rpm
$sudo dpkg -i virtio-win-1.1.16-0_all.deb
$cd /usr/share/virtio-win
$ls -l
total 50384
drwxr-xr-x 4 root root     4096 2011-07-05 08:08 drivers
-rw-r--r-- 1 root root 50112512 2010-09-27 23:43 virtio-win-1.1.16.iso
-rw-r--r-- 1 root root  1474560 2010-09-27 23:26 virtio-win-1.1.16.vfd
lrwxrwxrwx 1 root root       21 2011-07-05 08:08 virtio-win.iso -> virtio-win-1.1.16.iso
lrwxrwxrwx 1 root root       21 2011-07-05 08:08 virtio-win.vfd -> virtio-win-1.1.16.vfd

spice (last edited 2013-09-21 22:37:23 by 187-40-174-46)